File: test_base.py

package info (click to toggle)
python-ftputil 3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 848 kB
  • sloc: python: 3,308; makefile: 3
file content (17 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright (C) 2003-2013, Stefan Schwarzer <sschwarzer@sschwarzer.net>
# and ftputil contributors (see `doc/contributors.txt`)
# See the file LICENSE for licensing terms.

from __future__ import unicode_literals

import ftputil

from test import mock_ftplib


# Factory to produce `FTPHost`-like classes from a given `FTPHost`
# class and (usually) a given `MockSession` class.
def ftp_host_factory(session_factory=mock_ftplib.MockUnixFormatSession,
                     ftp_host_class=ftputil.FTPHost):
    return ftp_host_class("dummy_host", "dummy_user", "dummy_password",
                          session_factory=session_factory)