Unit testing asynchronous processes

Tim Chase python.list at tim.thechases.com
Tue Dec 10 21:24:05 EST 2013


I've got some code that kicks off a background request to a remote
server over an SSL connection using client-side certificates.  Since
the request is made from a separate thread, I'm having trouble testing
that everything is working without without spinning up an out-of-band
mock server and actually making all the request.  Are there some best
practices for testing/mocking when things are asynchronous and
involve SSL connections to servers?

I'm currently just ignoring the SSL/client-cert thing and trusting my
calls work. But I'd like to at least have some tests that cover these
aspects so that things don't fall through the cracks.

Thanks,

-tkc





More information about the Python-list mailing list