diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_log.py | 3 | ||||
-rw-r--r-- | test/test_pathoc.py | 4 | ||||
-rw-r--r-- | test/test_pathod.py | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/test/test_log.py b/test/test_log.py index 2cac1e7c..8f38c040 100644 --- a/test/test_log.py +++ b/test/test_log.py @@ -1,5 +1,6 @@ import StringIO from libpathod import log +from netlib.exceptions import TcpDisconnect import netlib.tcp @@ -19,6 +20,6 @@ def test_disconnect(): try: with l.ctx() as lg: lg("Test") - except netlib.tcp.NetLibDisconnect: + except TcpDisconnect: pass assert "Test" in outf.getvalue() diff --git a/test/test_pathoc.py b/test/test_pathoc.py index 1e15c9eb..6c0bf039 100644 --- a/test/test_pathoc.py +++ b/test/test_pathoc.py @@ -5,7 +5,7 @@ import OpenSSL from mock import Mock from netlib import tcp, http, socks -from netlib.exceptions import HttpException +from netlib.exceptions import HttpException, TcpException, NetlibException from netlib.http import http1, http2 from libpathod import pathoc, test, version, pathod, language @@ -84,7 +84,7 @@ class _TestDaemon: r = r.freeze(language.Settings()) try: c.request(r) - except (HttpException, tcp.NetLibError): + except NetlibException: pass return s.getvalue() diff --git a/test/test_pathod.py b/test/test_pathod.py index ed37385d..1da2633f 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -4,7 +4,7 @@ import OpenSSL from libpathod import pathod, version from netlib import tcp, http -from netlib.exceptions import HttpException +from netlib.exceptions import HttpException, TlsException import tutils @@ -264,7 +264,7 @@ class TestDaemonSSL(CommonTests): c.wbufsize = 0 c.connect() c.wfile.write("\0\0\0\0") - tutils.raises(tcp.NetLibError, c.convert_to_ssl) + tutils.raises(TlsException, c.convert_to_ssl) l = self.d.last_log() assert l["type"] == "error" assert "SSL" in l["msg"] |