def test_dot_product_of_not_same_length_vectors_raises_exception(self): vect_1 = Vector([1] * 5) vect_2 = Vector([1] * 1) self.assertRaises(DimensionMismatch, lambda: vect_1.dot(vect_2))
def test_dot_product(self): vect_1 = Vector([2] * 5) vect_2 = Vector([1] * 5) self.assertEqual(10, vect_1.dot(vect_2))