summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDustin Falgout <dustin@falgout.us>2015-11-17 10:40:03 -0600
committerDustin Falgout <dustin@falgout.us>2015-12-04 01:27:44 -0600
commite0c6ec0343a2a8056437b7605e90d75d05fb7b39 (patch)
treecfc7bcaca3b0cdf0d900f75a8851f30c83593ddc /tests
parente0365fcbfbc3bb6db5f2ac65ef5a14c62ddaf572 (diff)
downloaddocker-py-e0c6ec0343a2a8056437b7605e90d75d05fb7b39.tar.gz
incorporate feedback
Signed-off-by: Dustin Falgout <dustin@falgout.us>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/container_test.py18
-rw-r--r--tests/unit/api_test.py3
2 files changed, 5 insertions, 16 deletions
diff --git a/tests/integration/container_test.py b/tests/integration/container_test.py
index 76a4418..79840a1 100644
--- a/tests/integration/container_test.py
+++ b/tests/integration/container_test.py
@@ -365,21 +365,11 @@ class CreateContainerTest(helpers.BaseTestCase):
self.assertIn('MemorySwappiness', host_config)
def test_create_host_config_exception_raising(self):
- with self.assertRaises(TypeError) as exc:
- ctnr1 = self.client.create_container(
- BUSYBOX, 'true',
- host_config=self.client.create_host_config(mem_swappiness='40')
- )
- self.assertIn('Invalid type for', exc.exception.response.text)
- self.client.remove_container(ctnr1.get('Id', ctnr1), force=True)
+ self.assertRaises(TypeError,
+ self.client.create_host_config, mem_swappiness='40')
- with self.assertRaises(docker.errors.InvalidVersion) as exc:
- ctnr2 = self.client.create_container(
- BUSYBOX, 'true',
- host_config=self.client.create_host_config(version='1.18', mem_swappiness=40)
- )
- self.assertIn('param is not supported in', exc.exception.response.text)
- self.client.remove_container(ctnr2.get('Id', ctnr2), force=True)
+ self.assertRaises(ValueError,
+ self.client.create_host_config, pid_mode='40')
class VolumeBindTest(helpers.BaseTestCase):
diff --git a/tests/unit/api_test.py b/tests/unit/api_test.py
index 62d64e8..23fd191 100644
--- a/tests/unit/api_test.py
+++ b/tests/unit/api_test.py
@@ -314,8 +314,7 @@ class DockerApiTest(DockerClientTest):
self.assertIn('SecurityOpt', result)
self.assertEqual(result['SecurityOpt'], security_opt)
self.assertRaises(
- docker.errors.DockerException, self.client.create_host_config,
- security_opt='wrong'
+ TypeError, self.client.create_host_config, security_opt='wrong'
)