예제 #1
0
 def test_do_handle_echoes_newline_properly1(self):
     t = mock.Mock()
     h = echo.echo(t)
     self.assertFalse(h.stop)
     h.do_handle("\n")
     t.write.assert_called_with("\r\n")
     self.assertTrue(h.stop)
예제 #2
0
    def __init__(self, transport):
        super(simple_session, self).__init__(transport)
        
        lhandler = buffering.buffering(self.on_line, self.on_abort)
        ehandler = echo.echo(transport)
        khandler = keystroke.keystroke()
        khandler.simpleterm_bindings(transport)

        self.noecho = False
        self.ehandler = ehandler
        self.handler = handler.handler()
        self.handler.chain_other(khandler).chain(ehandler, lhandler)
        self.networks = []
예제 #3
0
 def test_do_handle_echoes_char_back(self):
     t = mock.Mock()
     h = echo.echo(t)
     h.do_handle("a")
     t.write.assert_called_with("a")
예제 #4
0
 def test_do_unhandle(self):
     t = mock.Mock()
     h = echo.echo(t)
     h.do_unhandle()
     t.write.assert_called_with("\b \b")
예제 #5
0
 def test_do_cancel(self):
     t = mock.Mock()
     h = echo.echo(t)
     h.do_cancel()
     self.assertEqual([(("^C",),{}), (("\r\n",),{})], t.write.call_args_list)