Skip to content

Commit

Permalink
fix: fix downscoped
Browse files Browse the repository at this point in the history
  • Loading branch information
arithmetic1728 committed Oct 21, 2021
1 parent 3230103 commit 1fcfd71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
12 changes: 7 additions & 5 deletions google/auth/downscoped.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

import datetime

import six

from google.auth import _helpers
from google.auth import credentials
from google.oauth2 import sts
Expand Down Expand Up @@ -221,7 +223,7 @@ def available_resource(self, value):
Raises:
TypeError: If the value is not a string.
"""
if not isinstance(value, str):
if not isinstance(value, six.string_types):
raise TypeError("The provided available_resource is not a string.")
self._available_resource = value

Expand All @@ -247,7 +249,7 @@ def available_permissions(self, value):
ValueError: If the value is not valid.
"""
for available_permission in value:
if not isinstance(available_permission, str):
if not isinstance(available_permission, six.string_types):
raise TypeError(
"Provided available_permissions are not a list of strings."
)
Expand Down Expand Up @@ -350,7 +352,7 @@ def expression(self, value):
Raises:
TypeError: If the value is not of type string.
"""
if not isinstance(value, str):
if not isinstance(value, six.string_types):
raise TypeError("The provided expression is not a string.")
self._expression = value

Expand All @@ -373,7 +375,7 @@ def title(self, value):
Raises:
TypeError: If the value is not of type string or None.
"""
if not isinstance(value, str) and value is not None:
if not isinstance(value, six.string_types) and value is not None:
raise TypeError("The provided title is not a string or None.")
self._title = value

Expand All @@ -396,7 +398,7 @@ def description(self, value):
Raises:
TypeError: If the value is not of type string or None.
"""
if not isinstance(value, str) and value is not None:
if not isinstance(value, six.string_types) and value is not None:
raise TypeError("The provided description is not a string or None.")
self._description = value

Expand Down
24 changes: 4 additions & 20 deletions system_tests/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,8 @@ def mtls_http(session):
def external_accounts(session):
session.install(
*TEST_DEPENDENCIES_SYNC,
"google-auth",
LIBRARY_DIR,
"google-api-python-client",
"enum34",
)
default(
session,
Expand All @@ -394,26 +393,11 @@ def external_accounts(session):
)


@nox.session(python=["2.7"])
def downscoping_27(session):
session.install(
*TEST_DEPENDENCIES_SYNC,
"enum34",
"google-auth",
"google-cloud-storage",
)
default(
session,
"system_tests_sync/test_downscoping.py",
*session.posargs,
)


@nox.session(python=["3.7"])
def downscoping_37(session):
@nox.session(python=PYTHON_VERSIONS_SYNC)
def downscoping(session):
session.install(
*TEST_DEPENDENCIES_SYNC,
"google-auth",
LIBRARY_DIR,
"google-cloud-storage",
)
default(
Expand Down

0 comments on commit 1fcfd71

Please sign in to comment.