Show More
@@ -237,6 +237,8 b' class TestClient(ClusterTestCase):' | |||||
237 | v = self.client.load_balanced_view() |
|
237 | v = self.client.load_balanced_view() | |
238 | ar = v.apply_async(f) |
|
238 | ar = v.apply_async(f) | |
239 | r1 = ar.get(1) |
|
239 | r1 = ar.get(1) | |
|
240 | # give the Hub a chance to notice: | |||
|
241 | time.sleep(0.5) | |||
240 | ahr = self.client.resubmit(ar.msg_ids) |
|
242 | ahr = self.client.resubmit(ar.msg_ids) | |
241 | r2 = ahr.get(1) |
|
243 | r2 = ahr.get(1) | |
242 | self.assertFalse(r1 == r2) |
|
244 | self.assertFalse(r1 == r2) |
@@ -59,6 +59,7 b' class TestLoadBalancedView(ClusterTestCase):' | |||||
59 | def test_abort(self): |
|
59 | def test_abort(self): | |
60 | view = self.view |
|
60 | view = self.view | |
61 | ar = self.client[:].apply_async(time.sleep, .5) |
|
61 | ar = self.client[:].apply_async(time.sleep, .5) | |
|
62 | ar = self.client[:].apply_async(time.sleep, .5) | |||
62 | ar2 = view.apply_async(lambda : 2) |
|
63 | ar2 = view.apply_async(lambda : 2) | |
63 | ar3 = view.apply_async(lambda : 3) |
|
64 | ar3 = view.apply_async(lambda : 3) | |
64 | view.abort(ar2) |
|
65 | view.abort(ar2) |
@@ -319,7 +319,7 b' class TestView(ClusterTestCase):' | |||||
319 | ip.magic_px('print a') |
|
319 | ip.magic_px('print a') | |
320 | sys.stdout = savestdout |
|
320 | sys.stdout = savestdout | |
321 | buf = sio.getvalue() |
|
321 | buf = sio.getvalue() | |
322 |
self.assertTrue('[stdout: |
|
322 | self.assertTrue('[stdout:' in buf, buf) | |
323 | self.assertTrue(buf.rstrip().endswith('10')) |
|
323 | self.assertTrue(buf.rstrip().endswith('10')) | |
324 | self.assertRaisesRemote(ZeroDivisionError, ip.magic_px, '1/0') |
|
324 | self.assertRaisesRemote(ZeroDivisionError, ip.magic_px, '1/0') | |
325 |
|
325 |
@@ -213,7 +213,18 b' def ipexec(fname, options=None):' | |||||
213 | full_fname = os.path.join(test_dir, fname) |
|
213 | full_fname = os.path.join(test_dir, fname) | |
214 | full_cmd = '%s %s %s' % (ipython_cmd, cmdargs, full_fname) |
|
214 | full_cmd = '%s %s %s' % (ipython_cmd, cmdargs, full_fname) | |
215 | #print >> sys.stderr, 'FULL CMD:', full_cmd # dbg |
|
215 | #print >> sys.stderr, 'FULL CMD:', full_cmd # dbg | |
216 |
|
|
216 | out = getoutputerror(full_cmd) | |
|
217 | # `import readline` causes 'ESC[?1034h' to be the first output sometimes, | |||
|
218 | # so strip that off the front of the first line if it is found | |||
|
219 | if out: | |||
|
220 | first = out[0] | |||
|
221 | m = re.match(r'\x1b\[[^h]+h', first) | |||
|
222 | if m: | |||
|
223 | # strip initial readline escape | |||
|
224 | out = list(out) | |||
|
225 | out[0] = first[len(m.group()):] | |||
|
226 | out = tuple(out) | |||
|
227 | return out | |||
217 |
|
228 | |||
218 |
|
229 | |||
219 | def ipexec_validate(fname, expected_out, expected_err='', |
|
230 | def ipexec_validate(fname, expected_out, expected_err='', |
General Comments 0
You need to be logged in to leave comments.
Login now