Show More
@@ -182,10 +182,24 class PasteTestCase(TestCase): | |||||
182 | def test_paste_leading_commas(self): |
|
182 | def test_paste_leading_commas(self): | |
183 | "Test multiline strings with leading commas" |
|
183 | "Test multiline strings with leading commas" | |
184 | tm = ip.magics_manager.registry['TerminalMagics'] |
|
184 | tm = ip.magics_manager.registry['TerminalMagics'] | |
185 | s = '''\ |
|
185 | s = '''\ | |
186 | a = """ |
|
186 | a = """ | |
187 | ,1,2,3 |
|
187 | ,1,2,3 | |
188 | """''' |
|
188 | """''' | |
189 | ip.user_ns.pop('foo', None) |
|
189 | ip.user_ns.pop('foo', None) | |
190 | tm.store_or_execute(s, 'foo') |
|
190 | tm.store_or_execute(s, 'foo') | |
191 | nt.assert_in('foo', ip.user_ns) |
|
191 | nt.assert_in('foo', ip.user_ns) | |
|
192 | ||||
|
193 | ||||
|
194 | def test_paste_trailing_question(self): | |||
|
195 | "Test pasting sources with trailing question marks" | |||
|
196 | tm = ip.magics_manager.registry['TerminalMagics'] | |||
|
197 | s = '''\ | |||
|
198 | def funcfoo(): | |||
|
199 | if True: #am i true? | |||
|
200 | return 'fooresult' | |||
|
201 | ''' | |||
|
202 | ip.user_ns.pop('funcfoo', None) | |||
|
203 | tm.store_or_execute(s, 'foosrc') | |||
|
204 | nt.assert_in('foosrc', ip.user_ns) | |||
|
205 | nt.assert_equals(ip.user_ns['funcfoo'](), 'fooresult') |
General Comments 0
You need to be logged in to leave comments.
Login now