summaryrefslogtreecommitdiff
path: root/functionaltests
diff options
context:
space:
mode:
authorChellygel <chelsea.winfree@gmail.com>2015-03-16 18:45:21 -0500
committerChellygel <chelsea.winfree@gmail.com>2015-03-17 01:18:30 -0500
commit41ab8cf32caf9dccbef91133f51f337680aef9af (patch)
tree1ca346e17c529835bf031276ec3b69655163f011 /functionaltests
parent28e8c7f758d42ab10a7a29fdfd02f2b0a33797e8 (diff)
downloadpython-barbicanclient-41ab8cf32caf9dccbef91133f51f337680aef9af.tar.gz
Added new exception, renamed test, and adjusted test
Change-Id: I0cb7699711b77bbd3f84023ac0371dcc4311e586
Diffstat (limited to 'functionaltests')
-rw-r--r--functionaltests/client/v1/functional/test_secrets.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/functionaltests/client/v1/functional/test_secrets.py b/functionaltests/client/v1/functional/test_secrets.py
index 552f17a..0966442 100644
--- a/functionaltests/client/v1/functional/test_secrets.py
+++ b/functionaltests/client/v1/functional/test_secrets.py
@@ -20,6 +20,8 @@ from functionaltests.client.v1.behaviors import secret_behaviors
from functionaltests import utils
from testtools import testcase
+from barbicanclient import exceptions
+
secret_create_defaults_data = {
"name": "AES key",
"expiration": "2018-02-28T19:14:44.180394",
@@ -296,7 +298,7 @@ class SecretsTestCase(base.TestCase):
'none': [None],
})
@testcase.attr('negative')
- def test_secret_create_defaults_invalid_payload(self, payload):
+ def test_secret_with_no_payload_exception(self, payload):
"""Covers creating secrets with various invalid payloads.
These requests will fail with a value error before the request to the
@@ -305,11 +307,11 @@ class SecretsTestCase(base.TestCase):
secret_create_defaults_data)
test_model.payload = payload
- e = self.assertRaises(ValueError, self.behaviors.store_secret,
- test_model)
-
- self.assertIn('Payload incorrectly specified.',
- e.message)
+ self.assertRaises(
+ exceptions.NoPayloadException,
+ self.behaviors.store_secret,
+ test_model
+ )
@utils.parameterized_dataset({
'negative_five_long_expire': {