Example #1
0
 def docker_client(self):
     docker_client = self._docker_client
     if not docker_client:
         from tobiko import docker
         self._docker_client = docker_client = docker.get_docker_client(
             ssh_client=self.ssh_client)
     return docker_client
Example #2
0
 def docker_client(self):
     docker_client = self._docker_client
     if not docker_client:
         self._docker_client = docker_client = docker.get_docker_client(
             ssh_client=self.ssh_client)
     return docker_client
Example #3
0
 def test_connect_docker_client(self):
     client = docker.get_docker_client(ssh_client=self.ssh_client).connect()
     self.assertIsInstance(client, docker_client.DockerClient)
     client.ping()
Example #4
0
 def test_get_docker_client(self):
     client = docker.get_docker_client(ssh_client=self.ssh_client)
     self.assertIsInstance(client, docker.DockerClientFixture)
Example #5
0
 def test_list_docker_containers(self):
     client = docker.get_docker_client(ssh_client=self.ssh_client,
                                       sudo=self.sudo)
     for container in docker.list_docker_containers(
             client=client):
         self.assertIsInstance(container, containers.Container)
Example #6
0
 def _get_client(self, ssh_client):
     return docker.get_docker_client(ssh_client=ssh_client,
                                     sudo=True).connect()