diff options
author | Masood Malekghassemi <atash@google.com> | 2017-01-23 14:25:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-23 14:25:37 -0500 |
commit | f621a0fabe90b97222f1b00e2e6cfd69bdeb4a03 (patch) | |
tree | 9cc6ca0ad2872237749822313c3881fb2fdecd7b /src/python/grpcio_tests/tests/unit | |
parent | 3c630801400e0de2fc7c653260c640fadfedfade (diff) | |
parent | a66dad5db6339b81e0dd0891881855b916c8e216 (diff) |
Merge pull request #9422 from soltanmm-google/as-filthy-rich-as-our-cabinet-secretaries
Add __richcmp__ to cygrpc.Timespec
Diffstat (limited to 'src/python/grpcio_tests/tests/unit')
-rw-r--r-- | src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py index 7aec316b95..a4d5015aa4 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py +++ b/src/python/grpcio_tests/tests/unit/_cython/cygrpc_test.py @@ -95,8 +95,18 @@ class TypeSmokeTest(unittest.TestCase): def testTimespec(self): now = time.time() - timespec = cygrpc.Timespec(now) - self.assertAlmostEqual(now, float(timespec), places=8) + now_timespec_a = cygrpc.Timespec(now) + now_timespec_b = cygrpc.Timespec(now) + self.assertAlmostEqual(now, float(now_timespec_a), places=8) + self.assertEqual(now_timespec_a, now_timespec_b) + self.assertLess(cygrpc.Timespec(now - 1), cygrpc.Timespec(now)) + self.assertGreater(cygrpc.Timespec(now + 1), cygrpc.Timespec(now)) + self.assertGreaterEqual(cygrpc.Timespec(now + 1), cygrpc.Timespec(now)) + self.assertGreaterEqual(cygrpc.Timespec(now), cygrpc.Timespec(now)) + self.assertLessEqual(cygrpc.Timespec(now - 1), cygrpc.Timespec(now)) + self.assertLessEqual(cygrpc.Timespec(now), cygrpc.Timespec(now)) + self.assertNotEqual(cygrpc.Timespec(now - 1), cygrpc.Timespec(now)) + self.assertNotEqual(cygrpc.Timespec(now + 1), cygrpc.Timespec(now)) def testCompletionQueueUpDown(self): completion_queue = cygrpc.CompletionQueue() |