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

Method test_component

linear_algebra_python/src/tests.py:15–26  ·  view source on GitHub ↗

test for method component

(self)

Source from the content-addressed store, hash-verified

13
14class Test(unittest.TestCase):
15 def test_component(self):
16 """
17 test for method component
18 """
19 x = Vector([1,2,3])
20 self.assertEqual(x.component(0),1)
21 self.assertEqual(x.component(2),3)
22 try:
23 y = Vector()
24 self.assertTrue(False)
25 except:
26 self.assertTrue(True)
27 def test_str(self):
28 """
29 test for toString() method

Callers

nothing calls this directly

Calls 2

componentMethod · 0.95
VectorClass · 0.85

Tested by

no test coverage detected