diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-12-16 20:11:35 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-12-16 20:11:35 (GMT) |
commit | 8e47b8767b3a5b37fdc76ddcd11d0f2bf1d99933 (patch) | |
tree | 9ad819faf4707448de2f903acd27928a66b82bab /Lib | |
parent | d2fc88bbde59c88cf7fd3ea0d5cb09f3fa92dcbb (diff) | |
parent | 9a4ff437d156b3cc9c942473141eafcee79f9d75 (diff) | |
download | cpython-8e47b8767b3a5b37fdc76ddcd11d0f2bf1d99933.zip cpython-8e47b8767b3a5b37fdc76ddcd11d0f2bf1d99933.tar.gz cpython-8e47b8767b3a5b37fdc76ddcd11d0f2bf1d99933.tar.bz2 |
Merge 3.3.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_decimal.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 0dddc4b..e138709 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -2718,6 +2718,27 @@ class PyPythonAPItests(PythonAPItests): class ContextAPItests(unittest.TestCase): + def test_none_args(self): + Context = self.decimal.Context + InvalidOperation = self.decimal.InvalidOperation + DivisionByZero = self.decimal.DivisionByZero + Overflow = self.decimal.Overflow + ROUND_HALF_EVEN = self.decimal.ROUND_HALF_EVEN + + c1 = Context() + c2 = Context(prec=None, rounding=None, Emax=None, Emin=None, + capitals=None, clamp=None, flags=None, traps=None) + for c in [c1, c2]: + self.assertEqual(c.prec, 28) + self.assertEqual(c.rounding, ROUND_HALF_EVEN) + self.assertEqual(c.Emax, 999999) + self.assertEqual(c.Emin, -999999) + self.assertEqual(c.capitals, 1) + self.assertEqual(c.clamp, 0) + assert_signals(self, c, 'flags', []) + assert_signals(self, c, 'traps', [InvalidOperation, DivisionByZero, + Overflow]) + def test_pickle(self): Context = self.decimal.Context |