From 38355f253da4efd667d7e249596e3f4157fcc74e Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Mon, 17 Mar 2014 17:55:23 +0900 Subject: [PATCH] Add a new exception for invalid structure This commit fixes too broad exception in output_parser. Otherwise, we can't assert the Exception in unit tests. Partially implements bp unit-tests Change-Id: I9e45571dbf964a37dd9d0249a6f662216d5d046c --- tempest/cli/output_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tempest/cli/output_parser.py b/tempest/cli/output_parser.py index 4edcd47..80234a3 100644 --- a/tempest/cli/output_parser.py +++ b/tempest/cli/output_parser.py @@ -17,6 +17,7 @@ import re +from tempest import exceptions from tempest.openstack.common import log as logging @@ -37,7 +38,7 @@ def details_multiple(output_lines, with_label=False): for table_ in tables_: if 'Property' not in table_['headers'] \ or 'Value' not in table_['headers']: - raise Exception('Invalid structure of table with details') + raise exceptions.InvalidStructure() item = {} for value in table_['values']: item[value[0]] = value[1]