Example #1
0
def test_mapping_tuple():
    d = {'a': [1, 2, 3], 'b': [4]}
    assert _mapping_to_tuple_pairs(d) == ((('a', 1), ('b', 4)),
                                          (('a', 2), ('b', 4)),
                                          (('a', 3), ('b', 4)))
Example #2
0
def test_order_does_not_matter():
    a = {1: (1, 2, 3), 2: (4, (5, 6))}
    b = {2: (4, (5, 6)), 1: (1, 2, 3)}
    assert _mapping_to_tuple_pairs(a) == _mapping_to_tuple_pairs(b)
Example #3
0
def test_mapping_tuple_single_kv():
    d = {'a': [1, 2, 3]}
    assert _mapping_to_tuple_pairs(d) == ((('a', 1),), (('a', 2),),
                                          (('a', 3),))
Example #4
0
def test_mapping_tuple_single_element():
    d = {'a': [1, 2, 3], 'b': 4}
    assert _mapping_to_tuple_pairs(d) == ((('a', 1), ('b', 4)),
                                          (('a', 2), ('b', 4)),
                                          (('a', 3), ('b', 4)))