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

Method test_component

linear_algebra/src/test_linear_algebra.py:25–32  ·  view source on GitHub ↗

test for method component()

(self)

Source from the content-addressed store, hash-verified

23
24class Test(unittest.TestCase):
25 def test_component(self) -> None:
26 """
27 test for method component()
28 """
29 x = Vector([1, 2, 3])
30 assert x.component(0) == 1
31 assert x.component(2) == 3
32 _ = Vector()
33
34 def test_str(self) -> None:
35 """

Callers

nothing calls this directly

Calls 2

componentMethod · 0.95
VectorClass · 0.85

Tested by

no test coverage detected