[Kimchi-devel] [PATCH 3/3] Fix issue #339: Change mock and add test to check persistent variable

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Fri Mar 7 00:15:32 UTC 2014


This patch fixes the problems in the tests due to the inclusion of new
persistent variable in pools information. It also adds a minor test.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 src/kimchi/mockmodel.py | 3 ++-
 tests/test_rest.py      | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py
index 4ad6a30..4ead84b 100644
--- a/src/kimchi/mockmodel.py
+++ b/src/kimchi/mockmodel.py
@@ -959,7 +959,8 @@ class MockStoragePool(object):
                      'source': {},
                      'type': 'dir',
                      'nr_volumes': 0,
-                     'autostart': 0}
+                     'autostart': 0,
+                     'persistent': True}
         self._volumes = {}
 
     def refresh(self):
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 863fe80..17bd253 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -783,6 +783,9 @@ class RestTests(unittest.TestCase):
         else:
             self.assertEquals(False, storagepool['autostart'])
 
+        # Test if storage pool is persistent
+        self.assertEquals(True, storagepool['persistent'])
+
         # activate the storage pool
         resp = self.request('/storagepools/test-pool/activate', '{}', 'POST')
         storagepool = json.loads(
-- 
1.8.5.3




More information about the Kimchi-devel mailing list