tosca image tests
diff --git a/xos/tosca/tests/alltests.py b/xos/tosca/tests/alltests.py
index 5731ddd..0ce55c4 100644
--- a/xos/tosca/tests/alltests.py
+++ b/xos/tosca/tests/alltests.py
@@ -9,6 +9,7 @@
from nodetest import NodeTest
from slicetest import SliceTest
from controllertest import ControllerTest
+from imagetest import ImageTest
if __name__ == "__main__":
SiteTest()
@@ -22,3 +23,4 @@
UserTest()
SliceTest()
ComputeTest()
+ ImageTest()
diff --git a/xos/tosca/tests/imagetest.py b/xos/tosca/tests/imagetest.py
new file mode 100644
index 0000000..d651027
--- /dev/null
+++ b/xos/tosca/tests/imagetest.py
@@ -0,0 +1,35 @@
+from basetest import BaseToscaTest
+
+from core.models import Image
+
+class ImageTest(BaseToscaTest):
+ tests = ["create_image_minimal",
+ "create_image_maximal",
+ "destroy_image",
+ ]
+
+ def cleanup(self):
+ self.try_to_delete(Image, name="testimg")
+
+ def create_image_minimal(self):
+ self.assert_noobj(Image, "testimg")
+ self.execute(self.make_nodetemplate("testimg", "tosca.nodes.Image"))
+ instance = self.assert_obj(Image, "testimg", disk_format="", container_format="", path=None)
+
+ def create_image_maximal(self):
+ self.assert_noobj(Image, "testimg")
+ self.execute(self.make_nodetemplate("testimg", "tosca.nodes.Image",
+ props={"disk_format": "a", "container_format": "b", "path": "c"}))
+ instance = self.assert_obj(Image, "testimg", disk_format="a", container_format="b", path="c")
+
+ def destroy_image(self):
+ self.assert_noobj(Image, "testimg")
+ self.execute(self.make_nodetemplate("testimg", "tosca.nodes.Image"))
+ instance = self.assert_obj(Image, "testimg", disk_format="", container_format="", path=None)
+ self.destroy(self.make_nodetemplate("testimg", "tosca.nodes.Image"))
+ self.assert_noobj(Image, "testimg")
+
+if __name__ == "__main__":
+ ImageTest()
+
+