Ejemplo n.º 1
0
 def testUsersPrimitiveFromRequiredModuleAsReturnValue(self):
     '''Complex Number::toComplex()'''
     number = Number(12)
     cpx = number.toComplex()
     self.assertEqual(number.value(), int(cpx.real))
 def testUsersPrimitiveFromRequiredModuleAsReturnValue(self):
     """Complex Number::toComplex()"""
     number = Number(12)
     cpx = number.toComplex()
     self.assertEqual(number.value(), int(cpx.real))
Ejemplo n.º 3
0
 def testUsersPrimitiveFromRequiredModuleAsArgument(self):
     '''static Number Number::fromComplex(Complex)'''
     cpx = complex(3.0, 1.2)
     number = Number.fromComplex(cpx)
     self.assertEqual(number.value(), int(cpx.real))
 def __init__(self):
     Derived.__init__(self, 42)
     Number.__init__(self, 42)
 def testUsersPrimitiveFromRequiredModuleAsArgument(self):
     """static Number Number::fromComplex(Complex)"""
     cpx = complex(3.0, 1.2)
     number = Number.fromComplex(cpx)
     self.assertEqual(number.value(), int(cpx.real))
Ejemplo n.º 6
0
 def testStrCtorWithNumberArgument(self):
     '''Try to build a Str from 'sample' module with a Number argument from 'other' module.'''
     value = 123
     num = Number(value)
     string = Str(num)
Ejemplo n.º 7
0
 def testNumber(self):
     '''Basic test to see if the Number class is Ok.'''
     value = 123
     num = Number(value)
     self.assertEqual(num.value(), value)
Ejemplo n.º 8
0
 def testPointTimesNumber(self):
     '''sample.Point * other.Number'''
     pt = Point(2, 7)
     num = Number(11)
     self.assertEqual(pt * num, pt * 11)
Ejemplo n.º 9
0
 def testNumber(self):
     '''Basic test to see if the Number class is Ok.'''
     value = 123
     num = Number(value)
     self.assertEqual(num.value(), value)
Ejemplo n.º 10
0
 def __init__(self):
     Derived.__init__(self, 42)
     Number.__init__(self, 42)