Changeset 207
- Timestamp:
- 2003-03-15 18:50:17 (6 years ago)
- Files:
-
- trunk/_mock_ftplib.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_mock_ftplib.py
r182 r207 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _mock_ftplib.py,v 1.2 0 2002/04/03 21:47:41schwa Exp $32 # $Id: _mock_ftplib.py,v 1.21 2003/03/15 18:50:17 schwa Exp $ 33 33 34 34 """ … … 45 45 DEBUG = 0 46 46 47 # Use a global dictionary of the form {path: mock_file, ...}48 # to make "volatile" mock files accessible. This is used for49 # t esting the contents of a file after an FTPHost.uploadcall.47 # Use a global dictionary of the form `{path: mock_file, ...}` to 48 # make "volatile" mock files accessible. This is used for testing 49 # the contents of a file after an `FTPHost.upload` call. 50 50 mock_files = {} 51 51 … … 56 56 class MockFile(StringIO.StringIO): 57 57 """ 58 Mock class for the file objects _contained in_ _FTPFile59 objects (not _FTPFileobjects themselves!).60 61 Unless StringIO.StringIO instances, MockFileobjects can be62 queried for their contents after been closed.58 Mock class for the file objects _contained in_ `_FTPFile` objects 59 (not `_FTPFile` objects themselves!). 60 61 Unless `StringIO.StringIO` instances, `MockFile` objects can be 62 queried for their contents after they have been closed. 63 63 """ 64 64 def __init__(self, path, content=''): … … 82 82 """ 83 83 Mock class which is used to return something from 84 MockSession.transfercmd.84 `MockSession.transfercmd`. 85 85 """ 86 86 def __init__(self, path, mock_file_content=''): … … 99 99 class MockSession: 100 100 """ 101 Mock class which works like ftplib.FTPfor the purpose of the101 Mock class which works like `ftplib.FTP` for the purpose of the 102 102 unit tests. 103 103 """ … … 138 138 def __init__(self, host='', user='', password=''): 139 139 self.closed = 0 140 # count successful transfercmd invocations to ensure 141 # that each has a corresponding voidresp140 # count successful transfercmd invocations to ensure that 141 # each has a corresponding `voidresp` 142 142 self._transfercmds = 0 143 143
