fix!: drop support for Python 2.7 (#778)
Drop use of 'six' wrapper library.
Drop 'u"' prefixes.
Drop support for app_engine 'classic' mode (Python 2.7-only).
Release-As: 2.0.0b1
Closes #777.
diff --git a/tests/crypt/test__cryptography_rsa.py b/tests/crypt/test__cryptography_rsa.py
index dbf07c7..41dfc36 100644
--- a/tests/crypt/test__cryptography_rsa.py
+++ b/tests/crypt/test__cryptography_rsa.py
@@ -60,7 +60,7 @@
class TestRSAVerifier(object):
- def test_verify_success(self):
+ def test_verify_bytes_success(self):
to_sign = b"foo"
signer = _cryptography_rsa.RSASigner.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)
@@ -68,8 +68,8 @@
verifier = _cryptography_rsa.RSAVerifier.from_string(PUBLIC_KEY_BYTES)
assert verifier.verify(to_sign, actual_signature)
- def test_verify_unicode_success(self):
- to_sign = u"foo"
+ def test_verify_text_success(self):
+ to_sign = "foo"
signer = _cryptography_rsa.RSASigner.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)
diff --git a/tests/crypt/test__python_rsa.py b/tests/crypt/test__python_rsa.py
index 886ee55..9ef29ee 100644
--- a/tests/crypt/test__python_rsa.py
+++ b/tests/crypt/test__python_rsa.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import io
import json
import os
@@ -19,7 +20,6 @@
from pyasn1_modules import pem
import pytest
import rsa
-import six
from google.auth import _helpers
from google.auth.crypt import _python_rsa
@@ -63,7 +63,7 @@
class TestRSAVerifier(object):
- def test_verify_success(self):
+ def test_verify_bytes_success(self):
to_sign = b"foo"
signer = _python_rsa.RSASigner.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)
@@ -71,8 +71,8 @@
verifier = _python_rsa.RSAVerifier.from_string(PUBLIC_KEY_BYTES)
assert verifier.verify(to_sign, actual_signature)
- def test_verify_unicode_success(self):
- to_sign = u"foo"
+ def test_verify_text_success(self):
+ to_sign = "foo"
signer = _python_rsa.RSASigner.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)
@@ -141,7 +141,7 @@
def test_from_string_pkcs8_extra_bytes(self):
key_bytes = PKCS8_KEY_BYTES
_, pem_bytes = pem.readPemBlocksFromFile(
- six.StringIO(_helpers.from_bytes(key_bytes)), _python_rsa._PKCS8_MARKER
+ io.StringIO(_helpers.from_bytes(key_bytes)), _python_rsa._PKCS8_MARKER
)
key_info, remaining = None, "extra"
diff --git a/tests/crypt/test_es256.py b/tests/crypt/test_es256.py
index 5bb9050..720f74c 100644
--- a/tests/crypt/test_es256.py
+++ b/tests/crypt/test_es256.py
@@ -50,7 +50,7 @@
class TestES256Verifier(object):
- def test_verify_success(self):
+ def test_verify_bytes_success(self):
to_sign = b"foo"
signer = es256.ES256Signer.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)
@@ -58,8 +58,8 @@
verifier = es256.ES256Verifier.from_string(PUBLIC_KEY_BYTES)
assert verifier.verify(to_sign, actual_signature)
- def test_verify_unicode_success(self):
- to_sign = u"foo"
+ def test_verify_text_success(self):
+ to_sign = "foo"
signer = es256.ES256Signer.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)