Show More
@@ -81,13 +81,13 b' class AsyncResultTest(ClusterTestCase):' | |||||
81 |
|
81 | |||
82 | def test_getattr(self): |
|
82 | def test_getattr(self): | |
83 | ar = self.client[:].apply_async(wait, 0.5) |
|
83 | ar = self.client[:].apply_async(wait, 0.5) | |
|
84 | self.assertEqual(ar.engine_id, [None] * len(ar)) | |||
84 | self.assertRaises(AttributeError, lambda : ar._foo) |
|
85 | self.assertRaises(AttributeError, lambda : ar._foo) | |
85 | self.assertRaises(AttributeError, lambda : ar.__length_hint__()) |
|
86 | self.assertRaises(AttributeError, lambda : ar.__length_hint__()) | |
86 | self.assertRaises(AttributeError, lambda : ar.foo) |
|
87 | self.assertRaises(AttributeError, lambda : ar.foo) | |
87 | self.assertRaises(AttributeError, lambda : ar.engine_id) |
|
|||
88 | self.assertFalse(hasattr(ar, '__length_hint__')) |
|
88 | self.assertFalse(hasattr(ar, '__length_hint__')) | |
89 | self.assertFalse(hasattr(ar, 'foo')) |
|
89 | self.assertFalse(hasattr(ar, 'foo')) | |
90 |
self.assert |
|
90 | self.assertTrue(hasattr(ar, 'engine_id')) | |
91 | ar.get(5) |
|
91 | ar.get(5) | |
92 | self.assertRaises(AttributeError, lambda : ar._foo) |
|
92 | self.assertRaises(AttributeError, lambda : ar._foo) | |
93 | self.assertRaises(AttributeError, lambda : ar.__length_hint__()) |
|
93 | self.assertRaises(AttributeError, lambda : ar.__length_hint__()) | |
@@ -100,8 +100,8 b' class AsyncResultTest(ClusterTestCase):' | |||||
100 |
|
100 | |||
101 | def test_getitem(self): |
|
101 | def test_getitem(self): | |
102 | ar = self.client[:].apply_async(wait, 0.5) |
|
102 | ar = self.client[:].apply_async(wait, 0.5) | |
103 | self.assertRaises(TimeoutError, lambda : ar['foo']) |
|
103 | self.assertEqual(ar['engine_id'], [None] * len(ar)) | |
104 |
self.assertRaises( |
|
104 | self.assertRaises(KeyError, lambda : ar['foo']) | |
105 | ar.get(5) |
|
105 | ar.get(5) | |
106 | self.assertRaises(KeyError, lambda : ar['foo']) |
|
106 | self.assertRaises(KeyError, lambda : ar['foo']) | |
107 | self.assertTrue(isinstance(ar['engine_id'], list)) |
|
107 | self.assertTrue(isinstance(ar['engine_id'], list)) | |
@@ -109,8 +109,8 b' class AsyncResultTest(ClusterTestCase):' | |||||
109 |
|
109 | |||
110 | def test_single_result(self): |
|
110 | def test_single_result(self): | |
111 | ar = self.client[-1].apply_async(wait, 0.5) |
|
111 | ar = self.client[-1].apply_async(wait, 0.5) | |
112 |
self.assertRaises( |
|
112 | self.assertRaises(KeyError, lambda : ar['foo']) | |
113 |
self.assert |
|
113 | self.assertEqual(ar['engine_id'], None) | |
114 | self.assertTrue(ar.get(5) == 0.5) |
|
114 | self.assertTrue(ar.get(5) == 0.5) | |
115 | self.assertTrue(isinstance(ar['engine_id'], int)) |
|
115 | self.assertTrue(isinstance(ar['engine_id'], int)) | |
116 | self.assertTrue(isinstance(ar.engine_id, int)) |
|
116 | self.assertTrue(isinstance(ar.engine_id, int)) |
General Comments 0
You need to be logged in to leave comments.
Login now