Example #1
0
def test_one_len_lists():
    assert _product([1], [2]) == [(1, 2)]
Example #2
0
def test_mixed_types():
    a = ['a', 'b']
    b = [(1, 2, 3)]
    assert _product(a, b) == [('a', (1, 2, 3)), ('b', (1, 2, 3))]
Example #3
0
def test_single_with_list():
    assert _product(1, [2, 3]) == [(1, 2), (1, 3)]
Example #4
0
def test_list_with_single():
    assert _product([1, 2], 3) == [(1, 3), (2, 3)]
Example #5
0
def test_simple_product_np_array():
    a = np.array([1, 2])
    b = np.array([3, 4])
    assert _product(a, b) == [(1, 3), (1, 4), (2, 3), (2, 4)]
Example #6
0
def test_simple_product_tuples():
    assert _product((1, 2), (3, 4)) == [(1, 3), (1, 4), (2, 3), (2, 4)]
Example #7
0
def test_simple_product_lists_order_matters():
    assert _product([3, 4], [1, 2]) == [(3, 1), (3, 2), (4, 1), (4, 2)]
Example #8
0
def test_simple_product_lists():
    assert _product([1, 2], [3, 4]) == [(1, 3), (1, 4), (2, 3), (2, 4)]
Example #9
0
def test_empty():
    assert _product([], []) == []