Best Python code snippet using tempest_python
test_image_members_client.py
Source:test_image_members_client.py
...28 fake_auth = fake_auth_provider.FakeAuthProvider()29 self.client = image_members_client.ImageMembersClient(fake_auth,30 'image',31 'regionOne')32 def _test_show_image_member(self, bytes_body=False):33 self.check_service_client_function(34 self.client.show_image_member,35 'tempest.lib.common.rest_client.RestClient.get',36 self.FAKE_CREATE_SHOW_UPDATE_IMAGE_MEMBER,37 bytes_body,38 image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",39 member_id="8989447062e04a818baf9e073fd04fa7")40 def _test_create_image_member(self, bytes_body=False):41 self.check_service_client_function(42 self.client.create_image_member,43 'tempest.lib.common.rest_client.RestClient.post',44 self.FAKE_CREATE_SHOW_UPDATE_IMAGE_MEMBER,45 bytes_body,46 image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",47 member_id="8989447062e04a818baf9e073fd04fa7")48 def _test_update_image_member(self, bytes_body=False):49 self.check_service_client_function(50 self.client.update_image_member,51 'tempest.lib.common.rest_client.RestClient.put',52 self.FAKE_CREATE_SHOW_UPDATE_IMAGE_MEMBER,53 bytes_body,54 image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",55 member_id="8989447062e04a818baf9e073fd04fa7",56 schema="/v2/schemas/member2")57 def test_show_image_member_with_str_body(self):58 self._test_show_image_member()59 def test_show_image_member_with_bytes_body(self):60 self._test_show_image_member(bytes_body=True)61 def test_create_image_member_with_str_body(self):62 self._test_create_image_member()63 def test_create_image_member_with_bytes_body(self):64 self._test_create_image_member(bytes_body=True)65 def test_delete_image_member(self):66 self.check_service_client_function(67 self.client.delete_image_member,68 'tempest.lib.common.rest_client.RestClient.delete',69 {},70 image_id="0ae74cc5-5147-4239-9ce2-b0c580f7067e",71 member_id="8989447062e04a818baf9e073fd04fa7",72 status=204)73 def test_update_image_member_with_str_body(self):74 self._test_update_image_member()...
image_members_client.py
Source:image_members_client.py
...47 resp, body = self.put(url, data)48 self.expected_success(200, resp.status)49 body = json.loads(body)50 return rest_client.ResponseBody(resp, body)51 def show_image_member(self, image_id, member_id):52 """Show an image member.53 For a full list of available parameters, please refer to the official54 API reference:55 http://developer.openstack.org/api-ref/image/v2/#show-image-member-details56 """57 url = 'images/%s/members/%s' % (image_id, member_id)58 resp, body = self.get(url)59 self.expected_success(200, resp.status)60 return rest_client.ResponseBody(resp, json.loads(body))61 def delete_image_member(self, image_id, member_id):62 """Delete an image member.63 For a full list of available parameters, please refer to the official64 API reference:65 http://developer.openstack.org/api-ref/image/v2/#delete-image-member...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!