5050 },
5151 "hostname" : INSTANCE_HOSTNAME ,
5252 "description" : INSTANCE_DESCRIPTION ,
53- "location " : INSTANCE_LOCATION ,
53+ "location_code " : INSTANCE_LOCATION ,
5454 "price_per_hour" : INSTANCE_PRICE_PER_HOUR ,
5555 "instance_type" : INSTANCE_TYPE ,
5656 "image" : INSTANCE_IMAGE ,
6363PAYLOAD_SPOT = PAYLOAD
6464PAYLOAD_SPOT [0 ]["is_spot" ] = True
6565
66+
6667class TestInstancesService :
6768 @pytest .fixture
6869 def instances_service (self , http_client ):
@@ -397,7 +398,8 @@ def test_action_successful(self, instances_service, endpoint):
397398 )
398399
399400 # act
400- result = instances_service .action (id_list = [INSTANCE_ID ], action = Actions .SHUTDOWN )
401+ result = instances_service .action (
402+ id_list = [INSTANCE_ID ], action = Actions .SHUTDOWN )
401403
402404 # assert
403405 assert result is None
@@ -415,7 +417,8 @@ def test_action_failed(self, instances_service, endpoint):
415417
416418 # act
417419 with pytest .raises (APIException ) as excinfo :
418- instances_service .action (id_list = [INSTANCE_ID ], action = "fluxturcate" )
420+ instances_service .action (
421+ id_list = [INSTANCE_ID ], action = "fluxturcate" )
419422
420423 # assert
421424 assert excinfo .value .code == INVALID_REQUEST
@@ -424,7 +427,8 @@ def test_action_failed(self, instances_service, endpoint):
424427
425428 def test_is_available_successful (self , instances_service ):
426429 # arrange - add response mock
427- url = instances_service ._http_client ._base_url + '/instance-availability/' + INSTANCE_TYPE
430+ url = instances_service ._http_client ._base_url + \
431+ '/instance-availability/' + INSTANCE_TYPE
428432 responses .add (
429433 responses .GET ,
430434 url ,
@@ -441,7 +445,8 @@ def test_is_available_successful(self, instances_service):
441445
442446 def test_is_spot_available_successful (self , instances_service ):
443447 # arrange - add response mock
444- url = instances_service ._http_client ._base_url + '/instance-availability/' + INSTANCE_TYPE + '?isSpot=true'
448+ url = instances_service ._http_client ._base_url + \
449+ '/instance-availability/' + INSTANCE_TYPE + '?isSpot=true'
445450 responses .add (
446451 responses .GET ,
447452 url ,
@@ -450,7 +455,8 @@ def test_is_spot_available_successful(self, instances_service):
450455 )
451456
452457 # act
453- is_available = instances_service .is_available (INSTANCE_TYPE , is_spot = True )
458+ is_available = instances_service .is_available (
459+ INSTANCE_TYPE , is_spot = True )
454460
455461 # assert
456462 assert is_available is True
@@ -473,4 +479,4 @@ def test_is_available_failed(self, instances_service):
473479 # assert
474480 assert excinfo .value .code == INVALID_REQUEST
475481 assert excinfo .value .message == INVALID_REQUEST_MESSAGE
476- assert responses .assert_call_count (url , 1 ) is True
482+ assert responses .assert_call_count (url , 1 ) is True
0 commit comments