summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests/create_image_tests.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-07-21 15:59:22 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-07-21 15:59:22 -0600
commit663cc3617e45f6967db4af2c0a4a27e9256923f1 (patch)
tree0cc5cfb87a6ae8eb037349440d9faa42060871f5 /snaps/openstack/tests/create_image_tests.py
parentb0af6e93bb5cc338c289577aad5c4b1bf8de7053 (diff)
Refactor glance_utils.py v1 image creation.
Replace 4 blocks using named parameters with on call to create() with kwargs. JIRA: SNAPS-141 Change-Id: I1268877a8524bb25a7f605f583ace9602f5a9c1b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/tests/create_image_tests.py')
-rw-r--r--snaps/openstack/tests/create_image_tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/snaps/openstack/tests/create_image_tests.py b/snaps/openstack/tests/create_image_tests.py
index d538fef..6c9b175 100644
--- a/snaps/openstack/tests/create_image_tests.py
+++ b/snaps/openstack/tests/create_image_tests.py
@@ -12,6 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
+from glanceclient.exc import HTTPBadRequest
try:
from urllib.request import URLError
@@ -514,8 +515,14 @@ class CreateImageNegativeTests(OSIntegrationTestCase):
img_format=os_image_settings.format,
url="http://foo.bar"))
- with self.assertRaises(URLError):
+ try:
self.image_creator.create()
+ except HTTPBadRequest:
+ pass
+ except URLError:
+ pass
+ except Exception as e:
+ self.fail('Invalid Exception ' + str(e))
def test_bad_image_file(self):
"""