Changeset 1607:5b2f60275a3f


Ignore:
Timestamp:
Nov 22, 2015, 5:37:22 PM (5 years ago)
Author:
Stefan Schwarzer <sschwarzer@…>
Branch:
default
Message:
Change expected error message in unit test

`TestErrorConversion.test_error_message_reuse` tests the construction
of the error message in ftputil. `str(exception)` should include the
error from the caught ftplib exception. In case of the unit test, the
ftplib exception is a socket error (`gaierror`).

It seems the error arguments have changed from `(-2, "Name or service
not known")` to `(-5, "No address associated with hostname")`. I
assume this is due to the update from Fedora 21 to 22. I don't believe
the change is due to a change in Python version because both Python 2
and 3 fail(ed) the unit test and are fixed by the same code change in
`ftputil.error`.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/test_error.py

    r1565 r1607  
    9393            # The error message might change for future Python
    9494            # versions, so possibly relax the assertion later.
    95             self.assertTrue("[Errno -2] Name or service not known" in
    96                             str(exc))
     95            self.assertTrue(
     96              "[Errno -5] No address associated with hostname" in str(exc))
    9797
    9898
Note: See TracChangeset for help on using the changeset viewer.