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

Method test_power

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

Source from the content-addressed store, hash-verified

3545 self.assertRaises(TypeError, c.plus, '10')
3546
3547 def test_power(self):
3548 Decimal = self.decimal.Decimal
3549 Context = self.decimal.Context
3550
3551 c = Context()
3552 d = c.power(Decimal(1), Decimal(4))
3553 self.assertEqual(c.power(1, 4), d)
3554 self.assertEqual(c.power(Decimal(1), 4), d)
3555 self.assertEqual(c.power(1, Decimal(4)), d)
3556 self.assertEqual(c.power(Decimal(1), Decimal(4)), d)
3557 self.assertRaises(TypeError, c.power, '1', 4)
3558 self.assertRaises(TypeError, c.power, 1, '4')
3559 self.assertEqual(c.power(modulo=5, b=8, a=2), 1)
3560
3561 def test_quantize(self):
3562 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected