[Kimchi-devel] [PATCH] [Kimchi 3/3] Issue #924: Update test case with new storage pool field
Jose Ricardo Ziviani
joserz at linux.vnet.ibm.com
Fri Apr 15 22:43:44 UTC 2016
Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
mockmodel.py | 4 ++++
tests/test_model_storagepool.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/mockmodel.py b/mockmodel.py
index c3c6930..142e81f 100644
--- a/mockmodel.py
+++ b/mockmodel.py
@@ -125,6 +125,7 @@ class MockModel(Model):
DevicesModel.get_list = self._mock_devices_get_list
StoragePoolsModel._check_lvm = self._check_lvm
StoragePoolModel._update_lvm_disks = self._update_lvm_disks
+ StoragePoolModel._pool_used_by_template = self._pool_used_by_template
StorageVolumesModel.get_list = self._mock_storagevolumes_get_list
StorageVolumeModel.doUpload = self._mock_storagevolume_doUpload
LibvirtVMTemplate._get_volume_path = self._get_volume_path
@@ -260,6 +261,9 @@ class MockModel(Model):
# do not do any verification while using MockModel
pass
+ def _pool_used_by_template(self, pool_name):
+ return False
+
def _update_lvm_disks(self, pool_name, disks):
conn = self.conn.get()
pool = conn.storagePoolLookupByName(pool_name.encode('utf-8'))
diff --git a/tests/test_model_storagepool.py b/tests/test_model_storagepool.py
index 4ff5aa1..276b8a5 100644
--- a/tests/test_model_storagepool.py
+++ b/tests/test_model_storagepool.py
@@ -95,7 +95,7 @@ class StoragepoolTests(unittest.TestCase):
p = json.loads(resp.read())
keys = [u'name', u'state', u'capacity', u'allocated',
u'available', u'path', u'source', u'type',
- u'nr_volumes', u'autostart', u'persistent']
+ u'nr_volumes', u'autostart', u'persistent', 'in_use']
self.assertEquals(sorted(keys), sorted(p.keys()))
self.assertEquals(name, p['name'])
self.assertEquals('inactive', p['state'])
--
1.9.1
More information about the Kimchi-devel
mailing list