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
diff --git a/test/py/SerializationTest.py b/test/py/SerializationTest.py
index 56bccbf..3b34661 100755
--- a/test/py/SerializationTest.py
+++ b/test/py/SerializationTest.py
@@ -48,13 +48,13 @@
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 b693d18..8ba055c 100755
--- a/test/py/TestSocket.py
+++ b/test/py/TestSocket.py
@@ -40,7 +40,7 @@
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 @@
socket.write("hi" * 100)
except:
- assert time.time() - starttime < 5.0
+ self.assert_(time.time() - starttime < 5.0)
suite = unittest.TestSuite()
loader = unittest.TestLoader()