70
70
STACK_QUERY_PARAMETERS ,
71
71
V1_DISCOVERY_URI ,
72
72
V2_DISCOVERY_URI ,
73
- ResourceMethodParameters ,
74
73
APICoreVersionError ,
74
+ ResourceMethodParameters ,
75
75
_fix_up_media_path_base_url ,
76
76
_fix_up_media_upload ,
77
77
_fix_up_method_description ,
@@ -543,6 +543,7 @@ def test_credentials_and_credentials_file_mutually_exclusive(self):
543
543
class DiscoveryFromDocument (unittest .TestCase ):
544
544
MOCK_CREDENTIALS = mock .Mock (spec = google .auth .credentials .Credentials )
545
545
MOCK_CREDENTIALS .universe_domain = None
546
+
546
547
def test_can_build_from_local_document (self ):
547
548
discovery = read_datafile ("plus.json" )
548
549
plus = build_from_document (
@@ -2347,9 +2348,9 @@ def test_get_media(self):
2347
2348
self .assertEqual (b"standing in for media" , response )
2348
2349
2349
2350
2350
-
2351
2351
class Universe (unittest .TestCase ):
2352
2352
if HAS_UNIVERSE :
2353
+
2353
2354
def test_validate_credentials_with_no_client_options (self ):
2354
2355
http = build_http ()
2355
2356
discovery = read_datafile ("zoo.json" )
@@ -2671,7 +2672,7 @@ def test_universe_env_var_configured_with_client_options_universe(self):
2671
2672
)
2672
2673
2673
2674
assert tasks ._universe_domain == fake_universe
2674
-
2675
+
2675
2676
def test_client_options_universe_with_older_version_of_api_core (self ):
2676
2677
fake_universe = "foo.com"
2677
2678
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
@@ -2686,7 +2687,6 @@ def test_client_options_universe_with_older_version_of_api_core(self):
2686
2687
),
2687
2688
)
2688
2689
2689
-
2690
2690
def test_credentials_universe_with_older_version_of_api_core (self ):
2691
2691
fake_universe = "foo.com"
2692
2692
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
@@ -2697,7 +2697,7 @@ def test_credentials_universe_with_older_version_of_api_core(self):
2697
2697
discovery ,
2698
2698
credentials = credentials ,
2699
2699
)
2700
-
2700
+
2701
2701
def test_credentials_default_universe_with_older_version_of_api_core (self ):
2702
2702
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
2703
2703
credentials .universe_domain = "googleapis.com"
@@ -2706,29 +2706,29 @@ def test_credentials_default_universe_with_older_version_of_api_core(self):
2706
2706
discovery ,
2707
2707
credentials = credentials ,
2708
2708
)
2709
-
2709
+
2710
2710
def test_http_credentials_universe_with_older_version_of_api_core (self ):
2711
2711
fake_universe = "foo.com"
2712
2712
http = google_auth_httplib2 .AuthorizedHttp (
2713
- credentials = mock .Mock (universe_domain = fake_universe ), http = build_http ()
2714
- )
2713
+ credentials = mock .Mock (universe_domain = fake_universe ), http = build_http ()
2714
+ )
2715
2715
discovery = read_datafile ("tasks.json" )
2716
2716
with self .assertRaises (APICoreVersionError ):
2717
2717
tasks = build_from_document (
2718
2718
discovery ,
2719
2719
http = http ,
2720
2720
)
2721
-
2721
+
2722
2722
def test_http_credentials_default_universe_with_older_version_of_api_core (self ):
2723
2723
http = google_auth_httplib2 .AuthorizedHttp (
2724
- credentials = mock .Mock (universe_domain = "googleapis.com" ), http = build_http ()
2725
- )
2724
+ credentials = mock .Mock (universe_domain = "googleapis.com" ), http = build_http ()
2725
+ )
2726
2726
discovery = read_datafile ("tasks.json" )
2727
2727
tasks = build_from_document (
2728
2728
discovery ,
2729
2729
http = http ,
2730
2730
)
2731
-
2731
+
2732
2732
2733
2733
if __name__ == "__main__" :
2734
2734
unittest .main ()
0 commit comments