Example #1
0
 def testValue(self):
     "Test that pyk object got the value with which it was created"
     i=_Ki(self.i)
     f=_Kf(self.f)
     c=_Kc(self.c)
     s=_Ks(self.s)
     self.failIf(i != 5, 'assigned a value 5 but came out as %s' % i)
     self.failIf(f != 5.0, 'assigned a value 5.0 but came out as %s' % f)
     self.failIf(c != 'c', 'assigned a value \'c\' but came out as %s' % c)
     self.failIf(s != "abc", 'assigned a value "abc" but came out as %s' % s)
Example #2
0
 def testValue(self):
     "Test that pyk object got the value with which it was created"
     i = _Ki(self.i)
     f = _Kf(self.f)
     c = _Kc(self.c)
     s = _Ks(self.s)
     self.failIf(i != 5, 'assigned a value 5 but came out as %s' % i)
     self.failIf(f != 5.0, 'assigned a value 5.0 but came out as %s' % f)
     self.failIf(c != 'c', 'assigned a value \'c\' but came out as %s' % c)
     self.failIf(s != "abc",
                 'assigned a value "abc" but came out as %s' % s)
Example #3
0
 def testReassign(self):
     "Test that we can change the value of a pyk object"
     ki = _sKi(self.i, 10)
     i = _Ki(ki)
     kf = _sKf(self.f, 10.0)
     f = _Kf(kf)
     kc = _sKc(self.c, 'd')
     c = _Kc(kc)
     ks = _sKs(self.s, 'xyz')
     s = _Ks(ks)
     self.failIf(i != 10, 'reassigned a value 10 but came out as %s' % i)
     self.failIf(f != 10.0, 'reassigned a value 10.0 but came out as %s' % f)
     self.failIf(c != 'd', 'reassigned a value \'d\' but came out as %s' % c)
     self.failIf(s != "xyz", 'reassigned a value "xyz" but came out as %s' % s)
Example #4
0
 def testReassign(self):
     "Test that we can change the value of a pyk object"
     ki = _sKi(self.i, 10)
     i = _Ki(ki)
     kf = _sKf(self.f, 10.0)
     f = _Kf(kf)
     kc = _sKc(self.c, 'd')
     c = _Kc(kc)
     ks = _sKs(self.s, 'xyz')
     s = _Ks(ks)
     self.failIf(i != 10, 'reassigned a value 10 but came out as %s' % i)
     self.failIf(f != 10.0,
                 'reassigned a value 10.0 but came out as %s' % f)
     self.failIf(c != 'd',
                 'reassigned a value \'d\' but came out as %s' % c)
     self.failIf(s != "xyz",
                 'reassigned a value "xyz" but came out as %s' % s)