This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients martin.panter, pitrou, rishi.maker.forum, serhiy.storchaka
Date 2015-03-17.02:42:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426560139.75.0.360694216439.issue22351@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-03-17 02:42:19martin.pantersetrecipients: + martin.panter, pitrou, serhiy.storchaka, rishi.maker.forum
2015-03-17 02:42:19martin.pantersetmessageid: <1426560139.75.0.360694216439.issue22351@psf.upfronthosting.co.za>
2015-03-17 02:42:19martin.panterlinkissue22351 messages
2015-03-17 02:42:19martin.pantercreate