Registry / testing / mocksftp

mocksftp

JSON →
library1.0.1pypypi✓ verified 80d ago

Mocksftp (v1.0.1) provides a mock SFTP server for integration testing. It runs an in-process SFTP server backed by paramiko, enabling tests to exercise SFTP clients without a real SSH server. Low activity, no release schedule.

pip install mocksftp
INSTALL
IMPORT
SIG · MOCKSFTP
M
mocksftp
testingpythonv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MockSFTPServer
import mocksftp
from mocksftp import MockSFTPServer

Basic usage: start mock SFTP server, connect and transfer file.

import os from mocksftp import MockSFTPServer import paramiko with MockSFTPServer() as server: port = server.server_port username = 'testuser' password = 'testpass' transport = paramiko.Transport(('localhost', port)) transport.connect(username=username, password=password) sftp = paramiko.SFTPClient.from_transport(transport) sftp.put('local.txt', 'remote.txt') sftp.close() transport.close()
Debug
Known issues
gotchaMockSFTPServer uses PF_LOCAL sockets on some systems; set use_pipe=False to force TCP.
fix
MockSFTPServer(use_pipe=False) when running on platforms with PF_LOCAL issues.
affects: all
gotchaFrom python 3.12+, paramiko may fail due to deprecation of Crypto. Ensure paramiko and cryptography are updated.
fix
pip install paramiko[gssapi] cryptography>=41.0
affects: 1.0.1
gotchaMockSFTPServer does not persist files between sessions; each context creates a fresh temp directory.
fix
Use the filesystem argument to set a persistent root directory if needed.
affects: all
Upgrade
Version history
1.0.1latest on PyPI · released Mar 21, 2018
Audit
Dependencies
paramikorequiredSSH/SFTP protocol implementation
Agent activity
14 hits · last 30 days
node
14
Resources
mocksftp — pip install mocksftp · libregistry