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)
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)
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
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