def test_4dim_dot(): """test the dot product of two 4 dimensional vectors""" # 4 dim dot-product. x = [1, 2, 3, 4] y = [5, 6, 7, 8] z = tnp.dot(x, y) assert z == 70
def test_dot(): """test the dot product of two mixed dimensional vectors""" # Vector dot-product. x = [1, 2, 3] y = [4, 5, 6] z = tnp.dot(x, y) assert z == 32
def test_2dim_dot(): """test the dot product of two 2 dimensional vectors""" # 2 dim dot-product. x = [1, 2] y = [4, 5] z = tnp.dot(x, y) assert z == 14
def test_mdim_dot(): """test the dot product of two mixed dimensional vectors""" # Mixed dim dot-product. x = [1, 2, 3] y = [4, 5, 6, 7] with pytest.raises(IndexError) as execinfo: z = tnp.dot(x, y) assert 'Vector has invalid dimensions' in str(execinfo.value)
def test_4dim_dot(): """test the dot product of two 4 dimentional vectors""" # 4 dim dot-product. x = [1, 2, 3, 4] y = [5, 6, 7, 8] with pytest.raises(IndexError) as execinfo: z = tnp.dot(x, y) assert 'Vector has invalid dimensions' in str(execinfo.value)