Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Best practices for usage

sax edited this page Jun 12, 2011 · 1 revision

FakeFtp is a fake ftp server. It supports a lot of commands in the FTP protocol. It also supports file download as of a recent pull request. As such, there are a few things that should be kept in mind:

  • keep your files small. You don't want to slow down your tests by having them upload megabytes of data on every iteration. As such:
  • test your file generation separate from your file upload ** Stub or mock FTP for your tests that create files ** Stub file creation with a small fixture file for your tests that cover FTP
  • close your FTP connections after use! ** the server is not good at detecting abandoned connections, and sockets can remain open. This will cause problems for further tests.

There have been some reported issues of exceptions occurring in the library when starting and stopping fake ftp servers between many tests. These issues have been difficult to replicate, but some people have gotten around them by starting one server at the beginning of the test suite and using it for everything.

If you notice this problem and can produce replicable steps, please file an issue!

Clone this wiki locally