python3:tests: Fix Python 3 test issues
authorPetr Viktorin <pviktori@redhat.com>
Wed, 3 May 2017 17:11:03 +0000 (19:11 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 19 May 2017 20:20:16 +0000 (22:20 +0200)
- Forgotten text strings that should be binary
- Inverted PY3 condition

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/core.py
python/samba/tests/dcerpc/misc.py

index 7fb3698f39d7c32222c403aafa07c9f8622d7d7f..504d458b7f80afbd29abb4600a73c76da404c226 100644 (file)
@@ -52,8 +52,8 @@ class SubstituteVarTestCase(TestCase):
 class ArcfourTestCase(TestCase):
 
     def test_arcfour_direct(self):
-        key = '12345678'
-        plain = 'abcdefghi'
+        key = b'12345678'
+        plain = b'abcdefghi'
         crypt_expected = b'\xda\x91Z\xb0l\xd7\xb9\xcf\x99'
         crypt_calculated = arcfour_encrypt(key, plain)
         self.assertEquals(crypt_expected, crypt_calculated)
index 68654a7bfd52f9104167d5a35a48a2842c911a55..2ec095063e94a5c349814b609ae9027abd867147 100644 (file)
@@ -25,7 +25,7 @@ text1 = "76f53846-a7c2-476a-ae2c-20e2b80d7b34"
 text2 = "344edffa-330a-4b39-b96e-2c34da52e8b1"
 
 
-if not PY3:
+if PY3:
     # cmp() exists only in Python 2
     def cmp(a, b):
         return (a > b) - (a < b)