MCPcopy Index your code
hub / github.com/python/cpython / test_sub

Method test_sub

Lib/test/test_binop.py:258–263  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

256 self.assertEqual(Rat(1, 2) + 1.0, 1.5)
257
258 def test_sub(self):
259 self.assertEqual(Rat(7, 2) - Rat(7, 5), Rat(21, 10))
260 self.assertEqual(Rat(7, 5) - 1, Rat(2, 5))
261 self.assertEqual(1 - Rat(3, 5), Rat(2, 5))
262 self.assertEqual(Rat(3, 2) - 1.0, 0.5)
263 self.assertEqual(1.0 - Rat(1, 2), 0.5)
264
265 def test_mul(self):
266 self.assertEqual(Rat(2, 3) * Rat(5, 7), Rat(10, 21))

Callers

nothing calls this directly

Calls 2

RatClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected