Test advanced FTP client commands.
Method | set |
Create a FTP client and connect it to fake transport. |
Method | tear |
Deliver disconnection notification to the client so that it can perform any cleanup which may be required. |
Method | test_another |
Test a different failure in getDirectory method. |
Method | test_ |
Test the CDUP command. |
Method | test_ |
Test the CWD command. |
Method | test_failed |
Test ftp.FTPClient.cdup 's handling of a failed CDUP command. |
Method | test_failed |
Test a failure in CWD command. |
Method | test_failed |
Test a failure in getDirectory method. |
Method | test_failed |
Test a failure in LIST command. |
Method | test_failed |
ftp.FTPClient.makeDirectory returns a Deferred which is errbacked with CommandFailed if the server returns an error response code. |
Method | test_failed |
Test a failure in NLST command. |
Method | test_failed |
Test a failure in PWD command. |
Method | test_failed |
If the server returns a response code other than 250 in response to a RMD sent by ftp.FTPClient.removeDirectory , the Deferred returned by removeDirectory is errbacked with a Failure wrapping a CommandFailed ... |
Method | test_failed |
If the server returns a response code other than 250 in response to a DELE sent by ftp.FTPClient.removeFile , the Deferred returned by removeFile is errbacked with a Failure wrapping a CommandFailed . |
Method | test_failed |
Try to RETR an unexisting file. |
Method | test_failed |
Test a failure in the STOR command. |
Method | test_get |
Test the getDirectory method. |
Method | test_ |
Test the LIST command in non-passive mode. |
Method | test_lost |
No summary |
Method | test_make |
ftp.FTPClient.makeDirectory issues a MKD command and returns a Deferred which is called back with the server's response if the directory is created. |
Method | test_make |
ftp.FTPClient.makeDirectory escapes the path name it sends according to http://cr.yp.to/ftp/filesystem.html. |
Method | test_multiline |
No summary |
Method | test_multiline |
If the server returns multiple response lines, the Deferred returned by ftp.FTPClient.removeFile is still fired with a true value if the ultimate response code is 250. |
Method | test_ |
Test the NLST command in non-passive mode. |
Method | test_passive |
Test the LIST command. |
Method | test_passive |
Test the NLST command. |
Method | test_passive |
Test the RETR command in passive mode: get a file and verify its content. |
Method | test_passive |
Test the STOR command: send a file and verify its content. |
Method | test_ |
Test the PWD command. |
Method | test_remove |
ftp.FTPClient.removeDirectory sends a RMD command to the server for the indicated directory and returns a Deferred which fires after the server sends a 250 response code. |
Method | test_remove |
ftp.FTPClient.removeFile sends a DELE command to the server for the indicated file and returns a Deferred which fires after the server sends a 250 response code. |
Method | test_rename |
ftp.FTPClient.rename issues RNTO and RNFR commands and returns a Deferred which fires when a file has successfully been renamed. |
Method | test_rename |
ftp.FTPClient.rename issues RNTO and RNFR commands with paths escaped according to http://cr.yp.to/ftp/filesystem.html. |
Method | test_rename |
The Deferred returned by ftp.FTPClient.rename is errbacked with CommandFailed if the RNFR command receives an error response code (for example, because the file does not exist). |
Method | test_rename |
The Deferred returned by ftp.FTPClient.rename is errbacked with CommandFailed if the RNTO command receives an error response code (for example, because the destination directory does not exist). |
Method | test_ |
Test the RETR command in non-passive mode. |
Method | test_send |
Test encoding behaviour of sendLine |
Method | test_ |
Test the STOR command in non-passive mode. |
Method | test_unparsable |
If the server returns a response line which cannot be parsed, the Deferred returned by ftp.FTPClient.removeDirectory is errbacked with a BadResponse containing the response. |
Method | test_unparsable |
If the server returns a response line which cannot be parsed, the Deferred returned by ftp.FTPClient.removeFile is errbacked with a BadResponse containing the response. |
Instance Variable | client |
Undocumented |
Instance Variable | transport |
Undocumented |
Method | _test |
Test the login part. |
Inherited from TestCase
:
Method | __call__ |
Run the test. Should always do exactly the same thing as run(). |
Method | __init__ |
Construct an asynchronous test case for methodName. |
Method | add |
Extend the base cleanup feature with support for cleanup functions which return Deferreds. |
Method | assert |
Fail if deferred does not errback with one of expectedFailures. Returns the original Deferred with callbacks added. You will need to return this Deferred from your test case. |
Method | defer |
Run any scheduled cleanups and report errors (if any) to the result. object. |
Method | defer |
Undocumented |
Method | defer |
Undocumented |
Method | defer |
Undocumented |
Method | get |
Undocumented |
Method | get |
Returns the timeout value set on this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a timeout attribute, returns that. Returns util.DEFAULT_TIMEOUT_DURATION ... |
Instance Variable | timeout |
A real number of seconds. If set, the test will raise an error if it takes longer than timeout seconds. If not set, util.DEFAULT_TIMEOUT_DURATION is used. |
Method | _cb |
Undocumented |
Method | _class |
Undocumented |
Method | _clean |
Undocumented |
Method | _deprecate |
Deprecate iterate, crash and stop on reactor. That is, each method is wrapped in a function that issues a deprecation warning, then calls the original. |
Method | _eb |
Undocumented |
Method | _eb |
Undocumented |
Method | _eb |
Undocumented |
Method | _make |
Create a method which wraps the reactor method name. The new method issues a deprecation warning and calls the original. |
Method | _run |
Run a single method, either a test method or fixture. |
Method | _run |
Really run setUp, the test method, and tearDown. Any of these may return defer.Deferred s. After they complete, do some reactor cleanup. |
Method | _undeprecate |
Restore the deprecated reactor methods. Undoes what _deprecateReactor did. |
Method | _wait |
Take a Deferred that only ever callbacks. Block until it happens. |
Instance Variable | _passed |
Undocumented |
Instance Variable | _reactor |
Undocumented |
Instance Variable | _timed |
Undocumented |
Inherited from SynchronousTestCase
(via TestCase
):
Method | __eq__ |
Override the comparison defined by the base TestCase which considers instances of the same class with the same _testMethodName to be equal. Since trial puts TestCase instances into a set, that definition of comparison makes it impossible to run the same test method twice... |
Method | __hash__ |
Undocumented |
Method | call |
Call a function that should have been deprecated at a specific version and in favor of a specific alternative, and assert that it was thusly deprecated. |
Method | flush |
Remove stored errors received from the log. |
Method | flush |
Remove stored warnings from the list of captured warnings and return them. |
Method | get |
Retrieve a module attribute which should have been deprecated, and assert that we saw the appropriate deprecation warning. |
Method | get |
Return the skip reason set on this test, if any is set. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a skip attribute, returns that in a tuple (... |
Method | get |
Return a Todo object if the test is marked todo. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a todo attribute, returns that. Returns ... |
Method | mktemp |
Create a new path name which can be used for a new file or directory. |
Method | patch |
Monkey patch an object for the duration of the test. |
Method | run |
Run the test case, storing the results in result. |
Method | run |
If no methodName argument is passed to the constructor, run will treat this method as the thing with the actual test inside. |
Method | short |
Undocumented |
Instance Variable | failure |
An exception class, defaulting to FailTest. If the test method raises this exception, it will be reported as a failure, rather than an exception. All of the assertion methods raise this if the assertion fails. |
Instance Variable | skip |
None or a string explaining why this test is to be skipped. If defined, the test will not be run. Instead, it will be reported to the result object as 'skipped' (if the TestResult supports skipping). |
Instance Variable | suppress |
None or a list of tuples of (args, kwargs) to be passed to warnings.filterwarnings. Use these to suppress warnings raised in a test. Useful for testing deprecated code. See also util.suppress . |
Instance Variable | todo |
None , a string or a tuple of (errors, reason) where errors is either an exception class or an iterable of exception classes, and reason is a string. See Todo or makeTodo for more information. |
Method | _get |
Return the reason to use for skipping a test method. |
Method | _get |
Returns any warning suppressions set for this test. Checks on the instance first, then the class, then the module, then packages. As soon as it finds something with a suppress attribute, returns that. ... |
Method | _install |
Undocumented |
Method | _remove |
Undocumented |
Method | _run |
Synchronously run any cleanups which have been added. |
Instance Variable | _cleanups |
Undocumented |
Instance Variable | _observer |
Undocumented |
Instance Variable | _parents |
Undocumented |
Instance Variable | _test |
Undocumented |
Instance Variable | _warnings |
Undocumented |
Inherited from _Assertions
(via TestCase
, SynchronousTestCase
):
Method | assert |
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. |
Method | assert |
Fail if first - second > tolerance |
Method | assert |
Fail the test if first and second are not equal. |
Method | assert |
Fail the test if condition evaluates to True. |
Method | assert |
Fail the test if containee is not found in container. |
Method | assert |
Fail the test if first is not second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test. |
Method | assert |
Fail if instance is not an instance of the given class or of one of the given classes. |
Method | assert |
Fail the test if first is second. This is an obect-identity-equality test, not an object equality (i.e. __eq__) test. |
Method | assert |
Assert that deferred does not have a result at this point. |
Method | assert |
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. |
Method | assert |
Fail the test if first == second. |
Method | assert |
Fail the test if containee is found in container. |
Method | assert |
Fail if instance is an instance of the given class or of one of the given classes. |
Method | assert |
Fail if astring contains substring. |
Method | assert |
Fail the test unless calling the function f with the given args and kwargs raises exception. The failure will report the traceback and call stack of the unexpected exception. |
Method | assert |
Fail if substring does not exist within astring. |
Method | assert |
Fail the test if condition evaluates to False. |
Method | assert |
Fail if the given function doesn't generate the specified warning when called. It calls the function, checks the warning, and forwards the result of the function if everything is fine. |
Method | fail |
Absolutely fail the test. Do not pass go, do not collect $200. |
Method | failure |
Return the current failure result of deferred or raise self.failureException. |
Method | success |
Return the current success result of deferred or raise self.failureException. |
Deliver disconnection notification to the client so that it can perform any cleanup which may be required.
Test a different failure in getDirectory method.
The response should be quoted to be parsed, so it returns an error otherwise.
Test the CDUP command.
ftp.FTPClient.cdup
should return a Deferred which fires with a sequence of one element which is the string the server sent indicating that the command was executed successfully.
(XXX - This is a bad API)
Test the CWD command.
ftp.FTPClient.cwd
should return a Deferred which fires with a sequence of one element which is the string the server sent indicating that the command was executed successfully.
(XXX - This is a bad API)
Test ftp.FTPClient.cdup
's handling of a failed CDUP command.
When the CDUP command fails, the returned Deferred should errback with ftp.CommandFailed
.
Test a failure in CWD command.
When the PWD command fails, the returned Deferred should errback with ftp.CommandFailed
.
Test a failure in LIST command.
ftp.FTPClient.list
should return a Deferred which fails with ftp.CommandFailed
if the server indicates the indicated path is invalid for some reason.
ftp.FTPClient.makeDirectory
returns a Deferred
which is errbacked with CommandFailed
if the server returns an error response code.
Test a failure in NLST command.
ftp.FTPClient.nlst
should return a Deferred which fails with ftp.CommandFailed
if the server indicates the indicated path is invalid for some reason.
Test a failure in PWD command.
When the PWD command fails, the returned Deferred should errback with ftp.CommandFailed
.
If the server returns a response code other than 250 in response to a RMD sent by ftp.FTPClient.removeDirectory
, the Deferred
returned by removeDirectory is errbacked with a Failure
wrapping a CommandFailed
.
If the server returns a response code other than 250 in response to a DELE sent by ftp.FTPClient.removeFile
, the Deferred
returned by removeFile is errbacked with a Failure
wrapping a CommandFailed
.
Try to RETR an unexisting file.
ftp.FTPClient.retrieveFile
should return a Deferred which errbacks with ftp.CommandFailed
if the server indicates the file cannot be transferred for some reason.
Test a failure in the STOR command.
If the server does not acknowledge successful receipt of the uploaded file, the second Deferred returned by ftp.FTPClient.storeFile
should errback with ftp.CommandFailed
.
Test the getDirectory method.
ftp.FTPClient.getDirectory
should return a Deferred which fires with the current directory on the server. It wraps PWD command.
Test the LIST command in non-passive mode.
Like test_passiveLIST
but in the configuration where the server establishes the data connection to the client, rather than the other way around.
ftp.FTPClient.makeDirectory
issues a MKD command and returns a Deferred
which is called back with the server's response if the directory is created.
ftp.FTPClient.makeDirectory
escapes the path name it sends according to http://cr.yp.to/ftp/filesystem.html.
If the server returns multiple response lines, the Deferred
returned by ftp.FTPClient.removeFile
is still fired with a true value if the ultimate response code is 250.
Test the NLST command in non-passive mode.
ftp.FTPClient.nlst
should return a Deferred which fires with a list of filenames when the list command has completed.
Test the LIST command.
ftp.FTPClient.list
should return a Deferred which fires with a protocol instance which was passed to list after the command has succeeded.
(XXX - This is a very unfortunate API; if my understanding is correct, the results are always at least line-oriented, so allowing a per-line parser function to be specified would make this simpler, but a default implementation should really be provided which knows how to deal with all the formats used in real servers, so application developers never have to care about this insanity. It would also be nice to either get back a Deferred of a list of filenames or to be able to consume the files as they are received (which the current API does allow, but in a somewhat inconvenient fashion) -exarkun)
Test the NLST command.
Like test_passiveNLST
but in the configuration where the server establishes the data connection to the client, rather than the other way around.
Test the RETR command in passive mode: get a file and verify its content.
ftp.FTPClient.retrieveFile
should return a Deferred which fires with the protocol instance passed to it after the download has completed.
(XXX - This API should be based on producers and consumers)
Test the STOR command: send a file and verify its content.
ftp.FTPClient.storeFile
should return a two-tuple of Deferreds. The first of which should fire with a protocol instance when the data connection has been established and is responsible for sending the contents of the file. The second of which should fire when the upload has completed, the data connection has been closed, and the server has acknowledged receipt of the file.
(XXX - storeFile should take a producer as an argument, instead, and only return a Deferred which fires when the upload has succeeded or failed).
Test the PWD command.
ftp.FTPClient.pwd
should return a Deferred which fires with a sequence of one element which is a string representing the current working directory on the server.
(XXX - This is a bad API)
ftp.FTPClient.removeDirectory
sends a RMD command to the server for the indicated directory and returns a Deferred which fires after the server sends a 250 response code.
ftp.FTPClient.removeFile
sends a DELE command to the server for the indicated file and returns a Deferred which fires after the server sends a 250 response code.
ftp.FTPClient.rename
issues RNTO and RNFR commands and returns a Deferred
which fires when a file has successfully been renamed.
ftp.FTPClient.rename
issues RNTO and RNFR commands with paths escaped according to http://cr.yp.to/ftp/filesystem.html.
The Deferred
returned by ftp.FTPClient.rename
is errbacked with CommandFailed
if the RNFR command receives an error response code (for example, because the file does not exist).
The Deferred
returned by ftp.FTPClient.rename
is errbacked with CommandFailed
if the RNTO command receives an error response code (for example, because the destination directory does not exist).
Test the RETR command in non-passive mode.
Like test_passiveRETR
but in the configuration where the server establishes the data connection to the client, rather than the other way around.
Test the STOR command in non-passive mode.
Like test_passiveSTOR
but in the configuration where the server establishes the data connection to the client, rather than the other way around.
If the server returns a response line which cannot be parsed, the Deferred
returned by ftp.FTPClient.removeDirectory
is errbacked with a BadResponse
containing the response.
If the server returns a response line which cannot be parsed, the Deferred
returned by ftp.FTPClient.removeFile
is errbacked with a BadResponse
containing the response.