[Dev] Mock Reactor for tests?
Phillip J. Eby
pje at telecommunity.com
Tue Jun 7 22:11:34 PDT 2005
At 09:38 PM 6/7/2005 -0700, Heikki Toivonen wrote:
>I was going to say "forget the external server" and do everything by
>first recording a live session and then putting a mocket around the data
>that was recorded.
>
>However, SSL by design makes this approach hard because the server and
>client want to agree on some random key and every session is therefore
>different. Theoretically I could change the piece that chooses the
>random part to be deterministic. Not sure how hard that piece would be
>to find and how much would be involved in setting it so without
>affecting the real security of the system. There might be something like
>this already in OpenSSL's own test cases, but I'd have to go take a look.
Well, I already added useRealTime() and useSimulatedTime() to my
testreactor module, so all you should need to do in order to run your
original test is to just add the ReactorTestCase base class and replace the
run()/stop() with a waitUntil or waitFor(), after a call to
reactor.useRealTime().
More information about the Dev
mailing list