Exemplo n.º 1
0
def test_to_dict_modifying_the_dict_doesnt_modify_the_schema():
    original_schema_dict = {
        'foo': 'bar',
    }
    schema = Profile(original_schema_dict)
    schema_dict = schema.to_dict()
    schema_dict['bar'] = 'baz'
    assert 'bar' not in schema.to_dict()
Exemplo n.º 2
0
def test_to_dict_modifying_the_dict_doesnt_modify_the_schema():
    original_schema_dict = {
        'foo': 'bar',
    }
    schema = Profile(original_schema_dict)
    schema_dict = schema.to_dict()
    schema_dict['bar'] = 'baz'
    assert 'bar' not in schema.to_dict()
Exemplo n.º 3
0
def test_init_changing_the_original_schema_dict_doesnt_change_schema():
    schema_dict = {
        'foo': 'bar'
    }
    schema = Profile(schema_dict)
    schema_dict['bar'] = 'baz'
    assert 'bar' not in schema.to_dict()
Exemplo n.º 4
0
def test_init_loads_schema_from_dict():
    schema_dict = {
        'foo': 'bar'
    }
    schema = Profile(schema_dict)
    assert schema.to_dict().keys() == schema_dict.keys()
    assert schema.to_dict()['foo'] == schema_dict['foo']
Exemplo n.º 5
0
def test_init_changing_the_original_schema_dict_doesnt_change_schema():
    schema_dict = {
        'foo': 'bar'
    }
    schema = Profile(schema_dict)
    schema_dict['bar'] = 'baz'
    assert 'bar' not in schema.to_dict()
Exemplo n.º 6
0
def test_init_loads_schema_from_dict():
    schema_dict = {
        'foo': 'bar'
    }
    schema = Profile(schema_dict)
    assert schema.to_dict().keys() == schema_dict.keys()
    assert schema.to_dict()['foo'] == schema_dict['foo']
Exemplo n.º 7
0
def test_to_dict_converts_schema_to_dict():
    original_schema_dict = {
        'foo': 'bar',
    }
    schema = Profile(original_schema_dict)
    assert schema.to_dict() == original_schema_dict
Exemplo n.º 8
0
def test_to_dict_converts_schema_to_dict():
    original_schema_dict = {
        'foo': 'bar',
    }
    schema = Profile(original_schema_dict)
    assert schema.to_dict() == original_schema_dict