MCPcopy
hub / github.com/keon/algorithms / test_monomial_division

Method test_monomial_division

tests/test_monomial.py:143–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

141 return
142
143 def test_monomial_division(self):
144 # Any monomial divided by the Zero Monomial should raise a ValueError.
145 self.assertRaises(ValueError, lambda x, y: x.__truediv__(y), self.m2, self.m1)
146 self.assertRaises(ValueError, lambda x, y: x.__truediv__(y), self.m2, self.m8)
147 self.assertRaises(ValueError, lambda x, y: x.__truediv__(y), self.m2, self.m12)
148
149 # Test some usual cases.
150 self.assertEqual(self.m7 / self.m3, Monomial({2: 1, 7: 2}, -2 * math.pi / 3))
151 self.assertEqual(self.m14 / self.m13, Monomial({1: 1}) * Fraction(-3, 2))
152
153 return
154
155 def test_monomial_substitution(self):
156 # Test with int.

Callers

nothing calls this directly

Calls 2

MonomialClass · 0.90
__truediv__Method · 0.45

Tested by

no test coverage detected