summaryrefslogtreecommitdiffstats
path: root/snaps/domain/test/volume_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'snaps/domain/test/volume_tests.py')
-rw-r--r--snaps/domain/test/volume_tests.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/snaps/domain/test/volume_tests.py b/snaps/domain/test/volume_tests.py
index fa0a95a..6feadc9 100644
--- a/snaps/domain/test/volume_tests.py
+++ b/snaps/domain/test/volume_tests.py
@@ -25,7 +25,7 @@ class VolumeDomainObjectTests(unittest.TestCase):
def test_construction_positional(self):
volume = Volume('name1', 'id1', 'desc_val1', 2, 'type_val1',
- 'avail_zone1', False)
+ 'avail_zone1', False, [{'attached_at': 'foo'}])
self.assertEqual('name1', volume.name)
self.assertEqual('id1', volume.id)
self.assertEqual('desc_val1', volume.description)
@@ -33,9 +33,13 @@ class VolumeDomainObjectTests(unittest.TestCase):
self.assertEqual('type_val1', volume.type)
self.assertEqual('avail_zone1', volume.availability_zone)
self.assertFalse(volume.multi_attach)
+ self.assertIsNotNone(volume.attachments)
+ self.assertTrue(isinstance(volume.attachments[0], dict))
+ self.assertEqual(1, len(volume.attachments))
def test_construction_named(self):
- volume = Volume(multi_attach=True, availability_zone='avail_zone2',
+ volume = Volume(attachments=[{'attached_at': 'foo'}],
+ multi_attach=True, availability_zone='avail_zone2',
vol_type='type_val2', size=3, description='desc_val2',
volume_id='id2', name='name2')
self.assertEqual('name2', volume.name)
@@ -45,6 +49,9 @@ class VolumeDomainObjectTests(unittest.TestCase):
self.assertEqual('type_val2', volume.type)
self.assertEqual('avail_zone2', volume.availability_zone)
self.assertTrue(volume.multi_attach)
+ self.assertIsNotNone(volume.attachments)
+ self.assertTrue(isinstance(volume.attachments[0], dict))
+ self.assertEqual(1, len(volume.attachments))
class VolumeTypeDomainObjectTests(unittest.TestCase):