Message238256
Thanks for reviewing, Serhiy. I am posting a new patch addressing the comments:
* Removed underscore from method name
* Made separate MockSslTests subclass, using a hacked ssl_context parameter to bypass the SSL module
* Separated asserts for closed socket and file objects
I have left the tests patching the “nntplib” module and inserting a mock “socket” module. Serhiy suggested patching the “socket” module directly, but that seems to be asking for trouble. Alternatives I can think of are:
* Go back to Rishi’s original code that uses a real socket in a background thread.
* Do the patching in a subprocess. But this is awkward if you want to reuse the existing NNTPv1Handler class in the subprocess. Suggestions or patches welcome :)
* Refactor the “nntplib” code specially to make it easier to test without a real socket and without patching |
|
Date |
User |
Action |
Args |
2015-03-17 02:42:19 | martin.panter | set | recipients:
+ martin.panter, pitrou, serhiy.storchaka, rishi.maker.forum |
2015-03-17 02:42:19 | martin.panter | set | messageid: <1426560139.75.0.360694216439.issue22351@psf.upfronthosting.co.za> |
2015-03-17 02:42:19 | martin.panter | link | issue22351 messages |
2015-03-17 02:42:19 | martin.panter | create | |
|