summaryrefslogtreecommitdiff
path: root/tests/integration/models_resources_test.py
blob: 4aafe0cc7497acf8ceeb0ebd8c892998f1ea8811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import docker
from .base import BaseIntegrationTest, TEST_API_VERSION


class ModelTest(BaseIntegrationTest):

    def test_reload(self):
        client = docker.from_env(version=TEST_API_VERSION)
        container = client.containers.run("alpine", "sleep 300", detach=True)
        self.tmp_containers.append(container.id)
        first_started_at = container.attrs['State']['StartedAt']
        container.kill()
        container.start()
        assert container.attrs['State']['StartedAt'] == first_started_at
        container.reload()
        assert container.attrs['State']['StartedAt'] != first_started_at