def integration_01b_create_mci(self): actor = mci.MCI( options={'name': self.name, 'description': self.name, 'state': 'present', 'images': self.images}) yield actor.execute()
def integration_09b_destroy_mci(self): actor = mci.MCI( options={'name': self.name, 'description': self.name, 'state': 'absent', 'images': self.images}) yield actor.execute()
def integration_03b_update_mci(self): actor = mci.MCI( options={'name': self.name, 'description': self.name, 'state': 'present', 'tags': 'some_new_tag', 'commit': 'Added a tag', 'images': self.images}) yield actor.execute()
def integration_03a_update_mci(self): self.images[0]['instance_type'] = 'm1.large' self.images[1]['instance_type'] = 'm1.large' actor = mci.MCI( options={'name': self.name, 'description': self.name, 'state': 'present', 'commit': 'Changed instance type to m1.large', 'images': self.images}) yield actor.execute()
def setUp(self, *args, **kwargs): super(TestMCIActor, self).setUp() base.TOKEN = 'unittest' # Create some fake image reference objects self._images = [{ 'cloud': 'cloudA', 'image': 'ami-A', 'instance_type': 'm1.small', 'user_data': 'userdataA' }, { 'cloud': 'cloudB', 'image': 'ami-B', 'instance_type': 'm1.small' }] # Create the actor self.actor = mci.MCI( options={ 'name': 'testmci', 'state': 'present', 'commit': 'Yeah, committed', 'tags': ['tag'], 'description': 'test mci desc', 'images': self._images }) # What the final converted clouda/cloudb mocks should look like when # all of their names have been converted into HREFs and the data has # been turned into a RightScale formatted parameters list. self.clouda_href_tuples = [ ('multi_cloud_image_setting[image_href]', '/api/clouds/A/images/abc'), ('multi_cloud_image_setting[user_data]', 'userdataA'), ('multi_cloud_image_setting[instance_type_href]', '/api/clouds/A/instance_types/abc'), ('multi_cloud_image_setting[cloud_href]', '/api/clouds/A') ] self.cloudb_href_tuples = [ ('multi_cloud_image_setting[image_href]', '/api/clouds/B/images/abc'), ('multi_cloud_image_setting[instance_type_href]', '/api/clouds/B/instance_types/abc'), ('multi_cloud_image_setting[cloud_href]', '/api/clouds/B') ] # Patch the actor so that we use the client mock self.client_mock = mock.MagicMock(name='client') self.actor._client = self.client_mock