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

Method test_number_class

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

Source from the content-addressed store, hash-verified

3527 self.assertRaises(TypeError, c.normalize, '10')
3528
3529 def test_number_class(self):
3530 Decimal = self.decimal.Decimal
3531 Context = self.decimal.Context
3532
3533 c = Context()
3534 self.assertEqual(c.number_class(123), c.number_class(Decimal(123)))
3535 self.assertEqual(c.number_class(0), c.number_class(Decimal(0)))
3536 self.assertEqual(c.number_class(-45), c.number_class(Decimal(-45)))
3537
3538 def test_plus(self):
3539 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 4

number_classMethod · 0.95
DecimalClass · 0.85
ContextClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected