Best Python code snippet using localstack_python
test_transcribe_boto3.py
Source:test_transcribe_boto3.py  
...542    response.should.contain("MedicalTranscriptionJobSummaries")543    len(response["MedicalTranscriptionJobSummaries"]).should.equal(8)544    response.shouldnt.contain("NextToken")545@mock_transcribe546def test_list_transcription_jobs():547    region_name = "us-east-1"548    client = boto3.client("transcribe", region_name=region_name)549    def run_job(index, target_status):550        job_name = "Job_{}".format(index)551        args = {552            "TranscriptionJobName": job_name,553            "Media": {"MediaFileUri": "s3://my-bucket/my-media-file.wav"},554            "OutputBucketName": "my-output-bucket",555            "IdentifyLanguage": True,556        }557        resp = client.start_transcription_job(**args)558        resp["ResponseMetadata"]["HTTPStatusCode"].should.equal(200)559        # IMPLICITLY PROMOTE JOB STATUS TO QUEUED560        resp = client.get_transcription_job(TranscriptionJobName=job_name)...test_transcribe.py
Source:test_transcribe.py  
...61    @pytest.mark.aws_validated62    @pytest.mark.skip_snapshot_verify(63        paths=["$..NextToken", "$..TranscriptionJobSummaries..OutputLocationType"]64    )65    def test_list_transcription_jobs(self, transcribe_client, transcribe_create_job, snapshot):66        file_path = os.path.join(BASEDIR, "files/en-gb.wav")67        transcribe_create_job(audio_file=file_path)68        jobs = transcribe_client.list_transcription_jobs()69        # there are potentially multiple transcription jobs on AWS - ordered by creation date70        # we only care about the newest one that we just created71        jobs["TranscriptionJobSummaries"] = jobs["TranscriptionJobSummaries"][0]72        snapshot.match("ListJobs", jobs)73    @pytest.mark.aws_validated74    @pytest.mark.skip_snapshot_verify(paths=["$..Error..Code"])75    def test_failing_deletion(self, transcribe_client, snapshot):76        # successful deletion is tested in the happy path test77        # this tests a failed deletion78        with pytest.raises((ClientError, NotFoundException)) as e_info:79            transcribe_client.delete_transcription_job(TranscriptionJobName="non-existent")...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!!
