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

Method test_quantize

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

Source from the content-addressed store, hash-verified

3559 self.assertEqual(c.power(modulo=5, b=8, a=2), 1)
3560
3561 def test_quantize(self):
3562 Decimal = self.decimal.Decimal
3563 Context = self.decimal.Context
3564
3565 c = Context()
3566 d = c.quantize(Decimal(1), Decimal(2))
3567 self.assertEqual(c.quantize(1, 2), d)
3568 self.assertEqual(c.quantize(Decimal(1), 2), d)
3569 self.assertEqual(c.quantize(1, Decimal(2)), d)
3570 self.assertRaises(TypeError, c.quantize, '1', 2)
3571 self.assertRaises(TypeError, c.quantize, 1, '2')
3572
3573 def test_remainder(self):
3574 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected