Changeset 112
- Timestamp:
- 2002-03-30 14:53:01 (7 years ago)
- Files:
-
- trunk/_mock_ftplib.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_mock_ftplib.py
r109 r112 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _mock_ftplib.py,v 1. 6 2002/03/29 23:16:32schwa Exp $32 # $Id: _mock_ftplib.py,v 1.7 2002/03/30 14:53:01 schwa Exp $ 33 33 34 34 """ … … 325 325 class MockSession: 326 326 327 # used by MockSession. pwd328 pwd_results = []327 # used by MockSession.cwd and MockSession.pwd 328 current_dir = '/home/sschwarzer' 329 329 330 330 # used by MockSession.dir 331 331 dir_contents = { 332 '/ absolute': """\333 drwxr-sr-x 2 45854 200 512 May 4 2000 path""",334 '/ absolute/path': """\332 '/home': """\ 333 drwxr-sr-x 2 45854 200 512 May 4 2000 sschwarzer""", 334 '/home/sschwarzer': """\ 335 335 total 14 336 336 drwxr-sr-x 2 45854 200 512 May 4 2000 chemeng … … 354 354 355 355 def pwd(self): 356 result = self.pwd_results[self.pwd_result_index] 357 self.pwd_result_index += 1 358 return result 356 return self.current_dir 359 357 360 358 def dir(self, path, callback=None): 361 359 if DEBUG: 362 360 print 'dir: %s' % path 361 if path.endswith('/'): 362 path = path[:-1] 363 363 if not self.dir_contents.has_key(path): 364 364 raise ftplib.error_perm … … 375 375 raise ftplib.error_perm 376 376 377 378 class StatTest(MockSession):379 pwd_results = ['/absolute/path']380
