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

Method test_canonical

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

Source from the content-addressed store, hash-verified

4507 self.assertEqual(Decimal('inf').adjusted(), 0)
4508
4509 def test_canonical(self):
4510 Decimal = self.decimal.Decimal
4511 getcontext = self.decimal.getcontext
4512
4513 x = Decimal(9).canonical()
4514 self.assertEqual(x, 9)
4515
4516 c = getcontext()
4517 x = c.canonical(Decimal(9))
4518 self.assertEqual(x, 9)
4519
4520 def test_context_repr(self):
4521 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