2014-10-18 19:54:04 +02:00
|
|
|
from __future__ import absolute_import
|
2015-08-24 21:25:25 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2014-10-18 19:54:04 +02:00
|
|
|
import os
|
|
|
|
|
2015-03-26 04:13:01 +01:00
|
|
|
from compose.cli import docker_client
|
2014-08-19 23:36:46 +02:00
|
|
|
from tests import mock
|
2015-08-24 21:25:25 +02:00
|
|
|
from tests import unittest
|
2014-10-18 19:54:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
class DockerClientTestCase(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_docker_client_no_home(self):
|
|
|
|
with mock.patch.dict(os.environ):
|
|
|
|
del os.environ['HOME']
|
|
|
|
docker_client.docker_client()
|
2014-12-11 19:08:39 +01:00
|
|
|
|
|
|
|
def test_docker_client_with_custom_timeout(self):
|
|
|
|
with mock.patch.dict(os.environ):
|
|
|
|
os.environ['DOCKER_CLIENT_TIMEOUT'] = timeout = "300"
|
|
|
|
client = docker_client.docker_client()
|
2015-02-20 17:18:51 +01:00
|
|
|
self.assertEqual(client.timeout, int(timeout))
|