diff tests/test_fetch_command.py @ 1045:67e11b650e94

handle invalid UTF-8 in commit messages consistently 312f36a425f0 fixed this for replay, but not for stupid mode; we address this by consolidating our means of generating a Mercurial commit message in a single function in 'util.py'.
author Dan Villiom Podlaski Christiansen <dan@cabo.dk>
date Thu, 08 Aug 2013 09:38:55 +0200
parents d741f536f23a
children 903c9c9dfe6a
line wrap: on
line diff
--- a/tests/test_fetch_command.py
+++ b/tests/test_fetch_command.py
@@ -191,13 +191,16 @@ class TestBasicRepoLayout(test_util.Test
         self.assertMultiLineEqual(open(fixturepaths[0]).read(),
                                   open(fixturepaths[1]).read())
 
-    def test_invalid_message(self):
-        repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz')
+    def test_invalid_message(self, stupid=False):
+        repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz', stupid=stupid)
         # changelog returns descriptions in local encoding
         desc = encoding.fromlocal(repo[0].description())
         self.assertEqual(desc.decode('utf8'),
                          u'bl\xe5b\xe6rgr\xf8d')
 
+    def test_invalid_message_stupid(self):
+        self.test_invalid_message(True)
+
 
 class TestStupidPull(test_util.TestBase):
     def test_stupid(self):