Beispiel #1
0
 def test_provider_plugin_config(self):
     pr = provider.ProviderRegistry()
     provider1 = pr.show_provider('fake_id1')
     plugin_name = 'smaug.tests.unit.fake_protection.FakeProtectionPlugin'
     self.assertEqual(
         provider1.plugins[plugin_name]._config.fake_plugin.fake_user,
         'user')
Beispiel #2
0
    def test_load_providers(self, mock_load_bank, mock_load_plugin):
        pr = provider.ProviderRegistry()
        self.assertEqual(mock_load_plugin.call_count, 1)
        self.assertEqual(mock_load_bank.call_count, 1)
        self.assertEqual(len(pr.providers), 1)

        self.assertEqual(pr.providers['fake_id1'].name, 'fake_provider1')
        self.assertNotIn('fake_provider2', pr.providers)
Beispiel #3
0
 def test_show_provider(self):
     pr = provider.ProviderRegistry()
     provider_list = pr.list_providers()
     for provider_node in provider_list:
         self.assertTrue(pr.show_provider(provider_node['id']))
Beispiel #4
0
 def test_list_provider(self):
     pr = provider.ProviderRegistry()
     self.assertEqual(1, len(pr.list_providers()))
Beispiel #5
0
 def test_provider_bank_config(self):
     pr = provider.ProviderRegistry()
     provider1 = pr.show_provider('fake_id1')
     self.assertEqual(provider1.bank._plugin._config.fake_bank.fake_host,
                      'thor')