Skip to content

Commit 17d524a

Browse files
committed
test __str__ methods
1 parent f8c2215 commit 17d524a

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

tests/unit_tests/images/test_images.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ def test_images(http_client):
3636
assert images[0].image_type == 'ubuntu-20.04-cuda-11.0'
3737
assert type(images[0].details) == list
3838
assert images[0].details[0] == "Ubuntu 20.04"
39-
assert images[0].details[1] == "CUDA 11.0"
39+
assert images[0].details[1] == "CUDA 11.0"
40+
assert type(images[0].__str__()) == str
41+

tests/unit_tests/instances/test_instances.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def test_create_instance_successful(self, instances_service, endpoint):
262262
assert type(instance.storage) == dict
263263
assert responses.assert_call_count(endpoint, 1) is True
264264
assert responses.assert_call_count(url, 1) is True
265+
assert type(instance.__str__()) == str
265266

266267
def test_create_spot_instance_successful(self, instances_service, endpoint):
267268
# arrange - add response mock
@@ -421,7 +422,7 @@ def test_action_failed(self, instances_service, endpoint):
421422
assert excinfo.value.message == INVALID_REQUEST_MESSAGE
422423
assert responses.assert_call_count(url, 1) is True
423424

424-
def test_is_available_successful(self, instances_service, endpoint):
425+
def test_is_available_successful(self, instances_service):
425426
# arrange - add response mock
426427
url = instances_service._http_client._base_url + '/instance-availability/' + INSTANCE_TYPE
427428
responses.add(
@@ -438,7 +439,7 @@ def test_is_available_successful(self, instances_service, endpoint):
438439
assert is_available is True
439440
assert responses.assert_call_count(url, 1) is True
440441

441-
def test_is_available_failed(self, instances_service, endpoint):
442+
def test_is_available_failed(self, instances_service):
442443
# arrange - add response mock
443444
url = instances_service._http_client._base_url + '/instance-availability/x'
444445
responses.add(
@@ -455,4 +456,4 @@ def test_is_available_failed(self, instances_service, endpoint):
455456
# assert
456457
assert excinfo.value.code == INVALID_REQUEST
457458
assert excinfo.value.message == INVALID_REQUEST_MESSAGE
458-
assert responses.assert_call_count(url, 1) is True
459+
assert responses.assert_call_count(url, 1) is True

tests/unit_tests/volumes/test_volumes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def test_create_volume_successful(self, volumes_service, endpoint):
223223

224224
# assert
225225
assert volume.id == NVME_VOL_ID
226+
assert type(volume.__str__()) == str
226227

227228
def test_create_volume_failed(self, volumes_service, endpoint):
228229
# arrange - add response mock

0 commit comments

Comments
 (0)