Esempio n. 1
0
 def testHelp(self):
     """
     Check that running the '?' command returns help.
     """
     d = self.runCommand('?')
     d.addCallback(self.assertEqual,
                   cftp.StdioClient(None).cmd_HELP('').strip())
     return d
Esempio n. 2
0
    def testHelp(self):
        """
        Check that running the '?' command returns help.
        """
        d = self.runCommand('?')

        helpText = cftp.StdioClient(None).cmd_HELP('').strip()
        if isinstance(helpText, unicode):
            helpText = helpText.encode("utf-8")
        d.addCallback(self.assertEqual, helpText)
        return d
Esempio n. 3
0
 def setUp(self):
     """
     Create a L{cftp.StdioClient} hooked up to dummy transport and a fake
     user database.
     """
     self.fakeFilesystem = FilesystemAccessExpectations()
     sftpClient = InMemorySFTPClient(self.fakeFilesystem )
     self.client = cftp.StdioClient(sftpClient)
     self.client.currentDirectory = '/'
     self.database = self.client._pwd = UserDatabase()
     # Use a fixed width for all tests so that we get the same results when
     # running these tests from different terminals.
     # Run tests in a wide console so that all items are delimited by at
     # least one space character.
     self.setKnownConsoleSize(500, 24)
     # Intentionally bypassing makeConnection - that triggers some code
     # which uses features not provided by our dumb Connection fake.
     self.client.transport = self.client.client.transport
Esempio n. 4
0
    def setUp(self):
        """
        Create a L{cftp.StdioClient} hooked up to dummy transport and a fake
        user database.
        """
        class Connection:
            pass

        conn = Connection()
        conn.transport = StringTransport()
        conn.transport.localClosed = False

        self.client = cftp.StdioClient(conn)
        self.database = self.client._pwd = UserDatabase()

        # Intentionally bypassing makeConnection - that triggers some code
        # which uses features not provided by our dumb Connection fake.
        self.client.transport = StringTransport()
 def testHelp(self):
     helpRes = self._getCmdResult('?')
     self.failUnlessEqual(helpRes, cftp.StdioClient(None).cmd_HELP('').strip())