Now passes on Python 3.
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG5dd71e9ae68a: tests: add b prefixes to test-hg-parseurl.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Now passes on Python 3.
Lint Skipped |
Unit Tests Skipped |
from __future__ import absolute_import, print_function | from __future__ import absolute_import, print_function | ||||
import unittest | import unittest | ||||
from mercurial import ( | from mercurial import ( | ||||
hg, | hg, | ||||
) | ) | ||||
class ParseRequestTests(unittest.TestCase): | class ParseRequestTests(unittest.TestCase): | ||||
def testparse(self): | def testparse(self): | ||||
self.assertEqual(hg.parseurl('http://example.com/no/anchor'), | self.assertEqual(hg.parseurl(b'http://example.com/no/anchor'), | ||||
('http://example.com/no/anchor', (None, []))) | (b'http://example.com/no/anchor', (None, []))) | ||||
self.assertEqual(hg.parseurl('http://example.com/an/anchor#foo'), | self.assertEqual(hg.parseurl(b'http://example.com/an/anchor#foo'), | ||||
('http://example.com/an/anchor', ('foo', []))) | (b'http://example.com/an/anchor', (b'foo', []))) | ||||
self.assertEqual( | self.assertEqual( | ||||
hg.parseurl('http://example.com/no/anchor/branches', ['foo']), | hg.parseurl(b'http://example.com/no/anchor/branches', [b'foo']), | ||||
('http://example.com/no/anchor/branches', (None, ['foo']))) | (b'http://example.com/no/anchor/branches', (None, [b'foo']))) | ||||
self.assertEqual( | self.assertEqual( | ||||
hg.parseurl('http://example.com/an/anchor/branches#bar', ['foo']), | hg.parseurl(b'http://example.com/an/anchor/branches#bar', [b'foo']), | ||||
('http://example.com/an/anchor/branches', ('bar', ['foo']))) | (b'http://example.com/an/anchor/branches', (b'bar', [b'foo']))) | ||||
self.assertEqual(hg.parseurl( | self.assertEqual(hg.parseurl( | ||||
'http://example.com/an/anchor/branches-None#foo', None), | b'http://example.com/an/anchor/branches-None#foo', None), | ||||
('http://example.com/an/anchor/branches-None', ('foo', []))) | (b'http://example.com/an/anchor/branches-None', (b'foo', []))) | ||||
self.assertEqual(hg.parseurl('http://example.com/'), | self.assertEqual(hg.parseurl(b'http://example.com/'), | ||||
('http://example.com/', (None, []))) | (b'http://example.com/', (None, []))) | ||||
self.assertEqual(hg.parseurl('http://example.com'), | self.assertEqual(hg.parseurl(b'http://example.com'), | ||||
('http://example.com/', (None, []))) | (b'http://example.com/', (None, []))) | ||||
self.assertEqual(hg.parseurl('http://example.com#foo'), | self.assertEqual(hg.parseurl(b'http://example.com#foo'), | ||||
('http://example.com/', ('foo', []))) | (b'http://example.com/', (b'foo', []))) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
import silenttestrunner | import silenttestrunner | ||||
silenttestrunner.main(__name__) | silenttestrunner.main(__name__) |