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

Method test_add

linear_algebra_python/src/tests.py:45–53  ·  view source on GitHub ↗

test for + operator

(self)

Source from the content-addressed store, hash-verified

43 x = Vector([1,2])
44 self.assertAlmostEqual(x.eulidLength(),2.236,3)
45 def test_add(self):
46 """
47 test for + operator
48 """
49 x = Vector([1,2,3])
50 y = Vector([1,1,1])
51 self.assertEqual((x+y).component(0),2)
52 self.assertEqual((x+y).component(1),3)
53 self.assertEqual((x+y).component(2),4)
54 def test_sub(self):
55 """
56 test for - operator

Callers

nothing calls this directly

Calls 2

VectorClass · 0.85
componentMethod · 0.45

Tested by

no test coverage detected