Mercurial > public > mercurial-scm > hg-stable
diff tests/test-hg-parseurl.py @ 46908:4452cb788404
urlutil: extract `parseurl` from `hg` into the new module
The new module is well fitting for this new code. And this will be useful to
make the gathered code collaborate more later.
Differential Revision: https://phab.mercurial-scm.org/D10375
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 12 Apr 2021 06:34:54 +0200 |
parents | 2372284d9457 |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/tests/test-hg-parseurl.py Mon Apr 12 03:01:04 2021 +0200 +++ b/tests/test-hg-parseurl.py Mon Apr 12 06:34:54 2021 +0200 @@ -2,44 +2,48 @@ import unittest -from mercurial import hg +from mercurial.utils import urlutil class ParseRequestTests(unittest.TestCase): def testparse(self): self.assertEqual( - hg.parseurl(b'http://example.com/no/anchor'), + urlutil.parseurl(b'http://example.com/no/anchor'), (b'http://example.com/no/anchor', (None, [])), ) self.assertEqual( - hg.parseurl(b'http://example.com/an/anchor#foo'), + urlutil.parseurl(b'http://example.com/an/anchor#foo'), (b'http://example.com/an/anchor', (b'foo', [])), ) self.assertEqual( - hg.parseurl(b'http://example.com/no/anchor/branches', [b'foo']), + urlutil.parseurl( + b'http://example.com/no/anchor/branches', [b'foo'] + ), (b'http://example.com/no/anchor/branches', (None, [b'foo'])), ) self.assertEqual( - hg.parseurl(b'http://example.com/an/anchor/branches#bar', [b'foo']), + urlutil.parseurl( + b'http://example.com/an/anchor/branches#bar', [b'foo'] + ), (b'http://example.com/an/anchor/branches', (b'bar', [b'foo'])), ) self.assertEqual( - hg.parseurl( + urlutil.parseurl( b'http://example.com/an/anchor/branches-None#foo', None ), (b'http://example.com/an/anchor/branches-None', (b'foo', [])), ) self.assertEqual( - hg.parseurl(b'http://example.com/'), + urlutil.parseurl(b'http://example.com/'), (b'http://example.com/', (None, [])), ) self.assertEqual( - hg.parseurl(b'http://example.com'), + urlutil.parseurl(b'http://example.com'), (b'http://example.com/', (None, [])), ) self.assertEqual( - hg.parseurl(b'http://example.com#foo'), + urlutil.parseurl(b'http://example.com#foo'), (b'http://example.com/', (b'foo', [])), )