diff options
author | Jhon Honce <jhonce@redhat.com> | 2018-04-24 18:42:59 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-27 14:11:13 +0000 |
commit | 32db403b5e4fdb96e727e8cda3922d235ad63aa4 (patch) | |
tree | e8a397d1c221a4c9cc1a66ffa9b7742c4474b5cb /test/varlink/test_system.py | |
parent | 37619de39abea9f6802b0f42e2be7dd142c516ed (diff) | |
download | podman-32db403b5e4fdb96e727e8cda3922d235ad63aa4.tar.gz podman-32db403b5e4fdb96e727e8cda3922d235ad63aa4.tar.bz2 podman-32db403b5e4fdb96e727e8cda3922d235ad63aa4.zip |
Refactor unittest for varlink component
- Allow unittest's to run as normal user
- Refactor tests to use unittest features
- Refactor tests to use fixtures to track resources
- Update test runner script to clean up on failure
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Closes: #683
Approved by: rhatdan
Diffstat (limited to 'test/varlink/test_system.py')
-rw-r--r-- | test/varlink/test_system.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/test/varlink/test_system.py b/test/varlink/test_system.py index 6180d2068..00848de2b 100644 --- a/test/varlink/test_system.py +++ b/test/varlink/test_system.py @@ -1,21 +1,19 @@ import unittest -from varlink import (Client, VarlinkError) +from podman_testcase import PodmanTestCase -address = "unix:/run/podman/io.projectatomic.podman" -client = Client(address=address) -class SystemAPI(unittest.TestCase): +class TestSystemAPI(PodmanTestCase): def test_ping(self): - podman = client.open("io.projectatomic.podman") - response = podman.Ping() - self.assertEqual("OK", response["ping"]["message"]) + response = self.podman.Ping() + self.assertEqual('OK', response['ping']['message']) def test_GetVersion(self): - podman = client.open("io.projectatomic.podman") - response = podman.GetVersion() - for k in ["version", "go_version", "built", "os_arch"]: - self.assertTrue(k in response["version"].keys()) + response = self.podman.GetVersion() + self.assertTrue(set( + ['version', 'go_version', 'built', 'os_arch'] + ).issubset(response['version'].keys())) + if __name__ == '__main__': unittest.main() |