(self)
| 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 | |
| 256 | class CmdPrintExceptionClass(cmd.Cmd): |
nothing calls this directly
no test coverage detected