MCPcopy Index your code
hub / github.com/geekcomputers/Python / test_mul

Method test_mul

linear-algebra-python/src/tests.py:72–80  ·  view source on GitHub ↗

test for * operator

(self)

Source from the content-addressed store, hash-verified

70 self.assertEqual((x - y).component(2), 2)
71
72 def test_mul(self):
73 """
74 test for * operator
75 """
76 x = Vector([1, 2, 3])
77 a = Vector([2, -1, 4]) # for test of dot-product
78 b = Vector([1, -2, -1])
79 self.assertEqual((x * 3.0).__str__(), "(3.0,6.0,9.0)")
80 self.assertEqual((a * b), 0)
81
82 def test_zeroVector(self):
83 """

Callers

nothing calls this directly

Calls 2

VectorClass · 0.85
__str__Method · 0.45

Tested by

no test coverage detected