No project description provided
Project description
You need a temporary ftp server in your python unittests?
This small library provides you the class called FTPServerContext.
Usage
Usage:
temp_dir = tempfile.mkdtemp() with FTPServerContext(temp_dir) as ftp_context: # now you have these variables for testing your ftp client code: ftp_context.ip_address ftp_context.test_user_name ftp_context.test_user_password ftp_context.port
Install
Via pip:
pip install ftpservercontext
Internals
With subprocess.Popen() a script called serve_directory_via_ftp gets called.
You provide FTPServerContext a directory and the ftp server serves this directory via ftp running on ‘127.0.0.1’ and a matching open port.
You can see a working example in the unittest: https://github.com/tbz-pariv/ftpservercontext/blob/master/ftpservercontext/tests/test_ftpservercontext.py
Feedback
Feedback is welcome. Just open an issue at github, even if you just want to say “thank you”.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for ftpservercontext-2018.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1eaa97b077166cfe526d386960443ff4fb976df4be032e2b7622d2ce315944e |
|
MD5 | 69ab253f13ce0d7ab4e31f60776b58bd |
|
BLAKE2b-256 | af37f55fcf440d9f77251cfa83471e54595c83949caa3813e1ce263d1823ea01 |