def test_conversion_flip_fields(): d = {'a': 'b', 'c': 'd'} s = {'a': 'c', 'c': 'a'} eq_( covert_with_schema(d, s), {"c": "b", 'a': 'd'}, "Flip two fields" )
def test_basic_conversion(): d = {'a': 'b'} s = {'a': 'to_e'} eq_( covert_with_schema(d, s), {"to_e": "b"}, "Basic convert" )
def test_hide_to_inner_dict(): d = {'a': 'b', 'c': 'd'} s = {'a': 'c.a', 'c': 'c.c'} eq_( covert_with_schema(d, s), {'c': {'a': 'b', 'c': 'd'}}, "Hide to inner dict" )
def test_catch_data_loose(): d = {'a': 'b', 'c': 'd'} s = {'a': 'c.a', 'c.b': 'a'} eq_( covert_with_schema(d, s), {'c': {'a': 'b', 'c': 'd'}}, "Hide to inner dict" )