Best Python code snippet using tempest_python
test_protocols_client.py
Source:test_protocols_client.py  
...62            bytes_body,63            idp_id="FAKE_ID",64            protocol_id="fake_id1",65            status=201)66    def _test_list_protocols_of_identity_provider(self, bytes_body=False):67        self.check_service_client_function(68            self.client.list_protocols_of_identity_provider,69            'tempest.lib.common.rest_client.RestClient.get',70            self.FAKE_PROTOCOLS_INFO,71            bytes_body,72            idp_id="FAKE_ID",73            status=200)74    def _test_get_protocol_for_identity_provider(self, bytes_body=False):75        self.check_service_client_function(76            self.client.get_protocol_for_identity_provider,77            'tempest.lib.common.rest_client.RestClient.get',78            self.FAKE_PROTOCOL_INFO,79            bytes_body,80            idp_id="FAKE_ID",81            protocol_id="fake_id1",82            status=200)83    def _test_update_mapping_for_identity_provider(self, bytes_body=False):84        self.check_service_client_function(85            self.client.update_mapping_for_identity_provider,86            'tempest.lib.common.rest_client.RestClient.patch',87            self.FAKE_PROTOCOL_INFO,88            bytes_body,89            idp_id="FAKE_ID",90            protocol_id="fake_id1",91            status=200)92    def _test_delete_protocol_from_identity_provider(self, bytes_body=False):93        self.check_service_client_function(94            self.client.delete_protocol_from_identity_provider,95            'tempest.lib.common.rest_client.RestClient.delete',96            {},97            bytes_body,98            idp_id="FAKE_ID",99            protocol_id="fake_id1",100            status=204)101    def test_add_protocol_to_identity_provider_with_str_body(self):102        self._test_add_protocol_to_identity_provider()103    def test_add_protocol_to_identity_provider_with_bytes_body(self):104        self._test_add_protocol_to_identity_provider(bytes_body=True)105    def test_list_protocols_of_identity_provider_with_str_body(self):106        self._test_list_protocols_of_identity_provider()107    def test_list_protocols_of_identity_provider_with_bytes_body(self):108        self._test_list_protocols_of_identity_provider(bytes_body=True)109    def test_get_protocol_for_identity_provider_with_str_body(self):110        self._test_get_protocol_for_identity_provider()111    def test_get_protocol_for_identity_provider_with_bytes_body(self):112        self._test_get_protocol_for_identity_provider(bytes_body=True)113    def test_update_mapping_for_identity_provider_with_str_body(self):114        self._test_update_mapping_for_identity_provider()115    def test_update_mapping_for_identity_provider_with_bytes_body(self):116        self._test_update_mapping_for_identity_provider(bytes_body=True)117    def test_delete_protocol_from_identity_provider_with_str_body(self):118        self._test_delete_protocol_from_identity_provider()119    def test_delete_protocol_from_identity_provider_with_bytes_body(self):...protocols_client.py
Source:protocols_client.py  
...29            % (idp_id, protocol_id), post_body)30        self.expected_success(201, resp.status)31        body = json.loads(body)32        return rest_client.ResponseBody(resp, body)33    def list_protocols_of_identity_provider(self, idp_id, **kwargs):34        """List protocols of identity provider.35        For a full list of available parameters, please refer to the official36        API reference:37        https://docs.openstack.org/api-ref/identity/v3-ext/index.html#list-protocols-of-identity-provider38        """39        url = 'OS-FEDERATION/identity_providers/%s/protocols' % idp_id40        if kwargs:41            url += '?%s' % urllib.urlencode(kwargs)42        resp, body = self.get(url)43        self.expected_success(200, resp.status)44        body = json.loads(body)45        return rest_client.ResponseBody(resp, body)46    def get_protocol_for_identity_provider(self, idp_id, protocol_id):47        """Get protocol for identity provider....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!!
