Mercurial > hgsubversion
comparison tests/test_fetch_command.py @ 910:312f36a425f0
Ignore invalid utf8 in commit messages
Old svn allowed users to include invalid utf8 in their commits. Since
there are real repos with said invalid utf8, we need to be able to
import them, even if svn won't.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Thu, 17 May 2012 14:15:14 -0700 |
parents | 20e73b5ab6f7 |
children | e252f9355933 |
comparison
equal
deleted
inserted
replaced
909:e42a05915edf | 910:312f36a425f0 |
---|---|
173 | 173 |
174 for r in repo: | 174 for r in repo: |
175 self.assertEqual(repo[r].hex(), repo2[r].hex()) | 175 self.assertEqual(repo[r].hex(), repo2[r].hex()) |
176 | 176 |
177 def test_path_quoting_stupid(self): | 177 def test_path_quoting_stupid(self): |
178 self.test_path_quoting(True) | 178 repo = self.test_path_quoting(True) |
179 | |
179 | 180 |
180 def test_identical_fixtures(self): | 181 def test_identical_fixtures(self): |
181 '''ensure that the non_ascii_path_N fixtures are identical''' | 182 '''ensure that the non_ascii_path_N fixtures are identical''' |
182 fixturepaths = [ | 183 fixturepaths = [ |
183 os.path.join(test_util.FIXTURES, 'non_ascii_path_1.svndump'), | 184 os.path.join(test_util.FIXTURES, 'non_ascii_path_1.svndump'), |
184 os.path.join(test_util.FIXTURES, 'non_ascii_path_2.svndump'), | 185 os.path.join(test_util.FIXTURES, 'non_ascii_path_2.svndump'), |
185 ] | 186 ] |
186 self.assertMultiLineEqual(open(fixturepaths[0]).read(), | 187 self.assertMultiLineEqual(open(fixturepaths[0]).read(), |
187 open(fixturepaths[1]).read()) | 188 open(fixturepaths[1]).read()) |
188 | 189 |
190 def test_invalid_message(self): | |
191 repo = self._load_fixture_and_fetch('invalid_utf8.tar.gz') | |
192 self.assertEqual(repo[0].description().decode('utf8'), | |
193 u'bl\xe5b\xe6rgr\xf8d') | |
194 | |
195 | |
189 class TestStupidPull(test_util.TestBase): | 196 class TestStupidPull(test_util.TestBase): |
190 def test_stupid(self): | 197 def test_stupid(self): |
191 repo = self._load_fixture_and_fetch('two_heads.svndump', stupid=True) | 198 repo = self._load_fixture_and_fetch('two_heads.svndump', stupid=True) |
192 self.assertEqual(node.hex(repo[0].node()), | 199 self.assertEqual(node.hex(repo[0].node()), |
193 '434ed487136c1b47c1e8f952edb4dc5a8e6328df') | 200 '434ed487136c1b47c1e8f952edb4dc5a8e6328df') |