Mercurial > hgsubversion
comparison 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 |
comparison
equal
deleted
inserted
replaced
1044:d741f536f23a | 1045:67e11b650e94 |
---|---|
189 os.path.join(test_util.FIXTURES, 'non_ascii_path_2.svndump'), | 189 os.path.join(test_util.FIXTURES, 'non_ascii_path_2.svndump'), |
190 ] | 190 ] |
191 self.assertMultiLineEqual(open(fixturepaths[0]).read(), | 191 self.assertMultiLineEqual(open(fixturepaths[0]).read(), |
192 open(fixturepaths[1]).read()) | 192 open(fixturepaths[1]).read()) |
193 | 193 |
194 def test_invalid_message(self): | 194 def test_invalid_message(self, stupid=False): |
195 repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz') | 195 repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz', stupid=stupid) |
196 # changelog returns descriptions in local encoding | 196 # changelog returns descriptions in local encoding |
197 desc = encoding.fromlocal(repo[0].description()) | 197 desc = encoding.fromlocal(repo[0].description()) |
198 self.assertEqual(desc.decode('utf8'), | 198 self.assertEqual(desc.decode('utf8'), |
199 u'bl\xe5b\xe6rgr\xf8d') | 199 u'bl\xe5b\xe6rgr\xf8d') |
200 | |
201 def test_invalid_message_stupid(self): | |
202 self.test_invalid_message(True) | |
200 | 203 |
201 | 204 |
202 class TestStupidPull(test_util.TestBase): | 205 class TestStupidPull(test_util.TestBase): |
203 def test_stupid(self): | 206 def test_stupid(self): |
204 repo = self._load_fixture_and_fetch('two_heads.svndump', stupid=True) | 207 repo = self._load_fixture_and_fetch('two_heads.svndump', stupid=True) |