Example #1
0
def test_validation_fails_on_missing_required_key(required_dict):
    for key in required_dict.keys():
        test_dict = required_dict.copy()
        test_dict.pop(key)
        element = examinee.AwsProfile(name='foo', raw_dict=test_dict)
        with pytest.raises(ModelValidationError):
            element.validate()
Example #2
0
def test_validation_succeeds_on_required_dict(required_dict):
    element = examinee.AwsProfile(
        name='foo',
        raw_dict=required_dict,
        type_name='aws',
    )
    element.validate()
Example #3
0
def test_validation_succeeds_on_unknown_key(required_dict):
    test_dict = {**required_dict, **{'foo': 'bar'}}
    element = examinee.AwsProfile(
        name='foo',
        raw_dict=test_dict,
        type_name='aws',
    )
    element.validate()