view tests/test-hg-parseurl.py @ 32161:cff15c64f57e

py3: rename test-check-py3-commands.t to test-py3-commands.t test-check-*.t is a set of tests which tests certain coding style checks. So this test was wrongly named, thanks to marmoute for pointing this out.
author Pulkit Goyal <7895pulkit@gmail.com>
date Thu, 04 May 2017 04:42:05 +0530
parents d26c4af27978
children 11d128a14ec0
line wrap: on
line source

from __future__ import absolute_import, print_function

from mercurial import (
    hg,
)

def testparse(url, branch=[]):
    print('%s, branches: %r' % hg.parseurl(url, branch))

testparse('http://example.com/no/anchor')
testparse('http://example.com/an/anchor#foo')
testparse('http://example.com/no/anchor/branches', branch=['foo'])
testparse('http://example.com/an/anchor/branches#bar', branch=['foo'])
testparse('http://example.com/an/anchor/branches-None#foo', branch=None)
testparse('http://example.com/')
testparse('http://example.com')
testparse('http://example.com#foo')