MCPcopy Index your code
hub / github.com/python/cpython / test_input_reset_at_EOF

Method test_input_reset_at_EOF

Lib/test/test_cmd.py:235–253  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233
234
235 def test_input_reset_at_EOF(self):
236 input = io.StringIO("print test\nprint test2")
237 output = io.StringIO()
238 cmd = self.simplecmd2(stdin=input, stdout=output)
239 cmd.use_rawinput = False
240 cmd.cmdloop()
241 self.assertMultiLineEqual(output.getvalue(),
242 ("(Cmd) test\n"
243 "(Cmd) test2\n"
244 "(Cmd) *** Unknown syntax: EOF\n"))
245 input = io.StringIO("print \n\n")
246 output = io.StringIO()
247 cmd.stdin = input
248 cmd.stdout = output
249 cmd.cmdloop()
250 self.assertMultiLineEqual(output.getvalue(),
251 ("(Cmd) \n"
252 "(Cmd) \n"
253 "(Cmd) *** Unknown syntax: EOF\n"))
254
255
256class CmdPrintExceptionClass(cmd.Cmd):

Callers

nothing calls this directly

Calls 3

getvalueMethod · 0.95
assertMultiLineEqualMethod · 0.80
cmdloopMethod · 0.45

Tested by

no test coverage detected