diff options
author | Joffrey F <joffrey@docker.com> | 2015-04-24 15:56:35 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2015-04-24 15:56:35 -0700 |
commit | c2d48652ce9e5808bfa3f22b2daec34e88d5e9df (patch) | |
tree | 3ca3248004c72a5bccae17c479e099e821baea7d /tests | |
parent | 185fceda7b32b28aed27eae86a3a4bc2a457ba44 (diff) | |
download | docker-py-c2d48652ce9e5808bfa3f22b2daec34e88d5e9df.tar.gz |
Added check_resource decorator to interrupt command if container or image argument is None
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test.py b/tests/test.py index f2af58b..76c5638 100644 --- a/tests/test.py +++ b/tests/test.py @@ -669,6 +669,21 @@ class DockerClientTest(Cleanup, base.BaseTestCase): args[1]['timeout'], docker.client.DEFAULT_TIMEOUT_SECONDS ) + def test_start_container_none(self): + try: + self.client.start(container=None) + except ValueError as e: + self.assertEqual(str(e), 'image or container param is None') + else: + self.fail('Command should raise ValueError') + + try: + self.client.start(None) + except ValueError as e: + self.assertEqual(str(e), 'image or container param is None') + else: + self.fail('Command should raise ValueError') + def test_create_container_with_lxc_conf(self): try: self.client.create_container( |