Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
def test_s2m3():
    """
    Test matrix construction.
    """
    with pytest.raises(Exception):
        sets2matrix(sa, X=['a'])
Esempio n. 5
0
def test_s2m3():
    """
    Test matrix construction.
    """
    with pytest.raises(Exception):
        sets2matrix(sa, X=['a'])