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

Method test_add

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

Source from the content-addressed store, hash-verified

3096 self.assertRaises(TypeError, c.abs, '-1')
3097
3098 def test_add(self):
3099 Decimal = self.decimal.Decimal
3100 Context = self.decimal.Context
3101
3102 c = Context()
3103 d = c.add(Decimal(1), Decimal(1))
3104 self.assertEqual(c.add(1, 1), d)
3105 self.assertEqual(c.add(Decimal(1), 1), d)
3106 self.assertEqual(c.add(1, Decimal(1)), d)
3107 self.assertRaises(TypeError, c.add, '1', 1)
3108 self.assertRaises(TypeError, c.add, 1, '1')
3109
3110 def test_compare(self):
3111 Decimal = self.decimal.Decimal

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected