Changeset 1751:91115f000cd9


Ignore:
Timestamp:
Jan 1, 2019, 2:30:30 PM (3 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Use `ScriptedSession` in `test_command_not_implemented_error`
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_host.py

    r1750 r1751  
    260260        implemented by the server.
    261261        """
    262         host = test_base.ftp_host_factory()
     262        Call = scripted_session.Call
     263        script = [
     264          Call(method_name="__init__"),
     265          Call(method_name="pwd", result="/"),
     266          Call(method_name="cwd", result=None, expected_args=("/",)),
     267          Call(method_name="cwd", result=None, expected_args=("/",)),
     268          Call(method_name="voidcmd",
     269               result=ftplib.error_perm("502 command not implemented"),
     270               expected_args=("SITE CHMOD 0644 nonexistent",)),
     271          Call(method_name="cwd", result=None, expected_args=("/",)),
     272          Call(method_name="cwd", result=None, expected_args=("/",)),
     273          Call(method_name="cwd", result=None, expected_args=("/",)),
     274          Call(method_name="voidcmd",
     275               result=ftplib.error_perm("502 command not implemented"),
     276               expected_args=("SITE CHMOD 0644 nonexistent",)),
     277          Call(method_name="cwd", result=None, expected_args=("/",)),
     278        ]
     279        host = test_base.ftp_host_factory(scripted_session.factory(script))
    263280        with pytest.raises(ftputil.error.CommandNotImplementedError):
    264281            host.chmod("nonexistent", 0o644)
Note: See TracChangeset for help on using the changeset viewer.