File: test_system.py

package info (click to toggle)
podman 5.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,824 kB
  • sloc: sh: 4,700; python: 2,798; perl: 1,885; ansic: 1,484; makefile: 977; ruby: 42; csh: 8
file content (32 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
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"])