@@ -243,7 +243,7 @@ def test_fix_up_parameters_optional_body(self):
243
243
dummy_schema = {"Request" : {"properties" : {}}}
244
244
method_desc = {"request" : {"$ref" : "Request" }}
245
245
246
- parameters = _fix_up_parameters (method_desc , {}, "POST" , dummy_schema )
246
+ _fix_up_parameters (method_desc , {}, "POST" , dummy_schema )
247
247
248
248
def _base_fix_up_method_description_test (
249
249
self ,
@@ -440,22 +440,22 @@ def test_ResourceMethodParameters_zoo_animals_patch(self):
440
440
class Discovery (unittest .TestCase ):
441
441
def test_discovery_http_is_closed (self ):
442
442
http = HttpMock (datafile ("malformed.json" ), {"status" : "200" })
443
- service = build ("plus" , "v1" , credentials = mock .sentinel .credentials )
443
+ build ("plus" , "v1" , credentials = mock .sentinel .credentials )
444
444
http .close .assert_called_once ()
445
445
446
446
447
447
class DiscoveryErrors (unittest .TestCase ):
448
448
def test_tests_should_be_run_with_strict_positional_enforcement (self ):
449
449
try :
450
- plus = build ("plus" , "v1" , None , static_discovery = False )
450
+ build ("plus" , "v1" , None , static_discovery = False )
451
451
self .fail ("should have raised a TypeError exception over missing http=." )
452
452
except TypeError :
453
453
pass
454
454
455
455
def test_failed_to_parse_discovery_json (self ):
456
456
self .http = HttpMock (datafile ("malformed.json" ), {"status" : "200" })
457
457
try :
458
- plus = build (
458
+ build (
459
459
"plus" ,
460
460
"v1" ,
461
461
http = self .http ,
@@ -474,7 +474,7 @@ def test_unknown_api_name_or_version(self):
474
474
]
475
475
)
476
476
with self .assertRaises (UnknownApiNameOrVersion ):
477
- plus = build ("plus" , "v1" , http = http , cache_discovery = False )
477
+ build ("plus" , "v1" , http = http , cache_discovery = False )
478
478
479
479
def test_credentials_and_http_mutually_exclusive (self ):
480
480
http = HttpMock (datafile ("plus.json" ), {"status" : "200" })
@@ -603,7 +603,7 @@ def test_building_with_context_manager(self):
603
603
) as plus :
604
604
self .assertIsNotNone (plus )
605
605
self .assertTrue (hasattr (plus , "activities" ))
606
- plus . _http . http .close .assert_called_once ()
606
+ http .close .assert_called_once ()
607
607
608
608
def test_resource_close (self ):
609
609
discovery = read_datafile ("plus.json" )
@@ -668,7 +668,7 @@ def test_scopes_from_client_options(self):
668
668
discovery = read_datafile ("plus.json" )
669
669
670
670
with mock .patch ("googleapiclient._auth.default_credentials" ) as default :
671
- plus = build_from_document (
671
+ build_from_document (
672
672
discovery ,
673
673
client_options = {"scopes" : ["1" , "2" ]},
674
674
)
@@ -679,7 +679,7 @@ def test_quota_project_from_client_options(self):
679
679
discovery = read_datafile ("plus.json" )
680
680
681
681
with mock .patch ("googleapiclient._auth.default_credentials" ) as default :
682
- plus = build_from_document (
682
+ build_from_document (
683
683
discovery ,
684
684
client_options = google .api_core .client_options .ClientOptions (
685
685
quota_project_id = "my-project"
@@ -692,7 +692,7 @@ def test_credentials_file_from_client_options(self):
692
692
discovery = read_datafile ("plus.json" )
693
693
694
694
with mock .patch ("googleapiclient._auth.credentials_from_file" ) as default :
695
- plus = build_from_document (
695
+ build_from_document (
696
696
discovery ,
697
697
client_options = google .api_core .client_options .ClientOptions (
698
698
credentials_file = "credentials.json"
@@ -977,7 +977,7 @@ def test_userip_is_added_to_discovery_uri(self):
977
977
http = HttpMockSequence (
978
978
[({"status" : "400" }, read_datafile ("zoo.json" , "rb" ))]
979
979
)
980
- zoo = build (
980
+ build (
981
981
"zoo" ,
982
982
"v1" ,
983
983
http = http ,
@@ -995,7 +995,7 @@ def test_userip_missing_is_not_added_to_discovery_uri(self):
995
995
http = HttpMockSequence (
996
996
[({"status" : "400" }, read_datafile ("zoo.json" , "rb" ))]
997
997
)
998
- zoo = build (
998
+ build (
999
999
"zoo" ,
1000
1000
"v1" ,
1001
1001
http = http ,
@@ -1013,7 +1013,7 @@ def test_key_is_added_to_discovery_uri(self):
1013
1013
http = HttpMockSequence (
1014
1014
[({"status" : "400" }, read_datafile ("zoo.json" , "rb" ))]
1015
1015
)
1016
- zoo = build (
1016
+ build (
1017
1017
"zoo" ,
1018
1018
"v1" ,
1019
1019
http = http ,
@@ -1232,7 +1232,7 @@ def import_mock(name, *args, **kwargs):
1232
1232
1233
1233
self .mocked_api .memcache .get .return_value = None
1234
1234
1235
- plus = build ("plus" , "v1" , http = self .http , static_discovery = False )
1235
+ build ("plus" , "v1" , http = self .http , static_discovery = False )
1236
1236
1237
1237
# memcache.get is called once
1238
1238
url = "https://www.googleapis.com/discovery/v1/apis/plus/v1/rest"
@@ -1253,7 +1253,7 @@ def import_mock(name, *args, **kwargs):
1253
1253
# (Otherwise it should through an error)
1254
1254
self .http = HttpMock (None , {"status" : "200" })
1255
1255
1256
- plus = build ("plus" , "v1" , http = self .http , static_discovery = False )
1256
+ build ("plus" , "v1" , http = self .http , static_discovery = False )
1257
1257
1258
1258
# memcache.get is called twice
1259
1259
self .mocked_api .memcache .get .assert_has_calls (
@@ -1312,7 +1312,7 @@ def test_file_based_cache(self):
1312
1312
):
1313
1313
self .http = HttpMock (datafile ("plus.json" ), {"status" : "200" })
1314
1314
1315
- plus = build ("plus" , "v1" , http = self .http , static_discovery = False )
1315
+ build ("plus" , "v1" , http = self .http , static_discovery = False )
1316
1316
1317
1317
# cache.get is called once
1318
1318
url = "https://www.googleapis.com/discovery/v1/apis/plus/v1/rest"
@@ -1329,7 +1329,7 @@ def test_file_based_cache(self):
1329
1329
# (Otherwise it should through an error)
1330
1330
self .http = HttpMock (None , {"status" : "200" })
1331
1331
1332
- plus = build ("plus" , "v1" , http = self .http , static_discovery = False )
1332
+ build ("plus" , "v1" , http = self .http , static_discovery = False )
1333
1333
1334
1334
# cache.get is called twice
1335
1335
cache .get .assert_has_calls ([mock .call (url ), mock .call (url )])
@@ -1951,7 +1951,7 @@ def test_media_io_base_stream_chunksize_resume(self):
1951
1951
)
1952
1952
1953
1953
try :
1954
- body = request .execute (http = http )
1954
+ request .execute (http = http )
1955
1955
except HttpError as e :
1956
1956
self .assertEqual (b"01234" , e .content )
1957
1957
0 commit comments