diff options
Diffstat (limited to 'snaps/domain')
-rw-r--r-- | snaps/domain/test/vm_inst_tests.py | 6 | ||||
-rw-r--r-- | snaps/domain/vm_inst.py | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/snaps/domain/test/vm_inst_tests.py b/snaps/domain/test/vm_inst_tests.py index e722a06..c3de8ba 100644 --- a/snaps/domain/test/vm_inst_tests.py +++ b/snaps/domain/test/vm_inst_tests.py @@ -23,14 +23,16 @@ class VmInstDomainObjectTests(unittest.TestCase): """ def test_construction_positional(self): - vm_inst = VmInst('name', 'id') + vm_inst = VmInst('name', 'id', dict()) self.assertEqual('name', vm_inst.name) self.assertEqual('id', vm_inst.id) + self.assertEqual(dict(), vm_inst.networks) def test_construction_named(self): - vm_inst = VmInst(inst_id='id', name='name') + vm_inst = VmInst(networks=dict(), inst_id='id', name='name') self.assertEqual('name', vm_inst.name) self.assertEqual('id', vm_inst.id) + self.assertEqual(dict(), vm_inst.networks) class FloatingIpDomainObjectTests(unittest.TestCase): diff --git a/snaps/domain/vm_inst.py b/snaps/domain/vm_inst.py index 0e12d14..ae01cf0 100644 --- a/snaps/domain/vm_inst.py +++ b/snaps/domain/vm_inst.py @@ -19,14 +19,17 @@ class VmInst: SNAPS domain object for Images. Should contain attributes that are shared amongst cloud providers """ - def __init__(self, name, inst_id): + def __init__(self, name, inst_id, networks): """ Constructor :param name: the image's name :param inst_id: the instance's id + :param networks: dict of networks where the key is the subnet name and + value is a list of associated IPs """ self.name = name self.id = inst_id + self.networks = networks class FloatingIp: |