diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-09-28 17:55:54 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:18:18 -0300 |
commit | b9ab302dd7aff3ecbbbc7ffe1ef2ef0bf4956a5a (patch) | |
tree | b2c62e3ae790b7c5a70f7308282ec2975aa168a2 /tests/samplebinding/time_test.py | |
parent | 6b21c2fa5eeb6a7c7b6533f1c966a47d8ef07e69 (diff) |
Fixed tests to work with python3.x and python2.x
Diffstat (limited to 'tests/samplebinding/time_test.py')
-rw-r--r-- | tests/samplebinding/time_test.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/samplebinding/time_test.py b/tests/samplebinding/time_test.py index 5c0270d7a..d1ffc268e 100644 --- a/tests/samplebinding/time_test.py +++ b/tests/samplebinding/time_test.py @@ -30,7 +30,7 @@ import sys import unittest import datetime -from sample import Time, ImplicitConv, ObjectType, Str +from sample import Time, ImplicitConv, ObjectType class TimeTest(unittest.TestCase): '''Test cases for constructor and method signature decisor on Time class. @@ -43,7 +43,7 @@ class TimeTest(unittest.TestCase): def testConstructorWithoutParamers(self): '''Constructor without parameters: Time()''' time = Time() - self.assert_(time.isNull()) + self.assertTrue(time.isNull()) def testConstructorWithAllParamers(self): '''Constructor with all parameters: Time(int h, int m, int s = 0, int ms = 0)''' @@ -64,7 +64,7 @@ class TimeTest(unittest.TestCase): '''Constructor without parameters: Time.setTime()''' time = Time(1, 2, 3, 4) time.setTime() - self.assert_(time.isNull()) + self.assertTrue(time.isNull()) def testSimpleMethodWithAllParamers(self): '''Simple method with all parameters: Time.setTime(int h, int m, int s = 0, int ms = 0)''' @@ -120,13 +120,13 @@ class TimeTest(unittest.TestCase): self.assertEqual(result, Time.ThreeArgs) def testCompareWithPythonTime(self): - time = Time(12, 32, 05) - py = datetime.time(12, 32, 05) + time = Time(12, 32, 5) + py = datetime.time(12, 32, 5) self.assertEqual(time, py) def testNotEqual(self): - time = Time(12, 32, 06) - py = datetime.time(12, 32, 05) + time = Time(12, 32, 6) + py = datetime.time(12, 32, 5) self.assertNotEqual(time, py) if __name__ == '__main__': |