MCPcopy Create free account
hub / github.com/python/cpython / test_compare_total_mag

Method test_compare_total_mag

Lib/test/test_decimal.py:3141–3151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3139 self.assertRaises(TypeError, c.compare_total, 1, '1')
3140
3141 def test_compare_total_mag(self):
3142 Decimal = self.decimal.Decimal
3143 Context = self.decimal.Context
3144
3145 c = Context()
3146 d = c.compare_total_mag(Decimal(1), Decimal(1))
3147 self.assertEqual(c.compare_total_mag(1, 1), d)
3148 self.assertEqual(c.compare_total_mag(Decimal(1), 1), d)
3149 self.assertEqual(c.compare_total_mag(1, Decimal(1)), d)
3150 self.assertRaises(TypeError, c.compare_total_mag, '1', 1)
3151 self.assertRaises(TypeError, c.compare_total_mag, 1, '1')
3152
3153 def test_copy_abs(self):
3154 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

compare_total_magMethod · 0.95
DecimalClass · 0.85
ContextClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected