summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keystone/tests/unit/token/test_fernet_provider.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/keystone/tests/unit/token/test_fernet_provider.py b/keystone/tests/unit/token/test_fernet_provider.py
index b0d5238..7b784a9 100644
--- a/keystone/tests/unit/token/test_fernet_provider.py
+++ b/keystone/tests/unit/token/test_fernet_provider.py
@@ -695,9 +695,11 @@ class TestFernetKeyRotation(unit.TestCase):
695 695
696class TestLoadKeys(unit.TestCase): 696class TestLoadKeys(unit.TestCase):
697 697
698 def assertValidFernetKey(self, keys): 698 def assertValidFernetKeys(self, keys):
699 self.assertGreater(len(keys[0]), 0) 699 # Make sure each key is a non-empty string
700 self.assertIsInstance(keys[0], str) 700 for key in keys:
701 self.assertGreater(len(key), 0)
702 self.assertIsInstance(key, str)
701 703
702 def test_non_numeric_files(self): 704 def test_non_numeric_files(self):
703 self.useFixture( 705 self.useFixture(
@@ -717,4 +719,4 @@ class TestLoadKeys(unit.TestCase):
717 ) 719 )
718 keys = key_utils.load_keys() 720 keys = key_utils.load_keys()
719 self.assertEqual(2, len(keys)) 721 self.assertEqual(2, len(keys))
720 self.assertValidFernetKey(keys) 722 self.assertValidFernetKeys(keys)