##// END OF EJS Templates
test AsyncResult.get_dict with single results and invalid input
MinRK -
Show More
@@ -35,6 +35,9 b' def wait(n):'
35 35 time.sleep(n)
36 36 return n
37 37
38 def echo(x):
39 return x
40
38 41 class AsyncResultTest(ClusterTestCase):
39 42
40 43 def test_single_result_view(self):
@@ -77,6 +80,20 b' class AsyncResultTest(ClusterTestCase):'
77 80 for eid,r in d.iteritems():
78 81 self.assertEqual(r, 5)
79 82
83 def test_get_dict_single(self):
84 view = self.client[-1]
85 for v in (range(5), 5, ('abc', 'def'), 'string'):
86 ar = view.apply_async(echo, v)
87 self.assertEqual(ar.get(), v)
88 d = ar.get_dict()
89 self.assertEqual(d, {view.targets : v})
90
91 def test_get_dict_bad(self):
92 ar = self.client[:].apply_async(lambda : 5)
93 ar2 = self.client[:].apply_async(lambda : 5)
94 ar = self.client.get_result(ar.msg_ids + ar2.msg_ids)
95 self.assertRaises(ValueError, ar.get_dict)
96
80 97 def test_list_amr(self):
81 98 ar = self.client.load_balanced_view().map_async(wait, [0.1]*5)
82 99 rlist = list(ar)
General Comments 0
You need to be logged in to leave comments. Login now