コード例 #1
0
def test_hook_disppearing_repo_raises(hook_disappearing_repo, store):
    config = make_config_from_repo(
        hook_disappearing_repo.path,
        rev=hook_disappearing_repo.original_rev,
        hooks=[OrderedDict((('id', 'foo'), ))],
    )
    with pytest.raises(RepositoryCannotBeUpdatedError):
        _update_repo(config, store, tags_only=False)
コード例 #2
0
def test_hook_disppearing_repo_raises(hook_disappearing_repo, store):
    config = make_config_from_repo(
        hook_disappearing_repo.path,
        rev=hook_disappearing_repo.original_rev,
        hooks=[{'id': 'foo'}],
    )
    with pytest.raises(RepositoryCannotBeUpdatedError):
        _update_repo(config, store, tags_only=False)
コード例 #3
0
ファイル: autoupdate_test.py プロジェクト: Lucas-C/pre-commit
def test_hook_disppearing_repo_raises(
        hook_disappearing_repo, runner_with_mocked_store,
):
    config = make_config_from_repo(
        hook_disappearing_repo.path,
        sha=hook_disappearing_repo.original_sha,
        hooks=[OrderedDict((('id', 'foo'),))],
    )
    with pytest.raises(RepositoryCannotBeUpdatedError):
        _update_repo(config, runner_with_mocked_store, tags_only=False)
コード例 #4
0
def test_out_of_date_repo(out_of_date_repo, runner_with_mocked_store):
    config = make_config_from_repo(
        out_of_date_repo.path, sha=out_of_date_repo.original_sha,
    )
    ret = _update_repo(config, runner_with_mocked_store, tags_only=False)
    assert ret['sha'] != out_of_date_repo.original_sha
    assert ret['sha'] == out_of_date_repo.head_sha
コード例 #5
0
ファイル: autoupdate_test.py プロジェクト: Lucas-C/pre-commit
def test_out_of_date_repo(out_of_date_repo, runner_with_mocked_store):
    config = make_config_from_repo(
        out_of_date_repo.path, sha=out_of_date_repo.original_sha,
    )
    ret = _update_repo(config, runner_with_mocked_store, tags_only=False)
    assert ret['sha'] != out_of_date_repo.original_sha
    assert ret['sha'] == out_of_date_repo.head_sha
コード例 #6
0
def test_out_of_date_repo(out_of_date_repo, store):
    config = make_config_from_repo(
        out_of_date_repo.path, rev=out_of_date_repo.original_rev,
    )
    ret = _update_repo(config, store, tags_only=False)
    assert ret['rev'] != out_of_date_repo.original_rev
    assert ret['rev'] == out_of_date_repo.head_rev
コード例 #7
0
def test_out_of_date_repo(out_of_date_repo, store):
    config = make_config_from_repo(
        out_of_date_repo.path, rev=out_of_date_repo.original_rev,
    )
    ret = _update_repo(config, store, tags_only=False)
    assert ret['rev'] != out_of_date_repo.original_rev
    assert ret['rev'] == out_of_date_repo.head_rev
コード例 #8
0
def test_up_to_date_repo(up_to_date_repo, store):
    config = make_config_from_repo(up_to_date_repo)
    input_rev = config['rev']
    ret = _update_repo(config, store, tags_only=False)
    assert ret['rev'] == input_rev
コード例 #9
0
def test_up_to_date_repo(up_to_date_repo, runner_with_mocked_store):
    config = make_config_from_repo(up_to_date_repo)
    input_sha = config['sha']
    ret = _update_repo(config, runner_with_mocked_store, tags_only=False)
    assert ret['sha'] == input_sha
コード例 #10
0
ファイル: autoupdate_test.py プロジェクト: Lucas-C/pre-commit
def test_up_to_date_repo(up_to_date_repo, runner_with_mocked_store):
    config = make_config_from_repo(up_to_date_repo)
    input_sha = config['sha']
    ret = _update_repo(config, runner_with_mocked_store, tags_only=False)
    assert ret['sha'] == input_sha
コード例 #11
0
def test_up_to_date_repo(up_to_date_repo, store):
    config = make_config_from_repo(up_to_date_repo)
    input_rev = config['rev']
    ret = _update_repo(config, store, tags_only=False)
    assert ret['rev'] == input_rev