From: Martin Date: Sat, 2 Jul 2016 01:17:28 +0000 (+0200) Subject: Py3: fix tests X-Git-Tag: v1.15.0~40^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbca4e48bab72178209fc50337c1ab5608094240;p=thirdparty%2Fdnspython.git Py3: fix tests --- diff --git a/tests/test_name.py b/tests/test_name.py index 2cfabda3..176be4da 100644 --- a/tests/test_name.py +++ b/tests/test_name.py @@ -549,7 +549,7 @@ class NameTestCase(unittest.TestCase): self.failUnless(n.choose_relativity(o, False) == e) def testFromWire1(self): - w = '\x03foo\x00\xc0\x00' + w = b'\x03foo\x00\xc0\x00' (n1, cused1) = dns.name.from_wire(w, 0) (n2, cused2) = dns.name.from_wire(w, cused1) en1 = dns.name.from_text('foo.') diff --git a/tests/test_ntoaaton.py b/tests/test_ntoaaton.py index ac72403c..2a47ceb3 100644 --- a/tests/test_ntoaaton.py +++ b/tests/test_ntoaaton.py @@ -39,19 +39,19 @@ class NtoAAtoNTestCase(unittest.TestCase): def test_aton1(self): a = aton6('::') - self.failUnless(a == '\x00' * 16) + self.failUnless(a == b'\x00' * 16) def test_aton2(self): a = aton6('::1') - self.failUnless(a == '\x00' * 15 + '\x01') + self.failUnless(a == b'\x00' * 15 + b'\x01') def test_aton3(self): a = aton6('::10.0.0.1') - self.failUnless(a == '\x00' * 12 + '\x0a\x00\x00\x01') + self.failUnless(a == b'\x00' * 12 + b'\x0a\x00\x00\x01') def test_aton4(self): a = aton6('abcd::dcba') - self.failUnless(a == '\xab\xcd' + '\x00' * 12 + '\xdc\xba') + self.failUnless(a == b'\xab\xcd' + b'\x00' * 12 + b'\xdc\xba') def test_aton5(self): a = aton6('1:2:3:4:5:6:7:8')