Add unit test for fernet provider

There is some unit testing specific to the Fernet token provider that lives
outside of the test_v3_* and test_v2 test modules. This change just adds an
explict unit test to assert that the Fernet token providers doesn't require
persistent storage for tokens.

Closes-Bug: 1471967
Change-Id: Iad9c4acc1241ec56222759998a86d0abeae143dc
(cherry picked from commit 7d6e2a2805)
This commit is contained in:
Lance Bragstad 2015-07-01 16:24:45 +00:00 committed by Dolph Mathews
parent 17b7dbc81e
commit c6ec36b179
1 changed files with 3 additions and 0 deletions

View File

@ -42,6 +42,9 @@ class TestFernetTokenProvider(tests.TestCase):
self.assertRaises(exception.NotImplemented,
self.provider._get_token_id, token_data)
def test_needs_persistence_returns_false(self):
self.assertFalse(self.provider.needs_persistence())
def test_invalid_v3_token_raises_401(self):
self.assertRaises(
exception.Unauthorized,