fix: add back python 2.7 for gcloud usage only (#892)
* fix: add back python 2.7 for gcloud
* fix: fix setup and tests
* fix: add enum34 for python 2.7
* fix: add app engine app and fix noxfile
* fix: move test_app_engine.py
* fix: fix downscoped
* fix: fix downscoped
* fix: remove py2 from classifiers
diff --git a/tests/crypt/test__cryptography_rsa.py b/tests/crypt/test__cryptography_rsa.py
index 41dfc36..dbf07c7 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_bytes_success(self):
+ def test_verify_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_text_success(self):
- to_sign = "foo"
+ def test_verify_unicode_success(self):
+ to_sign = u"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 9ef29ee..886ee55 100644
--- a/tests/crypt/test__python_rsa.py
+++ b/tests/crypt/test__python_rsa.py
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import io
import json
import os
@@ -20,6 +19,7 @@
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_bytes_success(self):
+ def test_verify_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_text_success(self):
- to_sign = "foo"
+ def test_verify_unicode_success(self):
+ to_sign = u"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(
- io.StringIO(_helpers.from_bytes(key_bytes)), _python_rsa._PKCS8_MARKER
+ six.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 720f74c..5bb9050 100644
--- a/tests/crypt/test_es256.py
+++ b/tests/crypt/test_es256.py
@@ -50,7 +50,7 @@
class TestES256Verifier(object):
- def test_verify_bytes_success(self):
+ def test_verify_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_text_success(self):
- to_sign = "foo"
+ def test_verify_unicode_success(self):
+ to_sign = u"foo"
signer = es256.ES256Signer.from_string(PRIVATE_KEY_BYTES)
actual_signature = signer.sign(to_sign)