コード例 #1
0
def test_clone_no_cache(tmpdir):
    """ cloning operation should not call any cloning operations and succeed"""

    def mocked_cache(*args):
        return False

    local_remote = setup_hg_repo(tmpdir.path)
    output = os.path.join(tmpdir.path, 'cloned_repo')
    with mock.patch('checkout.clone_from_cache', side_effect=mocked_cache):
        assert checkout.clone(local_remote, output)
        assert os.path.exists(os.path.join(output, '.hg', 'hgrc'))
コード例 #2
0
def test_clone_already_invalid_vcs(tmpdir):
    """ clone operation should not succeed when the folder is not a repo"""
    assert not checkout.clone(TEST_HG_REPO_REMOTE, tmpdir.path)
コード例 #3
0
def test_clone_already_exists(tmpdir):
    """ cloning operation should not call any cloning operations and succeed"""
    output = setup_hg_repo(tmpdir.path)
    with mock.patch('checkout.clone_from_cache') as mocked:
        assert checkout.clone(TEST_HG_REPO_REMOTE, output)
        assert not mocked.called