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

Method test_canonical

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

Source from the content-addressed store, hash-verified

4508 self.assertEqual(Decimal('inf').adjusted(), 0)
4509
4510 def test_canonical(self):
4511 Decimal = self.decimal.Decimal
4512 getcontext = self.decimal.getcontext
4513
4514 x = Decimal(9).canonical()
4515 self.assertEqual(x, 9)
4516
4517 c = getcontext()
4518 x = c.canonical(Decimal(9))
4519 self.assertEqual(x, 9)
4520
4521 def test_context_repr(self):
4522 c = self.decimal.DefaultContext.copy()

Callers

nothing calls this directly

Calls 4

DecimalClass · 0.85
getcontextFunction · 0.85
canonicalMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected