Files
podman/test/python/docker/compat/test_system.py
Jhon Honce 7729afe979 Refactor docker-py compatibility tests
* Add which python client is being used to run tests, see "python
  client" below.
* Remove redundate code from test classes
* Update/Add comments to modules and classes

======================================================= test session starts ========================================================
platform linux -- Python 3.10.0, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
python client -- DockerClient
rootdir: /home/jhonce/Projects/go/src/github.com/containers/podman
plugins: requests-mock-1.8.0
collected 33 items

test/python/docker/compat/test_containers.py ...s..............  [ 54%]
test/python/docker/compat/test_images.py ............  [ 90%]
test/python/docker/compat/test_system.py ...  [100%]

Note: Follow-up PRs will verify the test results and expand the tests.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-03-01 09:06:52 -07:00

33 lines
1.1 KiB
Python

"""
Integration tests for exercising docker-py against Podman Service.
"""
# pylint: disable=no-name-in-module,import-error,wrong-import-order
from test.python.docker import constant
from test.python.docker.compat import common
# pylint: disable=missing-function-docstring
class TestSystem(common.DockerTestCase):
"""TestCase for exercising Podman system services."""
def test_info(self):
info = self.docker.info()
self.assertIsNotNone(info)
self.assertEqual(info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Secure"], False)
self.assertEqual(
info["RegistryConfig"]["IndexConfigs"]["localhost:5000"]["Mirrors"],
["mirror.localhost:5000"],
)
def test_info_container_details(self):
info = self.docker.info()
self.assertEqual(info["Containers"], 1)
self.docker.containers.create(image=constant.ALPINE)
info = self.docker.info()
self.assertEqual(info["Containers"], 2)
def test_version(self):
version = self.docker.version()
self.assertIsNotNone(version["Platform"]["Name"])