Skip to content

Commit

Permalink
Stops injecting revoke_api into TestCase
Browse files Browse the repository at this point in the history
Unit tests should not be using injection. The objects that are
required by a test should be explicitly constructed and used.

Change-Id: Ia9101c45da8ae6176f8c975ad63276eb231b60c1
  • Loading branch information
dstanek committed Apr 15, 2015
1 parent 86ecba8 commit ed1f28e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion keystone/tests/unit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ def cleanup():
return cleanup


@dependency.requires('revoke_api')
class TestCase(BaseTestCase):

def config_files(self):
Expand Down
6 changes: 6 additions & 0 deletions keystone/tests/unit/test_revoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from oslo_utils import timeutils
from testtools import matchers

from keystone.contrib import revoke
from keystone.contrib.revoke import model
from keystone import exception
from keystone.tests import unit as tests
Expand Down Expand Up @@ -112,6 +113,11 @@ def _matches(event, token_values):


class RevokeTests(object):

def setUp(self):
super(RevokeTests, self).setUp()
self.revoke_api = revoke.Manger()

def test_list(self):
self.revoke_api.revoke_by_user(user_id=1)
self.assertEqual(1, len(self.revoke_api.get_events()))
Expand Down

0 comments on commit ed1f28e

Please sign in to comment.