Show More
@@ -446,6 +446,22 b' class IPythonInputTestCase(InputSplitterTestCase):' | |||||
446 | out = isp.transform_cell(raw) |
|
446 | out = isp.transform_cell(raw) | |
447 | # Match ignoring trailing whitespace |
|
447 | # Match ignoring trailing whitespace | |
448 | self.assertEqual(out.rstrip(), out_t.rstrip()) |
|
448 | self.assertEqual(out.rstrip(), out_t.rstrip()) | |
|
449 | ||||
|
450 | def test_cellmagic_preempt(self): | |||
|
451 | isp = self.isp | |||
|
452 | for raw, name, line, cell in [ | |||
|
453 | ("%%cellm a\nIn[1]:", u'cellm', u'a', u'In[1]:'), | |||
|
454 | ("%%cellm \n...:", u'cellm', u'', u'...:'), | |||
|
455 | ("%%cellm \nline1\nline2", u'cellm', u'', u'line1\nline2'), | |||
|
456 | ("%%cellm \nline1\\\\\nline2", u'cellm', u'', u'line1\\\\\nline2'), | |||
|
457 | ]: | |||
|
458 | expected = "get_ipython().run_cell_magic(%r, %r, %r)" % ( | |||
|
459 | name, line, cell | |||
|
460 | ) | |||
|
461 | out = isp.transform_cell(raw) | |||
|
462 | self.assertEqual(out.rstrip(), expected.rstrip()) | |||
|
463 | ||||
|
464 | ||||
449 |
|
465 | |||
450 | #----------------------------------------------------------------------------- |
|
466 | #----------------------------------------------------------------------------- | |
451 | # Main - use as a script, mostly for developer experiments |
|
467 | # Main - use as a script, mostly for developer experiments |
General Comments 0
You need to be logged in to leave comments.
Login now