瀏覽代碼

custom timeout test rewrite

Signed-off-by: Joffrey F <[email protected]>
Joffrey F 10 年之前
父節點
當前提交
6a95f6d628
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      tests/unit/cli/docker_client_test.py

+ 3 - 3
tests/unit/cli/docker_client_test.py

@@ -16,7 +16,7 @@ class DockerClientTestCase(unittest.TestCase):
             docker_client.docker_client()
 
     def test_docker_client_with_custom_timeout(self):
-        with mock.patch.dict(os.environ):
-            os.environ['DOCKER_CLIENT_TIMEOUT'] = timeout = "300"
+        timeout = 300
+        with mock.patch('compose.cli.docker_client.HTTP_TIMEOUT', 300):
             client = docker_client.docker_client()
-        self.assertEqual(client.timeout, int(timeout))
+            self.assertEqual(client.timeout, int(timeout))