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)))
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)
def test_mapping_tuple_single_kv(): d = {'a': [1, 2, 3]} assert _mapping_to_tuple_pairs(d) == ((('a', 1),), (('a', 2),), (('a', 3),))
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)))