Add I18n-related unit tests (Part 3)

This CR is the first of several dependent CRs that break up the overall
tests added via this abandoned CR:
https://review.openstack.org/#/c/139894
This CR adds the new database/repository unit tests to the 'repository'
package.

Change-Id: Iccb24665801e9c207fa90acbaa4ce6e24088cf90
This commit is contained in:
jfwood
2014-12-12 22:00:55 -06:00
parent 76b228645d
commit 010b397e9e
25 changed files with 936 additions and 310 deletions

View File

@@ -119,6 +119,25 @@ class WhenTestingSecretStorePluginManager(utils.BaseTestCase):
keySpec,
)
def test_get_store_no_plugin_found_by_name(self):
plugin = TestSecretStore([str.KeyAlgorithm.AES])
plugin_mock = mock.MagicMock(obj=plugin)
self.manager.extensions = [plugin_mock]
keySpec = str.KeySpec(str.KeyAlgorithm.AES, 128)
plugin_name = 'plugin'
exception_result = self.assertRaises(
str.SecretStorePluginNotFound,
self.manager.get_plugin_store,
keySpec,
plugin_name=plugin_name
)
self.assertEqual(
'Secret store plugin "{name}" not found.'.format(name=plugin_name),
exception_result.message)
def test_get_generate_no_plugin_found(self):
self.manager.extensions = []
keySpec = str.KeySpec(str.KeyAlgorithm.AES, 128)