@@ -2619,26 +2619,29 @@ def test_universe_env_var_configured_with_mtls(self):
2619
2619
2620
2620
with self .assertRaises (MutualTLSChannelError ):
2621
2621
with mock .patch .dict (
2622
- "os.environ" , {"GOOGLE_API_USE_MTLS_ENDPOINT" : "always" ,
2623
- "GOOGLE_CLOUD_UNIVERSE_DOMAIN" : fake_universe }
2622
+ "os.environ" ,
2623
+ {
2624
+ "GOOGLE_API_USE_MTLS_ENDPOINT" : "always" ,
2625
+ "GOOGLE_CLOUD_UNIVERSE_DOMAIN" : fake_universe ,
2626
+ },
2624
2627
):
2625
2628
tasks = build_from_document (discovery )
2626
-
2629
+
2627
2630
def test_universe_env_var_configured_with_api_override (self ):
2628
2631
fake_universe = "foo.com"
2629
2632
fake_api_endpoint = "https://www.bar.com/"
2630
2633
credentials = mock .Mock (universe_domain = fake_universe )
2631
2634
discovery = read_datafile ("tasks.json" )
2632
2635
2633
2636
with mock .patch .dict (
2634
- "os.environ" , {"GOOGLE_CLOUD_UNIVERSE_DOMAIN" : fake_universe }
2635
- ):
2637
+ "os.environ" , {"GOOGLE_CLOUD_UNIVERSE_DOMAIN" : fake_universe }
2638
+ ):
2636
2639
tasks = build_from_document (
2637
2640
discovery ,
2638
2641
credentials = credentials ,
2639
2642
client_options = google .api_core .client_options .ClientOptions (
2640
- api_endpoint = fake_api_endpoint
2641
- ),
2643
+ api_endpoint = fake_api_endpoint
2644
+ ),
2642
2645
)
2643
2646
2644
2647
assert tasks ._baseUrl == fake_api_endpoint
@@ -2650,8 +2653,8 @@ def test_universe_env_var_configured_with_client_options_universe(self):
2650
2653
discovery = read_datafile ("tasks.json" )
2651
2654
2652
2655
with mock .patch .dict (
2653
- "os.environ" , {"GOOGLE_CLOUD_UNIVERSE_DOMAIN" : another_fake_universe }
2654
- ):
2656
+ "os.environ" , {"GOOGLE_CLOUD_UNIVERSE_DOMAIN" : another_fake_universe }
2657
+ ):
2655
2658
tasks = build_from_document (
2656
2659
discovery ,
2657
2660
credentials = credentials ,
@@ -2662,5 +2665,6 @@ def test_universe_env_var_configured_with_client_options_universe(self):
2662
2665
2663
2666
assert tasks ._universe_domain == fake_universe
2664
2667
2668
+
2665
2669
if __name__ == "__main__" :
2666
2670
unittest .main ()
0 commit comments