Changeset 1827:ae7c58902489


Ignore:
Timestamp:
Jun 30, 2019, 9:08:06 PM (8 weeks ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
rebase_source:
fbeb05a9087565bfdd4cfa2581d95e35e41d7741
Message:
Remove unused mock session classes

These classes were needed when the tests in `test_file.py` and
`test_with_statement.py` still used the old mock session support in
`mock_ftplib.py`.
Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/test_file.py

    r1826 r1827  
    1111import ftputil.error
    1212
    13 from test import mock_ftplib
    1413from test import scripted_session
    1514from test import test_base
     
    1716
    1817Call = scripted_session.Call
    19 
    20 
    21 #
    22 # Several customized `MockSession` classes
    23 #
    24 class ReadMockSession(mock_ftplib.MockSession):
    25 
    26     mock_file_content = b"line 1\r\nanother line\r\nyet another line"
    27 
    28 
    29 class ReadMockSessionWithMoreNewlines(mock_ftplib.MockSession):
    30 
    31     mock_file_content = b"\r\n".join(map(bytes, range(20)))
    32 
    33 
    34 class InaccessibleDirSession(mock_ftplib.MockSession):
    35 
    36     _login_dir = "/inaccessible"
    37 
    38     def pwd(self):
    39         return self._login_dir
    40 
    41     def cwd(self, dir):
    42         if dir in (self._login_dir, self._login_dir + "/"):
    43             raise ftplib.error_perm
    44         else:
    45             super(InaccessibleDirSession, self).cwd(dir)
    4618
    4719
  • test/test_with_statement.py

    r1819 r1827  
    1111import test.scripted_session as scripted_session
    1212from test import test_base
    13 from test.test_file import InaccessibleDirSession, ReadMockSession
    1413
    1514
Note: See TracChangeset for help on using the changeset viewer.