Remove second setUp() call in tests

This fixes test failures with a new testtools version which raise
Exceptions in case of multiple setup/teardown calls.

Change-Id: I4d4bc05e38a97e43348c188d8f85761522c582d9
This commit is contained in:
Thomas Bechtold 2014-08-22 15:58:40 +02:00
parent 1fbf0eebec
commit b293d11c56

View File

@ -177,8 +177,6 @@ class BaseTestCase(testtools.TestCase):
method_under_test)
self._assert_post_rbac_exception(exception, role)
self.setUp() # Need to re-setup
def _assert_fail_rbac(self, roles, method_under_test, accept=None,
content_type=None):
"""Assert that RBAC rules failed for one of the specified roles.
@ -196,8 +194,6 @@ class BaseTestCase(testtools.TestCase):
exception = self.assertRaises(exc.HTTPForbidden, method_under_test)
self.assertEqual(403, exception.status_int)
self.setUp() # Need to re-setup
class WhenTestingVersionResource(BaseTestCase):
"""RBAC tests for the barbican.api.resources.VersionResource class."""
@ -215,7 +211,6 @@ class WhenTestingVersionResource(BaseTestCase):
for role in ['admin', 'observer', 'creator', 'audit']:
self.req = self._generate_req(roles=[role] if role else [])
self._invoke_on_get()
self.setUp() # Need to re-setup
def test_should_pass_get_version_with_bad_roles(self):
self.req = self._generate_req(roles=[None, 'bunkrolehere'])