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