summaryrefslogtreecommitdiff
path: root/openstackclient/tests/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-06-08 04:30:57 +0000
committerGerrit Code Review <review@openstack.org>2016-06-08 04:30:58 +0000
commitc272476b7bbfe5eefa84d25475d7b8d85fa4d9b9 (patch)
treeb437d185ca78d5fe797a007f94249c076c1121b7 /openstackclient/tests/common
parent4c331bd5f9ba2e9174b7e2ab17df2c3800d24caa (diff)
parentcf122397733b8795530577b7824aeae305719658 (diff)
downloadpython-openstackclient-c272476b7bbfe5eefa84d25475d7b8d85fa4d9b9.tar.gz
Merge "Error handling for KeyValueAction class."
Diffstat (limited to 'openstackclient/tests/common')
-rw-r--r--openstackclient/tests/common/test_parseractions.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/openstackclient/tests/common/test_parseractions.py b/openstackclient/tests/common/test_parseractions.py
index 5c5ca3d3..894b224c 100644
--- a/openstackclient/tests/common/test_parseractions.py
+++ b/openstackclient/tests/common/test_parseractions.py
@@ -49,16 +49,13 @@ class TestKeyValueAction(utils.TestCase):
self.assertDictEqual(expect, actual)
def test_error_values(self):
- results = self.parser.parse_args([
- '--property', 'red',
- '--property', 'green=100%',
- '--property', 'blue',
- ])
-
- actual = getattr(results, 'property', {})
- # There should be no red or blue
- expect = {'green': '100%', 'format': '#rgb'}
- self.assertDictEqual(expect, actual)
+ self.assertRaises(
+ argparse.ArgumentTypeError,
+ self.parser.parse_args,
+ [
+ '--property', 'red',
+ ]
+ )
class TestMultiKeyValueAction(utils.TestCase):