Changeset 153
- Timestamp:
- 2002-04-01 13:05:04 (7 years ago)
- Files:
-
- trunk/_mock_ftplib.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_mock_ftplib.py
r149 r153 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _mock_ftplib.py,v 1.1 6 2002/03/31 23:17:26schwa Exp $32 # $Id: _mock_ftplib.py,v 1.17 2002/04/01 13:05:04 schwa Exp $ 33 33 34 34 """ … … 53 53 return mock_files[path].getvalue() 54 54 55 55 56 class MockFile(StringIO.StringIO): 56 57 """ 57 58 Mock class for the file objects _contained in_ _FTPFile 58 objects (not for _FTPFile objects themselves!). 59 objects (not _FTPFile objects themselves!). 60 61 Unless StringIO.StringIO instances, MockFile objects can be 62 queried for their contents after been closed. 59 63 """ 60 64 def __init__(self, path, content=''): … … 74 78 StringIO.StringIO.close(self) 75 79 76 80 77 81 class MockSocket: 78 82 """ … … 100 104 # used by MockSession.cwd and MockSession.pwd 101 105 current_dir = '/home/sschwarzer' 102 106 103 107 # used by MockSession.dir 104 108 dir_contents = { … … 121 125 # file content to be used (indirectly) with transfercmd 122 126 mock_file_content = '' 123 127 124 128 def __init__(self, host='', user='', password=''): 125 129 self.closed = 0 … … 132 136 path = path[:-1] 133 137 return path 134 138 135 139 def voidcmd(self, cmd): 136 140 if DEBUG:
