Ejemplo n.º 1
0
def test_get_key_combination():

    flattened_schema = flatten_schema(schema)
    assert get_all_key_combinations(data, flattened_schema) ==\
        set([(),
            ('2', 0),
            ('2', 1),
            ('2', 1, '21', 0),
            ('2', 0, '21', 0),
            ('2', 1, '21', 1),
            ('2', 1, '21', 3),
            ]), get_all_key_combinations(data, flattened_schema)
Ejemplo n.º 2
0
def test_get_key_combination():

    flattened_schema = flatten_schema(schema)
    assert get_all_key_combinations(data, flattened_schema) == set([
        (),
        ("2", 0),
        ("2", 1),
        ("2", 1, "21", 0),
        ("2", 0, "21", 0),
        ("2", 1, "21", 1),
        ("2", 1, "21", 3),
    ]), get_all_key_combinations(data, flattened_schema)
Ejemplo n.º 3
0
def test_get_key_combination():

    flattened_schema = flatten_schema(schema)
    assert get_all_key_combinations(data, flattened_schema) ==\
        set([(),
            ('2', 0),
            ('2', 1),
            ('2', 1, '21', 0),
            ('2', 0, '21', 0),
            ('2', 1, '21', 1),
            ('2', 1, '21', 3),
            ]), get_all_key_combinations(data, flattened_schema)
Ejemplo n.º 4
0
def test_flatten_schema():

    flattened_schema = flatten_schema(schema)

    assert flattened_schema == {
        ('0', ): [identity_converter],
        ('1', ): [identity_converter],
        ('2', '20'): [identity_converter],
        ('2', '__after'): [identity_converter],
        ('2', '__before'): [identity_converter],
        ('2', '21', '210'): [identity_converter],
        ('2', '22'): [identity_converter],
        ('3', '30'): [identity_converter],
        ('__after', ): [identity_converter],
        ('__extra', ): [identity_converter],
        ('__junk', ): [identity_converter],
    }, pprint(flattened_schema)
Ejemplo n.º 5
0
def test_flatten_schema():

    flattened_schema = flatten_schema(schema)

    assert flattened_schema == {
        ("0", ): [identity_converter],
        ("1", ): [identity_converter],
        ("2", "20"): [identity_converter],
        ("2", "__after"): [identity_converter],
        ("2", "__before"): [identity_converter],
        ("2", "21", "210"): [identity_converter],
        ("2", "22"): [identity_converter],
        ("3", "30"): [identity_converter],
        ("__after", ): [identity_converter],
        ("__extra", ): [identity_converter],
        ("__junk", ): [identity_converter],
    }
Ejemplo n.º 6
0
    def test_flatten_schema(self):

        flattened_schema = flatten_schema(schema)

        assert flattened_schema == {
            ("0",): [identity_converter],
            ("1",): [identity_converter],
            ("2", "20"): [identity_converter],
            ("2", "__after"): [identity_converter],
            ("2", "__before"): [identity_converter],
            ("2", "21", "210"): [identity_converter],
            ("2", "22"): [identity_converter],
            ("3", "30"): [identity_converter],
            ("__after",): [identity_converter],
            ("__extra",): [identity_converter],
            ("__junk",): [identity_converter],
        }, pprint(flattened_schema)
Ejemplo n.º 7
0
def test_flatten_schema():

    flattened_schema = flatten_schema(schema)

    assert flattened_schema == {
         ('0',): [identity_converter],
         ('1',): [identity_converter],
         ('2', '20'): [identity_converter],
         ('2', '__after'): [identity_converter],
         ('2', '__before'): [identity_converter],
         ('2', '21', '210'): [identity_converter],
         ('2', '22'): [identity_converter],
         ('3', '30'): [identity_converter],
         ('__after',): [identity_converter],
         ('__extra',): [identity_converter],
         ('__junk',): [identity_converter],
    }, pprint(flattened_schema)
Ejemplo n.º 8
0
    def test_get_key_combination(self):

        flattened_schema = flatten_schema(schema)
        assert get_all_key_combinations(data, flattened_schema) == set(
            [(), ("2", 0), ("2", 1), ("2", 1, "21", 0), ("2", 0, "21", 0), ("2", 1, "21", 1), ("2", 1, "21", 3)]
        ), get_all_key_combinations(data, flattened_schema)