diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-02-27 22:34:36 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-02-27 22:34:36 +0100 |
commit | 24a3dd59fec825afeff8cb62426f963653e8476a (patch) | |
tree | d3f738154328fcd3e5f8a776704e2827793b1e98 | |
parent | d71f3b68fda688fec358b59fdcfaaa7031b3b80d (diff) | |
download | mitmproxy-24a3dd59fec825afeff8cb62426f963653e8476a.tar.gz mitmproxy-24a3dd59fec825afeff8cb62426f963653e8476a.tar.bz2 mitmproxy-24a3dd59fec825afeff8cb62426f963653e8476a.zip |
try harder to fix race condition in tests
-rw-r--r-- | test/test_tcp.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_tcp.py b/test/test_tcp.py index 2216e0d4..b93b1e0a 100644 --- a/test/test_tcp.py +++ b/test/test_tcp.py @@ -575,15 +575,21 @@ class TestSSLKeyLogger(test.ServerTestBase): ) def test_log(self): + testval = "echo!\n" _logfun = tcp.log_ssl_key with tutils.tmpdir() as d: logfile = os.path.join(d, "foo", "bar", "logfile") tcp.log_ssl_key = tcp.SSLKeyLogger(logfile) + c = tcp.TCPClient(("127.0.0.1", self.port)) c.connect() c.convert_to_ssl() + c.wfile.write(testval) + c.wfile.flush() + assert c.rfile.readline() == testval c.finish() + tcp.log_ssl_key.close() with open(logfile, "rb") as f: assert f.read().count("CLIENT_RANDOM") == 2 |