comparison hggit/git_handler.py @ 1096:c64b73b9783f

git_handler: fix doctests
author Sean Farley <sean@farley.io>
date Mon, 27 Nov 2017 19:15:25 -0500
parents 5e49230a6cd5
children 843f409526fb
comparison
equal deleted inserted replaced
1095:60a82693d43c 1096:c64b73b9783f
647 647
648 TESTS: 648 TESTS:
649 649
650 >>> from collections import namedtuple 650 >>> from collections import namedtuple
651 >>> from mercurial.ui import ui 651 >>> from mercurial.ui import ui
652 >>> mockrepo = namedtuple('localrepo', ['vfs']) 652 >>> mockrepo = namedtuple('localrepo', ['vfs', 'sharedpath', 'path'])
653 >>> mockrepo.vfs = '' 653 >>> mockrepo.vfs = ''
654 >>> mockrepo.sharedpath = ''
655 >>> mockrepo.path = ''
654 >>> g = GitHandler(mockrepo, ui()).get_valid_git_username_email 656 >>> g = GitHandler(mockrepo, ui()).get_valid_git_username_email
655 >>> g('John Doe') 657 >>> g('John Doe')
656 'John Doe' 658 'John Doe'
657 >>> g('john@doe.com') 659 >>> g('john@doe.com')
658 'john@doe.com' 660 'john@doe.com'
1692 Tests: 1694 Tests:
1693 1695
1694 >>> from collections import namedtuple 1696 >>> from collections import namedtuple
1695 >>> from dulwich.client import HttpGitClient, SSHGitClient 1697 >>> from dulwich.client import HttpGitClient, SSHGitClient
1696 >>> from mercurial.ui import ui 1698 >>> from mercurial.ui import ui
1697 >>> mockrepo = namedtuple('localrepo', ['vfs']) 1699 >>> mockrepo = namedtuple('localrepo', ['vfs', 'sharedpath', 'path'])
1698 >>> mockrepo.vfs = '' 1700 >>> mockrepo.vfs = ''
1701 >>> mockrepo.sharedpath = ''
1702 >>> mockrepo.path = ''
1699 >>> g = GitHandler(mockrepo, ui()) 1703 >>> g = GitHandler(mockrepo, ui())
1700 >>> client, url = g.get_transport_and_path('http://fqdn.com/test.git') 1704 >>> client, url = g.get_transport_and_path('http://fqdn.com/test.git')
1701 >>> print isinstance(client, HttpGitClient) 1705 >>> print isinstance(client, HttpGitClient)
1702 True 1706 True
1703 >>> print url 1707 >>> print url