From 1cc0c5e6d6088849cca2987af39f0d9a965c0d60 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 17 Oct 2008 19:30:35 +0000 Subject: [PATCH] THRIFT-109. python: Use self.assert* instead of assert in tests git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705734 13f79535-47bb-0310-9956-ffa450edef68 --- test/py/SerializationTest.py | 8 ++++---- test/py/TestSocket.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/py/SerializationTest.py b/test/py/SerializationTest.py index 56bccbf8..3b34661a 100755 --- a/test/py/SerializationTest.py +++ b/test/py/SerializationTest.py @@ -48,13 +48,13 @@ class AbstractTest(unittest.TestCase): def testForwards(self): obj = self._deserialize(VersioningTestV2, self._serialize(self.v1obj)) - assert obj.begin_in_both == self.v1obj.begin_in_both - assert obj.end_in_both == self.v1obj.end_in_both + self.assertEquals(obj.begin_in_both, self.v1obj.begin_in_both) + self.assertEquals(obj.end_in_both, self.v1obj.end_in_both) def testBackwards(self): obj = self._deserialize(VersioningTestV1, self._serialize(self.v2obj)) - assert obj.begin_in_both == self.v2obj.begin_in_both - assert obj.end_in_both == self.v2obj.end_in_both + self.assertEquals(obj.begin_in_both, self.v2obj.begin_in_both) + self.assertEquals(obj.end_in_both, self.v2obj.end_in_both) class NormalBinaryTest(AbstractTest): diff --git a/test/py/TestSocket.py b/test/py/TestSocket.py index b693d182..8ba055ce 100755 --- a/test/py/TestSocket.py +++ b/test/py/TestSocket.py @@ -40,7 +40,7 @@ class TimeoutTest(unittest.TestCase): socket.open() leaky.append(socket) except: - assert time.time() - starttime < 5.0 + self.assert_(time.time() - starttime < 5.0) def testWriteTimeout(self): starttime = time.time() @@ -54,7 +54,7 @@ class TimeoutTest(unittest.TestCase): socket.write("hi" * 100) except: - assert time.time() - starttime < 5.0 + self.assert_(time.time() - starttime < 5.0) suite = unittest.TestSuite() loader = unittest.TestLoader() -- 2.17.1