diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2018-03-18 21:50:38 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-03-19 12:25:50 +0100 |
commit | b977909fc93caa599e52943be25b7f6042a4c70b (patch) | |
tree | 75b02a848786f7c7cdb8c4220e7f5bc39befd8a6 /tests/test_authcookie.py | |
parent | d15ceaa99cbe560052c7fe9ecbbc77ecfd3d18b6 (diff) | |
download | m2crypto-b977909fc93caa599e52943be25b7f6042a4c70b.tar.gz |
Replace util.py3{bytes,str} with six.ensure_{binary,text}
Diffstat (limited to 'tests/test_authcookie.py')
-rwxr-xr-x | tests/test_authcookie.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_authcookie.py b/tests/test_authcookie.py index c53a448..a2dae16 100755 --- a/tests/test_authcookie.py +++ b/tests/test_authcookie.py @@ -11,7 +11,7 @@ try: except ImportError: import unittest -from M2Crypto import EVP, Rand, util +from M2Crypto import EVP, Rand, six, util from M2Crypto.AuthCookie import AuthCookie, AuthCookieJar, mix, unmix, unmix3 from M2Crypto.six.moves.http_cookies import SimpleCookie # pylint: disable=no-name-in-module,import-error @@ -58,7 +58,7 @@ class AuthCookieTestCase(unittest.TestCase): # Peek inside the cookie jar... key = self.jar._key # pylint: disable=protected-access mac = util.bin_to_hex( - EVP.hmac(key, util.py3bytes(mix(self.exp, self.data)), 'sha1')) + EVP.hmac(key, six.ensure_binary(mix(self.exp, self.data)), 'sha1')) self.assertEqual(c.mac(), mac) # Ok, stop peeking now. cookie_str = self._format % (self.exp, self.data, mac) @@ -111,7 +111,7 @@ class AuthCookieTestCase(unittest.TestCase): self.assertAlmostEqual(exp, self.exp, places=4) key = self.jar._key # pylint: disable=protected-access mac = util.bin_to_hex( - EVP.hmac(key, util.py3bytes(mix(self.exp, self.data)), 'sha1')) + EVP.hmac(key, six.ensure_binary(mix(self.exp, self.data)), 'sha1')) self.assertEqual(digest, mac) def test_cookie_str(self): |