def test_path_is_invalid_hg_repo(tmpdir): """ when the hgrc does not contain the remote alias, should return false""" output = setup_hg_repo(tmpdir.path) assert not checkout.path_is_hg_repo(output, checkout.get_alias( 'https://hg.mozilla.org/mozilla-central'))
def test_alias(): """ resulting alias should be the url stripped of the protocol""" test_input = 'https://foo.org/bar' expected = 'foo.org/bar' actual = checkout.get_alias(test_input) eq_(expected, actual)
def test_path_is_hg_repo(tmpdir): """ should succeed when a path is a valid mercurial repository""" output = setup_hg_repo(tmpdir.path) assert checkout.path_is_hg_repo(output, checkout.get_alias(TEST_HG_REPO_REMOTE))