summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2016-07-25 14:34:15 +0200
committerMatěj Cepl <mcepl@cepl.eu>2017-10-05 21:40:29 +0200
commitf17d8fa938f049a7423b3954a4374ad81a17c64c (patch)
treee006f76e404dae233274003f6268cd9f702620b9 /tests
parentbf0f120f1f16aa0d7d889c203f397631153a7ca0 (diff)
downloadm2crypto-f17d8fa938f049a7423b3954a4374ad81a17c64c.tar.gz
SSL.TwistedProtocolWrapper: some effort to PEP484-ize and port to py3k.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ssl.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index eb6c161..f8f6faf 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -28,6 +28,7 @@ import subprocess
import sys
import tempfile
import time
+import warnings
try:
import unittest2 as unittest
except ImportError:
@@ -827,7 +828,9 @@ class UrllibSSLClientTestCase(BaseSSLClientTestCase):
def test_urllib(self):
pid = self.start_server(self.args)
try:
- url = m2urllib.FancyURLopener()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ url = m2urllib.FancyURLopener()
url.addheader('Connection', 'close')
u = url.open('https://%s:%s/' % (srv_host, self.srv_port))
data = u.read()
@@ -1009,7 +1012,7 @@ class TwistedSSLClientTestCase(BaseSSLClientTestCase):
# TODO Class must implement all abstract methods
class EchoClient(LineReceiver):
def connectionMade(self):
- self.sendLine('GET / HTTP/1.0\n\n')
+ self.sendLine(b'GET / HTTP/1.0\n\n')
def lineReceived(self, line):
global twisted_data
@@ -1033,7 +1036,7 @@ class TwistedSSLClientTestCase(BaseSSLClientTestCase):
try:
global twisted_data
- twisted_data = ''
+ twisted_data = b''
context_factory = ContextFactory()
factory = EchoClientFactory()