Esempio n. 1
0
def test_can_be_connected_with_single_buffer():
    con_table = np.array([[0, 0, 0, 0, 0], [1, 1, 0, 0, 0], [0, 0, 0, 1, 1],
                          [0, 1, 1, 1, 0], [1, 1, 1, 1, 1]]).T
    assert Hub.can_be_connected_with_single_buffer(con_table)

    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 0, 1, 0],  # < the bad boy
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]
    ]).T
    assert not Hub.can_be_connected_with_single_buffer(con_table)
Esempio n. 2
0
def test_can_be_connected_with_single_buffer():
    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]]).T
    assert Hub.can_be_connected_with_single_buffer(con_table)

    con_table = np.array([
        [0, 0, 0, 0, 0],
        [1, 1, 0, 0, 0],
        [0, 0, 0, 1, 1],
        [0, 1, 0, 1, 0],  # < the bad boy
        [0, 1, 1, 1, 0],
        [1, 1, 1, 1, 1]]).T
    assert not Hub.can_be_connected_with_single_buffer(con_table)
Esempio n. 3
0
def test_col_can_be_connected_with_single_buffer(col, expected):
    assert Hub.can_be_connected_with_single_buffer(
        np.array(col).reshape(-1, 1)) == expected
Esempio n. 4
0
def test_col_can_be_connected_with_single_buffer(col, expected):
    assert Hub.can_be_connected_with_single_buffer(np.array(col)
                                                   .reshape(-1, 1)) == expected