Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

PyTest FTP Server

https://img.shields.io/pypi/v/pytest_localftpserver.svg https://img.shields.io/pypi/pyversions/pytest_localftpserver.svg https://api.travis-ci.org/oz123/pytest-localftpserver.svg?branch=master https://ci.appveyor.com/api/projects/status/github/oz123/pytest-localftpserver?svg=true Documentation Status Updates Coverage

A PyTest plugin which provides an FTP fixture for your tests

Attention!

As of version 1.0.0 the support for python 2.7 and 3.4 was dropped. If you need to support those versions you should pin the version to 0.6.0, i.e. add the following lines to your “requirements_dev.txt”:

# pytest_localftpserver==0.6.0
https://github.com/oz123/pytest-localftpserver/archive/v0.6.0.zip

Usage Quickstart:

This Plugin provides the fixtures ftpserver and ftpserver_TLS, which are threaded instances of a FTP server, with which you can upload files and test FTP functionality. It can be configured using the following environment variables:

Environment variable

Usage

FTP_USER

Username of the registered user.

FTP_PASS

Password of the registered user.

FTP_PORT

Port for the normal ftp server to run on.

FTP_HOME

Home folder of the registered user.

FTP_FIXTURE_SCOPE

Scope/lifetime of the fixture.

FTP_PORT_TLS

Port for the TLS ftp server to run on.

FTP_HOME_TLS

Home folder of the registered user, used by the TLS ftp server.

FTP_CERTFILE

Certificate to be used by the TLS ftp server.

See the tests directory or the documentation for examples.

You can either set environment variables on a system level or use tools such as pytest-env or tox, to change the default settings of this plugin. Sample config for pytest-cov:

$ cat pytest.ini
[pytest]
env =
    FTP_USER=benz
    FTP_PASS=erni1
    FTP_HOME = /home/ftp_test
    FTP_PORT=31175
    FTP_FIXTURE_SCOPE=function
    # only affects ftpserver_TLS
    FTP_PORT_TLS = 31176
    FTP_HOME_TLS = /home/ftp_test_TLS
    FTP_CERTFILE = ./tests/test_keycert.pem

Sample config for Tox:

$ cat tox.ini
[tox]
envlist = py{27,34,35,36,37}

[testenv]
setenv =
    FTP_USER=benz
    FTP_PASS=erni1
    FTP_HOME = {envtmpdir}
    FTP_PORT=31175
    FTP_FIXTURE_SCOPE=function
    # only affects ftpserver_TLS
    FTP_PORT_TLS = 31176
    FTP_HOME_TLS = /home/ftp_test_TLS
    FTP_CERTFILE = {toxinidir}/tests/test_keycert.pem
commands =
    py.test tests

Credits

This package was inspired by, https://pypi.org/project/pytest-localserver/ made by Sebastian Rahlf, which lacks an FTP server.

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

1.0.1 (2019-12-10)

  • Include the certificate in the source package

  • Use a bigger certificate

1.0.0 (2019-09-05)

  • Dropped support for Python 2.7 and 3.4

0.6.0 - released as tag only

  • Added fixture scope configuration.

  • Added ftpserver_TLS as TLS version of the fixture.

0.5.0 (2018-12-04)

  • Added support for Windows.

  • Added hightlevel interface.

0.1.0 (2016-12-09)

  • First release on PyPI.

Metadata

Release files for pytest-localftpserver 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for pytest-localftpserver 1.0.1
File Size Uploaded
pytest_localftpserver-1.0.1.tar.gz 43.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-localftpserver 1.0.1
File Interpreter ABI Platform
pytest_localftpserver-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 65.3 kB

Release files / pytest_localftpserver-1.0.1.tar.gz

Download URL pytest_localftpserver-1.0.1.tar.gz
Size 43.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4a9ce95ff91aa87cc6325c7c2b31450bc6c42ee0e91e6ccba2223e36435f2c1c
BLAKE2b-256 checksum
How to use checksums
3d2ac204cde1521dda1f3db05485541397e02c3f9510edce5051db8ea5f2c76f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.0.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.23.3 CPython/3.6.9

Release files / pytest_localftpserver-1.0.1-py2.py3-none-any.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL pytest_localftpserver-1.0.1-py2.py3-none-any.whl
Size 21.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6eff17caa7c881a881e33f5bb5ca0c81236228c6b28945617b040f2941b3593a
BLAKE2b-256 checksum
How to use checksums
2e3c20f7ca6285f9bd512761a7e9b4b7f79ebfd1b24567ad28d5a7fcfe4f8b5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release history Release notifications | RSS feed

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

1 release file

0.5.1

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page