MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_compare_total_mag

Method test_compare_total_mag

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

Source from the content-addressed store, hash-verified

3144 self.assertRaises(TypeError, c.compare_total, 1, '1')
3145
3146 def test_compare_total_mag(self):
3147 Decimal = self.decimal.Decimal
3148 Context = self.decimal.Context
3149
3150 c = Context()
3151 d = c.compare_total_mag(Decimal(1), Decimal(1))
3152 self.assertEqual(c.compare_total_mag(1, 1), d)
3153 self.assertEqual(c.compare_total_mag(Decimal(1), 1), d)
3154 self.assertEqual(c.compare_total_mag(1, Decimal(1)), d)
3155 self.assertRaises(TypeError, c.compare_total_mag, '1', 1)
3156 self.assertRaises(TypeError, c.compare_total_mag, 1, '1')
3157
3158 def test_copy_abs(self):
3159 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