コード例 #1
0
 def test_create_res_missing_flavor(self, *mock_args):
     # pylint: disable=unused-argument
     tempest_resources = tempest.TempestResourcesManager()
     with self.assertRaises(Exception) as context:
         tempest_resources.create()
     msg = 'Failed to create flavor'
     self.assertTrue(msg in context.exception, msg=str(context.exception))
コード例 #2
0
 def test_create_tempest_resources_missing_network_dic(self, *mock_args):
     tempest_resources = tempest.TempestResourcesManager(
         os_creds=self.os_creds)
     with self.assertRaises(Exception) as context:
         tempest_resources.create()
     msg = 'Failed to create private network'
     self.assertTrue(msg in context.exception)
コード例 #3
0
    def test_create_tempest_resources_missing_image(self, *mock_args):
        tempest_resources = tempest.TempestResourcesManager(os_creds={})

        with self.assertRaises(Exception) as context:
            tempest_resources.create()
        msg = 'Failed to create image'
        self.assertTrue(msg in context.exception, msg=str(context.exception))
コード例 #4
0
    def test_create_tempest_resources_missing_image(self, *mock_args):
        tempest_resources = tempest.TempestResourcesManager(os_creds={})

        CONST.__setattr__('tempest_use_custom_imagess', True)
        with self.assertRaises(Exception) as context:
            tempest_resources.create()
        msg = 'Failed to create image'
        self.assertTrue(msg in context.exception, msg=str(context.exception))

        CONST.__setattr__('tempest_use_custom_imagess', False)
        with self.assertRaises(Exception) as context:
            tempest_resources.create(use_custom_images=True)
        msg = 'Failed to create image'
        self.assertTrue(msg in context.exception, msg=str(context.exception))
コード例 #5
0
    def test_create_tempest_resources_missing_flavor(self, *mock_args):
        tempest_resources = tempest.TempestResourcesManager(
            os_creds=self.os_creds)

        CONST.__setattr__('tempest_use_custom_flavors', 'True')
        with self.assertRaises(Exception) as context:
            tempest_resources.create()
        msg = 'Failed to create flavor'
        self.assertTrue(msg in context.exception, msg=str(context.exception))

        CONST.__setattr__('tempest_use_custom_flavors', 'False')
        with self.assertRaises(Exception) as context:
            tempest_resources.create(use_custom_flavors=True)
        msg = 'Failed to create flavor'
        self.assertTrue(msg in context.exception, msg=str(context.exception))