Changeset 1819:66015241a6d5


Ignore:
Timestamp:
Jun 18, 2019, 7:46:02 PM (2 months ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Add docstrings to test methods
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_with_statement.py

    r1818 r1819  
    2929
    3030    def test_normal_operation(self):
     31        """
     32        If an `FTPHost` instance is created, it should be closed by the host
     33        context manager.
     34        """
    3135        script = [
    3236          Call(method_name="__init__"),
     
    3943
    4044    def test_ftputil_exception(self):
     45        """
     46        If an `ftplib.FTP` method raises an exception, it should be caught by
     47        the host context manager and the host object should be closed.
     48        """
    4149        script = [
    4250          # Since `__init__` raises an exception, `pwd` isn't called. However,
     
    5462
    5563    def test_client_code_exception(self):
     64        """
     65        If client code raises an exception in the context manager block, the
     66        host object should be closed by the context manager.
     67        """
    5668        script = [
    5769          Call(method_name="__init__"),
     
    7284
    7385    def test_normal_operation(self):
     86        """
     87        If an `FTPFile` object is created in the `FTPFile` context manager, the
     88        context manager should close the file at the end of the `with` block.
     89        """
    7490        host_script = [
    7591          Call(method_name="__init__"),
     
    98114
    99115    def test_ftputil_exception(self):
     116        """
     117        If an `ftplib.FTP` method raises an exception, the `FTPFile` context
     118        manager should try to close the file.
     119        """
    100120        host_script = [
    101121          Call(method_name="__init__"),
     
    127147
    128148    def test_client_code_exception(self):
     149        """
     150        If client code raises an exception in the `FTPFile` context manager
     151        block, the file object should be closed by the context manager.
     152        """
    129153        host_script = [
    130154          Call(method_name="__init__"),
Note: See TracChangeset for help on using the changeset viewer.