diff options
author | Matt Bogosian <mtb19@columbia.edu> | 2015-05-17 09:25:38 -0700 |
---|---|---|
committer | Matt Bogosian <mtb19@columbia.edu> | 2015-05-17 17:39:25 -0700 |
commit | de2f58d818565dd3de28dee269dfc17c367306ef (patch) | |
tree | d53f21d666e30e100eee5fa788a92495e7bcdef4 /tests | |
parent | f044b5e3f73c7bc0031beabb97aa8a5760b792c7 (diff) | |
download | docker-py-de2f58d818565dd3de28dee269dfc17c367306ef.tar.gz |
Fix #602. Raise ValueError on empty argument to inspect_{container,image}() methods.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test.py b/tests/test.py index 9b90017..98bb03f 100644 --- a/tests/test.py +++ b/tests/test.py @@ -1782,6 +1782,12 @@ class DockerClientTest(Cleanup, base.BaseTestCase): except Exception as e: self.fail('Command should not raise exception: {0}'.format(e)) + try: + self.client.inspect_container('') + except ValueError as e: + self.assertEqual(e.args[0], + 'image or container param is empty') + fake_request.assert_called_with( url_prefix + 'containers/3cc2351ab11b/json', timeout=DEFAULT_TIMEOUT_SECONDS @@ -1953,6 +1959,12 @@ class DockerClientTest(Cleanup, base.BaseTestCase): except Exception as e: self.fail('Command should not raise exception: {0}'.format(e)) + try: + self.client.inspect_image('') + except ValueError as e: + self.assertEqual(e.args[0], + 'image or container param is empty') + fake_request.assert_called_with( url_prefix + 'images/test_image/json', timeout=DEFAULT_TIMEOUT_SECONDS |