Skip to content

Commit 49b7903

Browse files
committed
fix test name and test creation of volume from args
1 parent f795b39 commit 49b7903

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

datacrunch/volumes/volumes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def __init__(self,
4646
:param ssh_key_ids: list of ssh keys ids
4747
:type ssh_key_ids: List[str]
4848
"""
49-
5049
self._id = id
5150
self._status = status
5251
self._name = name

tests/unit_tests/volumes/test_volumes.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,23 @@ def volumes_service(self, http_client):
7272
def endpoint(self, http_client):
7373
return http_client._base_url + "/volumes"
7474

75-
def test_get_instances(self, volumes_service, endpoint):
75+
def test_initialize_a_volume_object_from_arguments(self):
76+
volume = Volume(id=RANDOM_VOL_ID, status=VolumeStatus.DETACHED, instance_id=None, name=HDD_VOL_NAME, size=HDD_VOL_SIZE,
77+
type=HDD, location=FIN1, is_os_volume=False, created_at=HDD_VOL_CREATED_AT, target=None, ssh_key_ids=[])
78+
79+
assert volume.id == RANDOM_VOL_ID
80+
assert volume.status == VolumeStatus.DETACHED
81+
assert volume.instance_id == None
82+
assert volume.name == HDD_VOL_NAME
83+
assert volume.size == HDD_VOL_SIZE
84+
assert volume.type == HDD
85+
assert volume.location == FIN1
86+
assert volume.is_os_volume == False
87+
assert volume.created_at == HDD_VOL_CREATED_AT
88+
assert volume.target == None
89+
assert volume.ssh_key_ids == []
90+
91+
def test_get_volumes(self, volumes_service, endpoint):
7692
# arrange - add response mock
7793
responses.add(
7894
responses.GET,

0 commit comments

Comments
 (0)