Best Python code snippet using localstack_python
test_boto3_elasticsearch.py
Source:test_boto3_elasticsearch.py  
...1047            "purchase_reserved_elasticsearch_instance_offering",1048            return_value=ret_val,1049        ):1050            self.assertEqual(1051                boto3_elasticsearch.purchase_reserved_elasticsearch_instance_offering(1052                    reserved_elasticsearch_instance_offering_id="foo",1053                    reservation_name="bar",1054                    **CONN_PARAMETERS1055                ),1056                {"result": True, "response": ret_val},1057            )1058    def test_purchase_reserved_elasticsearch_instance_offering_error(self):1059        """1060        Test that when calling purchase_reserved_elasticsearch_instance_offering and boto31061        returns an error, it returns {'result': False, 'error': 'the error'}.1062        """1063        with patch.object(1064            self.conn,1065            "purchase_reserved_elasticsearch_instance_offering",1066            side_effect=ClientError(1067                ERROR_CONTENT, "purchase_reserved_elasticsearch_instance_offering"1068            ),1069        ):1070            result = boto3_elasticsearch.purchase_reserved_elasticsearch_instance_offering(1071                reserved_elasticsearch_instance_offering_id="foo",1072                reservation_name="bar",1073                **CONN_PARAMETERS1074            )1075            self.assertFalse(result["result"])1076            self.assertEqual(1077                result.get("error", ""),1078                ERROR_MESSAGE.format(1079                    101, "purchase_reserved_elasticsearch_instance_offering"1080                ),1081            )1082    def test_start_elasticsearch_service_software_update_positive(self):1083        """1084        Test that when calling start_elasticsearch_service_software_update and it...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!!
