MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / test_mul

Method test_mul

linear_algebra_python/src/tests.py:63–71  ·  view source on GitHub ↗

test for * operator

(self)

Source from the content-addressed store, hash-verified

61 self.assertEqual((x-y).component(1),1)
62 self.assertEqual((x-y).component(2),2)
63 def test_mul(self):
64 """
65 test for * operator
66 """
67 x = Vector([1,2,3])
68 a = Vector([2,-1,4]) # for test of dot-product
69 b = Vector([1,-2,-1])
70 self.assertEqual(str(x*3.0),"(3.0,6.0,9.0)")
71 self.assertEqual((a*b),0)
72 def test_zeroVector(self):
73 """
74 test for the global function zeroVector(...)

Callers

nothing calls this directly

Calls 1

VectorClass · 0.85

Tested by

no test coverage detected