summaryrefslogtreecommitdiff
path: root/test/varlink/test_images.py
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-26 09:39:14 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-04-23 14:29:45 +0000
commit8493dba23c73617d9529b7ca13b400d50ac6f455 (patch)
treec0de0c67334b9fa7166e01cae95dc560c1e2455a /test/varlink/test_images.py
parentcf1d884ffa45b342f38a78189bbd86186ce6cbfe (diff)
downloadpodman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.gz
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.tar.bz2
podman-8493dba23c73617d9529b7ca13b400d50ac6f455.zip
Initial varlink implementation
Signed-off-by: baude <bbaude@redhat.com> Closes: #627 Approved by: mheon
Diffstat (limited to 'test/varlink/test_images.py')
-rw-r--r--test/varlink/test_images.py71
1 files changed, 71 insertions, 0 deletions
diff --git a/test/varlink/test_images.py b/test/varlink/test_images.py
new file mode 100644
index 000000000..ef1ab1088
--- /dev/null
+++ b/test/varlink/test_images.py
@@ -0,0 +1,71 @@
+import unittest
+from varlink import (Client, VarlinkError)
+
+
+address = "unix:/run/podman/io.projectatomic.podman"
+client = Client(address=address)
+
+
+def runErrorTest(tfunc):
+ try:
+ tfunc()
+ except VarlinkError as e:
+ return e.error() == "org.varlink.service.MethodNotImplemented"
+ return False
+
+
+class ImagesAPI(unittest.TestCase):
+ def test_ListImages(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.ListImages))
+
+ def test_BuildImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.BuildImage))
+
+ def test_CreateImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.CreateImage))
+
+ def test_InspectImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.InspectImage))
+
+ def test_HistoryImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.HistoryImage))
+
+ def test_PushImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.PushImage))
+
+ def test_TagImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.TagImage))
+
+ def test_RemoveImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.TagImage))
+
+ def test_SearchImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.SearchImage))
+
+ def test_DeleteUnusedImages(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.DeleteUnusedImages))
+
+ def test_CreateFromContainer(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.CreateFromContainer))
+
+ def test_ImportImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.ImportImage))
+
+ def test_ExportImage(self):
+ podman = client.open("io.projectatomic.podman")
+ self.assertTrue(runErrorTest(podman.ExportImage))
+
+if __name__ == '__main__':
+ unittest.main()