tests/test-hg-parseurl.py
author Yuya Nishihara <yuya@tcha.org>
Sat, 08 Jan 2011 21:52:25 +0900
branchstable
changeset 13248 00411a4fa1bb
parent 12865 4c50552fc9bc
child 13897 375872fdadba
permissions -rw-r--r--
url: fix UnicodeDecodeError on certificate verification error SSLSocket.getpeercert() returns tuple containing unicode for 'subject'. Since Mercurial does't support IDN at all, it just returns error for non-ascii certname.

from mercurial.hg import parseurl

def testparse(url, branch=[]):
    print '%s, branches: %r' % 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)