def test_s2m2(): """ Test matrix construction. """ m, _ = sets2matrix(sa, X=['a', 'b', 'c']) true_m = {(0, 1, 0), (0, 0, 1), (0, 0, 0), (1, 0, 1), (1, 0, 0), (1, 1, 1), (1, 1, 0), (0, 1, 1)} assert set(map(tuple, m.tolist())) == true_m
def test_s2m1(): """ Test matrix construction. """ m, _ = sets2matrix(sa) true_m = set([(0, 1, 0), (0, 0, 1), (0, 0, 0), (1, 0, 1), (1, 0, 0), (1, 1, 1), (1, 1, 0), (0, 1, 1)]) assert set(map(tuple, m.tolist())) == true_m
def test_s2m2(): """ Test matrix construction. """ m, _ = sets2matrix(sa, X=['a', 'b', 'c']) true_m = set([(0, 1, 0), (0, 0, 1), (0, 0, 0), (1, 0, 1), (1, 0, 0), (1, 1, 1), (1, 1, 0), (0, 1, 1)]) assert set(map(tuple, m.tolist())) == true_m
def test_s2m3(): """ Test matrix construction. """ with pytest.raises(Exception): sets2matrix(sa, X=['a'])