コード例 #1
0
 def test_requestWindowChange(self):
     """
     When the client requests to change the window size, the SSHSession
     object should make the request by getting an ISession adapter for the
     avatar, then calling windowChanged with the new window size.
     """
     ret = self.session.requestReceived(b"window_change", session.packRequest_window_change((0, 0, 0, 0)))
     self.assertFalse(ret)
     self.assertRequestRaisedRuntimeError()
     self.assertSessionIsStubSession()
     self.assertTrue(self.session.requestReceived(b"window_change", session.packRequest_window_change((1, 2, 3, 4))))
     self.assertEqual(self.session.session.windowChange, (1, 2, 3, 4))
コード例 #2
0
 def test_requestWindowChange(self):
     """
     When the client requests to change the window size, the SSHSession
     object should make the request by getting an ISession adapter for the
     avatar, then calling windowChanged with the new window size.
     """
     ret = self.session.requestReceived(
         'window_change', session.packRequest_window_change((0, 0, 0, 0)))
     self.assertFalse(ret)
     self.assertRequestRaisedRuntimeError()
     self.assertSessionIsStubSession()
     self.assertTrue(
         self.session.requestReceived(
             'window_change', session.packRequest_window_change(
                 (1, 2, 3, 4))))
     self.assertEquals(self.session.session.windowChange, (1, 2, 3, 4))
コード例 #3
0
 def test_requestWindowChangeGetsSession(self):
     """
     If an ISession adapter isn't already present, request_window_change
     should get one.
     """
     self.session.requestReceived(b"window_change", session.packRequest_window_change((1, 1, 1, 1)))
     self.assertSessionProvidesISession()
コード例 #4
0
 def test_requestWindowChangeGetsSession(self):
     """
     If an ISession adapter isn't already present, request_window_change
     should get one.
     """
     self.session.requestReceived(
         'window_change', session.packRequest_window_change((1, 1, 1, 1)))
     self.assertSessionProvidesISession()
コード例 #5
0
 def test_packRequest_window_change(self):
     """
     See test_parseRequest_window_change for the payload format.
     """
     self.assertEqual(
         session.packRequest_window_change((2, 1, 3, 4)),
         struct.pack(">4L", 1, 2, 3, 4),
     )
コード例 #6
0
ファイル: session.py プロジェクト: almightyyeh/webmux
    def updateWindowSize(self):
        time_diff = float(time.time() - self.last_update)
        if time_diff < 1 and not self.queue_call:
            reactor.callLater(time_diff, self.updateWindowSize)
            self.queue_call = True
            return

        self.queue_call = False
        self.last_update = time.time()
        self.conn.sendRequest(self, 'window-change', session.packRequest_window_change(self.window_size))
コード例 #7
0
ファイル: session.py プロジェクト: sruafly425/webmux
    def updateWindowSize(self):
        time_diff = float(time.time() - self.last_update)
        if time_diff < 1 and not self.queue_call:
            reactor.callLater(time_diff, self.updateWindowSize)
            self.queue_call = True
            return

        self.queue_call = False
        self.last_update = time.time()
        self.conn.sendRequest(
            self, 'window-change',
            session.packRequest_window_change(self.window_size))
コード例 #8
0
ファイル: ssh.py プロジェクト: AsherBond/opennode-management
 def terminalSize(self, width, height):
     data = session.packRequest_window_change((height, width, 0, 0))
     self.conn.sendRequest(self, 'window-change', data, wantReply=0)
コード例 #9
0
 def test_packRequest_window_change(self):
     """
     See test_parseRequest_window_change for the payload format.
     """
     self.assertEqual(session.packRequest_window_change((2, 1, 3, 4)), struct.pack(">4L", 1, 2, 3, 4))
コード例 #10
0
 def terminalSize(self, width, height):
     data = session.packRequest_window_change((height, width, 0, 0))
     self.conn.sendRequest(self, 'window-change', data, wantReply=0)