def test_merge_tagged_possibilities(): abc = TaggedPossibilities([[1, 'a'], [2, 'b'], [3, 'c']]) ab = TaggedPossibilities([[1, 'a'], [2, 'b']]) bc = TaggedPossibilities([[2, 'b'], [3, 'c']]) b = TaggedPossibilities([[2, 'b']]) assert amerge(ab, bc, forced=False) == abc assert amerge(ab, b, forced=False) is ab assert amerge(b, ab, forced=False) is ab with pytest.raises(MyiaTypeError): amerge(ab, bc, forced=True)
def test_tagged_possibilities(): abc = TaggedPossibilities([[1, 'a'], [2, 'b'], [3, 'c']]) cab = TaggedPossibilities([[3, 'c'], [1, 'a'], [2, 'b']]) assert abc == cab assert abc.get(1) == 'a' with pytest.raises(KeyError): abc.get(4)
def test_tagged_possibilities(): abc = TaggedPossibilities([[1, "a"], [2, "b"], [3, "c"]]) cab = TaggedPossibilities([[3, "c"], [1, "a"], [2, "b"]]) assert abc == cab assert abc.get(1) == "a" with pytest.raises(KeyError): abc.get(4)