def test_migrate_to_sha_ok(): dct = {'repo': 'a', 'rev': 'b'} MigrateShaToRev().apply_default(dct) assert dct == {'repo': 'a', 'rev': 'b'}
def test_migrate_sha_to_rev_dont_specify_both(): with pytest.raises(cfgv.ValidationError) as excinfo: MigrateShaToRev().check({'repo': 'a', 'sha': 'b', 'rev': 'c'}) msg, = excinfo.value.args assert msg == 'Cannot specify both sha and rev'
def test_migrate_sha_to_rev_conditional_check_failures(dct): with pytest.raises(cfgv.ValidationError): MigrateShaToRev().check(dct)
def test_migrate_sha_to_rev_ok(dct): MigrateShaToRev().check(dct)