def test_invertm_unit(self): m = {"a": [1, 2, 3], "b": [2, 3, 4]} expected = { 1: {"a"}, 2: {"a", "b"}, 3: {"a", "b"}, 4: {"b"}, } self.assertDictEqual(u.invertm(m), expected)
def test_invertm_unit(): m = {"a": [1, 2, 3], "b": [2, 3, 4]} expected = { 1: {"a"}, 2: {"a", "b"}, 3: {"a", "b"}, 4: {"b"}, } assert u.invertm(m) == expected
def test_invertm(self, m): self.assertDictEqual(m, u.invertm(u.invertm(m)))
def invert_inner(d): return {k: u.invertm(v) for k, v in d.items()}
def test_invertm(m): assert m == u.invertm(u.invertm(m))