[Python-checkins] python/nondist/sandbox/decimal test_Decimal.py,
1.14, 1.15
facundobatista at users.sourceforge.net
facundobatista at users.sourceforge.net
Sun Apr 4 12:15:14 EDT 2004
Update of /cvsroot/python/python/nondist/sandbox/decimal
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27727
Modified Files:
test_Decimal.py
Log Message:
Extended explicit construction test case from tuples.
Index: test_Decimal.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/decimal/test_Decimal.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** test_Decimal.py 4 Apr 2004 05:01:02 -0000 1.14
--- test_Decimal.py 4 Apr 2004 16:15:12 -0000 1.15
***************
*** 15,18 ****
--- 15,19 ----
"""
+ # 0.1.6 2003.04.04 fb: Extended explicit construction test case from tuples.
# 0.1.5 2003.04.02 fb: Adjusted explicit construction test cases.
# 0.1.4 2003.03.28 fb: Added Use of Context and Decimal Usability test cases.
***************
*** 161,165 ****
L = Sides[0].strip().split()
id = L[0]
! #print id,
funct = L[1].lower()
valstemp = L[2:]
--- 162,166 ----
L = Sides[0].strip().split()
id = L[0]
! # print id,
funct = L[1].lower()
valstemp = L[2:]
***************
*** 257,261 ****
'Incorrect flags set in ' + s + ' -- got ' \
+ str(myexceptions))
!
def getexceptions(self):
--- 258,262 ----
'Incorrect flags set in ' + s + ' -- got ' \
+ str(myexceptions))
! return
def getexceptions(self):
***************
*** 579,582 ****
--- 580,596 ----
self.assertEqual(str(d), '-4.34913534E-17')
+ #wrong number of items
+ self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1)) )
+
+ #bad sign
+ self.assertRaises(ValueError, Decimal, (8, (4, 3, 4, 9, 1), 2) )
+
+ #bad exp
+ self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 9, 1), 'wrong!') )
+
+ #bad coefficients
+ self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, None, 1), 2) )
+ self.assertRaises(ValueError, Decimal, (1, (4, -3, 4, 9, 1), 2) )
+
def test_from_Decimal(self):
'''Explicit construction with Decimal.'''
More information about the Python-checkins
mailing list