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

Method test_add

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

test for + operator

(self)

Source from the content-addressed store, hash-verified

50 self.assertAlmostEqual(x.eulidLength(), 2.236, 3)
51
52 def test_add(self):
53 """
54 test for + operator
55 """
56 x = Vector([1, 2, 3])
57 y = Vector([1, 1, 1])
58 self.assertEqual((x + y).component(0), 2)
59 self.assertEqual((x + y).component(1), 3)
60 self.assertEqual((x + y).component(2), 4)
61
62 def test_sub(self):
63 """

Callers

nothing calls this directly

Calls 2

VectorClass · 0.85
componentMethod · 0.45

Tested by

no test coverage detected