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

Method test_add

linear_algebra/src/test_linear_algebra.py:61–69  ·  view source on GitHub ↗

test for + operator

(self)

Source from the content-addressed store, hash-verified

59 assert w.euclidean_length() == pytest.approx(7.616, abs=1e-3)
60
61 def test_add(self) -> None:
62 """
63 test for + operator
64 """
65 x = Vector([1, 2, 3])
66 y = Vector([1, 1, 1])
67 assert (x + y).component(0) == 2
68 assert (x + y).component(1) == 3
69 assert (x + y).component(2) == 4
70
71 def test_sub(self) -> None:
72 """

Callers

nothing calls this directly

Calls 2

VectorClass · 0.85
componentMethod · 0.45

Tested by

no test coverage detected