Skip to content

Commit e3c7566

Browse files
1 parent b73ecfd commit e3c7566

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

googleapiclient/discovery.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,15 @@
130130
STACK_QUERY_PARAMETERS = frozenset(["trace", "pp", "userip", "strict"])
131131
STACK_QUERY_PARAMETER_DEFAULT_VALUE = {"type": "string", "location": "query"}
132132

133+
133134
class APICoreVersionError(ValueError):
134135
def __init__(self):
135-
message = "google-api-core >= 2.18.0 is required to use the universe domain feature."
136+
message = (
137+
"google-api-core >= 2.18.0 is required to use the universe domain feature."
138+
)
136139
super().__init__(message)
137140

141+
138142
# Library-specific reserved words beyond Python keywords.
139143
RESERVED_WORDS = frozenset(["body"])
140144

@@ -627,7 +631,7 @@ def build_from_document(
627631
):
628632
credentials = credentials.with_always_use_jwt_access(always_use_jwt_access)
629633
credentials._create_self_signed_jwt(audience_for_self_signed_jwt)
630-
634+
631635
# If credentials are provided, create an authorized http instance;
632636
# otherwise, skip authentication.
633637
if credentials:

tests/test_discovery.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
STACK_QUERY_PARAMETERS,
7171
V1_DISCOVERY_URI,
7272
V2_DISCOVERY_URI,
73-
ResourceMethodParameters,
7473
APICoreVersionError,
74+
ResourceMethodParameters,
7575
_fix_up_media_path_base_url,
7676
_fix_up_media_upload,
7777
_fix_up_method_description,
@@ -543,6 +543,7 @@ def test_credentials_and_credentials_file_mutually_exclusive(self):
543543
class DiscoveryFromDocument(unittest.TestCase):
544544
MOCK_CREDENTIALS = mock.Mock(spec=google.auth.credentials.Credentials)
545545
MOCK_CREDENTIALS.universe_domain = None
546+
546547
def test_can_build_from_local_document(self):
547548
discovery = read_datafile("plus.json")
548549
plus = build_from_document(
@@ -2347,9 +2348,9 @@ def test_get_media(self):
23472348
self.assertEqual(b"standing in for media", response)
23482349

23492350

2350-
23512351
class Universe(unittest.TestCase):
23522352
if HAS_UNIVERSE:
2353+
23532354
def test_validate_credentials_with_no_client_options(self):
23542355
http = build_http()
23552356
discovery = read_datafile("zoo.json")
@@ -2671,7 +2672,7 @@ def test_universe_env_var_configured_with_client_options_universe(self):
26712672
)
26722673

26732674
assert tasks._universe_domain == fake_universe
2674-
2675+
26752676
def test_client_options_universe_with_older_version_of_api_core(self):
26762677
fake_universe = "foo.com"
26772678
credentials = mock.Mock(spec=google.auth.credentials.Credentials)
@@ -2686,7 +2687,6 @@ def test_client_options_universe_with_older_version_of_api_core(self):
26862687
),
26872688
)
26882689

2689-
26902690
def test_credentials_universe_with_older_version_of_api_core(self):
26912691
fake_universe = "foo.com"
26922692
credentials = mock.Mock(spec=google.auth.credentials.Credentials)
@@ -2697,7 +2697,7 @@ def test_credentials_universe_with_older_version_of_api_core(self):
26972697
discovery,
26982698
credentials=credentials,
26992699
)
2700-
2700+
27012701

27022702
if __name__ == "__main__":
27032703
unittest.main()

0 commit comments

Comments
 (0)