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,9 @@ def test_universe_env_var_configured_with_client_options_universe(self):
2671
2672
)
2672
2673
2673
2674
assert tasks ._universe_domain == fake_universe
2675
+
2674
2676
else :
2677
+
2675
2678
def test_client_options_universe_with_older_version_of_api_core (self ):
2676
2679
fake_universe = "foo.com"
2677
2680
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
@@ -2686,7 +2689,6 @@ def test_client_options_universe_with_older_version_of_api_core(self):
2686
2689
),
2687
2690
)
2688
2691
2689
-
2690
2692
def test_credentials_universe_with_older_version_of_api_core (self ):
2691
2693
fake_universe = "foo.com"
2692
2694
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
@@ -2697,7 +2699,7 @@ def test_credentials_universe_with_older_version_of_api_core(self):
2697
2699
discovery ,
2698
2700
credentials = credentials ,
2699
2701
)
2700
-
2702
+
2701
2703
def test_credentials_default_universe_with_older_version_of_api_core (self ):
2702
2704
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
2703
2705
credentials .universe_domain = "googleapis.com"
@@ -2706,29 +2708,30 @@ def test_credentials_default_universe_with_older_version_of_api_core(self):
2706
2708
discovery ,
2707
2709
credentials = credentials ,
2708
2710
)
2709
-
2711
+
2710
2712
def test_http_credentials_universe_with_older_version_of_api_core (self ):
2711
2713
fake_universe = "foo.com"
2712
2714
http = google_auth_httplib2 .AuthorizedHttp (
2713
- credentials = mock .Mock (universe_domain = fake_universe ), http = build_http ()
2714
- )
2715
+ credentials = mock .Mock (universe_domain = fake_universe ), http = build_http ()
2716
+ )
2715
2717
discovery = read_datafile ("tasks.json" )
2716
2718
with self .assertRaises (APICoreVersionError ):
2717
2719
tasks = build_from_document (
2718
2720
discovery ,
2719
2721
http = http ,
2720
2722
)
2721
-
2723
+
2722
2724
def test_http_credentials_default_universe_with_older_version_of_api_core (self ):
2723
2725
http = google_auth_httplib2 .AuthorizedHttp (
2724
- credentials = mock .Mock (universe_domain = "googleapis.com" ), http = build_http ()
2725
- )
2726
+ credentials = mock .Mock (universe_domain = "googleapis.com" ),
2727
+ http = build_http (),
2728
+ )
2726
2729
discovery = read_datafile ("tasks.json" )
2727
2730
tasks = build_from_document (
2728
2731
discovery ,
2729
2732
http = http ,
2730
2733
)
2731
-
2734
+
2732
2735
2733
2736
if __name__ == "__main__" :
2734
2737
unittest .main ()
0 commit comments