# HG changeset patch # User Kevin Bullock # Date 1501970613 18000 # Node ID fa08148bc5fc40aa1eb75a5b2c651f7d5dd58cf4 # Parent ada8dba23fd0e7501c5f66ec3f2b17adcc6f6188 git_handler: use namedtuple as mock repo in doctests The tests were broken by 715cbf3fa24c with the switch to using repo.vfs, but this was masked by the fact that the Makefile is only set to run tests for git2hg.py. We'll tackle that in an upcoming changeset. diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -616,8 +616,11 @@ TESTS: + >>> from collections import namedtuple >>> from mercurial.ui import ui - >>> g = GitHandler('', ui()).get_valid_git_username_email + >>> mockrepo = namedtuple('localrepo', ['vfs']) + >>> mockrepo.vfs = '' + >>> g = GitHandler(mockrepo, ui()).get_valid_git_username_email >>> g('John Doe') 'John Doe' >>> g('john@doe.com') @@ -1642,9 +1645,12 @@ Tests: + >>> from collections import namedtuple >>> from dulwich.client import HttpGitClient, SSHGitClient >>> from mercurial.ui import ui - >>> g = GitHandler('', ui()) + >>> mockrepo = namedtuple('localrepo', ['vfs']) + >>> mockrepo.vfs = '' + >>> g = GitHandler(mockrepo, ui()) >>> client, url = g.get_transport_and_path('http://fqdn.com/test.git') >>> print isinstance(client, HttpGitClient) True