(arg_s, exp_filename=None,
exp_lineno=-1,
exp_contents=None,
exp_is_temp=None)
| 1117 | |
| 1118 | |
| 1119 | def _run_edit_test(arg_s, exp_filename=None, |
| 1120 | exp_lineno=-1, |
| 1121 | exp_contents=None, |
| 1122 | exp_is_temp=None): |
| 1123 | ip = get_ipython() |
| 1124 | M = code.CodeMagics(ip) |
| 1125 | last_call = ['',''] |
| 1126 | opts,args = M.parse_options(arg_s,'prxn:') |
| 1127 | filename, lineno, is_temp = M._find_edit_target(ip, args, opts, last_call) |
| 1128 | |
| 1129 | if exp_filename is not None: |
| 1130 | nt.assert_equal(exp_filename, filename) |
| 1131 | if exp_contents is not None: |
| 1132 | with io.open(filename, 'r', encoding='utf-8') as f: |
| 1133 | contents = f.read() |
| 1134 | nt.assert_equal(exp_contents, contents) |
| 1135 | if exp_lineno != -1: |
| 1136 | nt.assert_equal(exp_lineno, lineno) |
| 1137 | if exp_is_temp is not None: |
| 1138 | nt.assert_equal(exp_is_temp, is_temp) |
| 1139 | |
| 1140 | |
| 1141 | def test_edit_interactive(): |
no test coverage detected