TestProviderSecurityService.py 806 B

1234567891011121314151617181920212223
  1. """
  2. Tests the functionality of the Blend CloudMan API. These tests require working
  3. credentials to supported cloud infrastructure.
  4. Use ``nose tests`` to run these unit tests.
  5. """
  6. import unittest
  7. from cloudbridge.providers.factory import CloudProviderFactory
  8. from cloudbridge.providers.factory import ProviderList
  9. from cloudbridge.providers import interfaces
  10. class TestProviderSecurityService(unittest.TestCase):
  11. def setUp(self):
  12. config = {}
  13. self.provider = CloudProviderFactory().create_provider(ProviderList.EC2, config)
  14. def test_list_key_pairs(self):
  15. key_pairs = self.provider.security.list_key_pairs()
  16. # Assume there's always one keypair at least
  17. self.assertIsInstance(key_pairs[0], interfaces.KeyPair)
  18. self.assertIsNotNone(key_pairs[0].name)