Esempio n. 1
0
def test_reverse_dict():
    d = {"a": (1, 2), "b": (2, 3), "c": ()}
    # Python 3.3 enable by default random hash for dict.
    # This change the order of traversal, so this can give 2 outputs
    assert reverse_dict(d) == {
        1: ("a", ),
        2: ("a", "b"),
        3: ("b", )
    } or reverse_dict(d) == {
        1: ("a", ),
        2: ("b", "a"),
        3: ("b", )
    }
Esempio n. 2
0
def test_reverse_dict():
    d = {'a': (1, 2), 'b': (2, 3), 'c': ()}
    # Python 3.3 enable by default random hash for dict.
    # This change the order of traversal, so this can give 2 outputs
    assert (reverse_dict(d) == {
        1: ('a', ),
        2: ('a', 'b'),
        3: ('b', )
    } or reverse_dict(d) == {
        1: ('a', ),
        2: ('b', 'a'),
        3: ('b', )
    })
Esempio n. 3
0
def test_reverse_dict():
    d = {'a': (1, 2), 'b': (2, 3), 'c': ()}
    # Python 3.3 enable by default random hash for dict.
    # This change the order of traversal, so this can give 2 outputs
    assert (reverse_dict(d) == {1: ('a',), 2: ('a', 'b'), 3: ('b',)} or
            reverse_dict(d) == {1: ('a',), 2: ('b', 'a'), 3: ('b',)})
Esempio n. 4
0
def test_reverse_dict():
    d = {'a': (1, 2), 'b': (2, 3), 'c': ()}
    assert reverse_dict(d) == {1: ('a',), 2: ('a', 'b'), 3: ('b',)}
Esempio n. 5
0
def test_reverse_dict():
    d = {"a": (1, 2), "b": (2, 3), "c": ()}
    assert reverse_dict(d) == {1: ("a",), 2: ("a", "b"), 3: ("b",)}
Esempio n. 6
0
def test_reverse_dict():
    d = {'a': (1, 2), 'b': (2, 3), 'c': ()}
    assert reverse_dict(d) == {1: ('a',), 2: ('a', 'b'), 3: ('b',)}