From 68a79ef2691cfd2e6c4ebe737269d7db0ca63101 Mon Sep 17 00:00:00 2001 From: ethan-tonic Date: Wed, 3 Sep 2025 12:42:51 -0400 Subject: [PATCH 1/3] Fix audio tests --- tests/tests/audio_tests/test_get_transcript.py | 1 - tests/tests/audio_tests/test_redact_audio_file.py | 1 - tests/tests/audio_tests/test_redact_transcript.py | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/tests/audio_tests/test_get_transcript.py b/tests/tests/audio_tests/test_get_transcript.py index ccb5009..796e74c 100644 --- a/tests/tests/audio_tests/test_get_transcript.py +++ b/tests/tests/audio_tests/test_get_transcript.py @@ -1,7 +1,6 @@ import pytest from tests.utils.resource_utils import get_resource_path -@pytest.mark.skip(reason="Need to deploy ASR first") def test_get_transcription(textual_audio): path = get_resource_path('banking_customer_support.mp3') transcript = textual_audio.get_audio_transcript(path) diff --git a/tests/tests/audio_tests/test_redact_audio_file.py b/tests/tests/audio_tests/test_redact_audio_file.py index b4e7ac8..6b06081 100644 --- a/tests/tests/audio_tests/test_redact_audio_file.py +++ b/tests/tests/audio_tests/test_redact_audio_file.py @@ -1,7 +1,6 @@ import pytest from tests.utils.resource_utils import get_resource_path -@pytest.mark.skip(reason="Need to deploy ASR first") def test_redact_audio_file_does_not_throw(textual_audio): path = get_resource_path('banking_customer_support.mp3') textual_audio.redact_audio_file(path, 'output.mp3') diff --git a/tests/tests/audio_tests/test_redact_transcript.py b/tests/tests/audio_tests/test_redact_transcript.py index 5afc6f6..00e45a5 100644 --- a/tests/tests/audio_tests/test_redact_transcript.py +++ b/tests/tests/audio_tests/test_redact_transcript.py @@ -2,7 +2,6 @@ import pytest from tests.utils.resource_utils import get_resource_path -@pytest.mark.skip(reason="Need to deploy ASR first") def test_redact_transcript(textual_audio): path = get_resource_path('banking_customer_support.mp3') transcript = textual_audio.get_audio_transcript(path) From b661eff171ccaaed0b4bff2c3bf7b0c4efeef648 Mon Sep 17 00:00:00 2001 From: ethan-tonic Date: Wed, 3 Sep 2025 12:43:56 -0400 Subject: [PATCH 2/3] Formatting --- .../tests/audio_tests/test_get_transcript.py | 9 ++++---- .../audio_tests/test_redact_audio_file.py | 5 +++-- .../audio_tests/test_redact_transcript.py | 22 +++++++++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/tests/audio_tests/test_get_transcript.py b/tests/tests/audio_tests/test_get_transcript.py index 796e74c..d28fb59 100644 --- a/tests/tests/audio_tests/test_get_transcript.py +++ b/tests/tests/audio_tests/test_get_transcript.py @@ -1,9 +1,10 @@ import pytest from tests.utils.resource_utils import get_resource_path + def test_get_transcription(textual_audio): - path = get_resource_path('banking_customer_support.mp3') + path = get_resource_path("banking_customer_support.mp3") transcript = textual_audio.get_audio_transcript(path) - assert transcript.language=="english" or transcript.language=="en" - assert len(transcript.segments)>0 - assert len(transcript.text)>100 \ No newline at end of file + assert transcript.language == "english" or transcript.language == "en" + assert len(transcript.segments) > 0 + assert len(transcript.text) > 100 diff --git a/tests/tests/audio_tests/test_redact_audio_file.py b/tests/tests/audio_tests/test_redact_audio_file.py index 6b06081..4c7ac64 100644 --- a/tests/tests/audio_tests/test_redact_audio_file.py +++ b/tests/tests/audio_tests/test_redact_audio_file.py @@ -1,6 +1,7 @@ import pytest from tests.utils.resource_utils import get_resource_path + def test_redact_audio_file_does_not_throw(textual_audio): - path = get_resource_path('banking_customer_support.mp3') - textual_audio.redact_audio_file(path, 'output.mp3') + path = get_resource_path("banking_customer_support.mp3") + textual_audio.redact_audio_file(path, "output.mp3") diff --git a/tests/tests/audio_tests/test_redact_transcript.py b/tests/tests/audio_tests/test_redact_transcript.py index 00e45a5..511e701 100644 --- a/tests/tests/audio_tests/test_redact_transcript.py +++ b/tests/tests/audio_tests/test_redact_transcript.py @@ -2,15 +2,23 @@ import pytest from tests.utils.resource_utils import get_resource_path + def test_redact_transcript(textual_audio): - path = get_resource_path('banking_customer_support.mp3') + path = get_resource_path("banking_customer_support.mp3") transcript = textual_audio.get_audio_transcript(path) - assert len(transcript.segments)>0, "confirming transcript is likely valid before redacting" + assert len(transcript.segments) > 0, ( + "confirming transcript is likely valid before redacting" + ) - redacted_transcript = textual_audio.redact_audio_transcript(transcript, generator_default='Off',generator_config={'NAME_GIVEN':'Redaction'}) + redacted_transcript = textual_audio.redact_audio_transcript( + transcript, + generator_default="Off", + generator_config={"NAME_GIVEN": "Redaction"}, + ) - assert len(redacted_transcript.redacted_segments)==len(transcript.segments) - + assert len(redacted_transcript.redacted_segments) == len(transcript.segments) - NAME_GIVEN_RE = re.compile(r'\[NAME_GIVEN_[^\]]+\]') - assert bool(NAME_GIVEN_RE.search(redacted_transcript.redacted_text)), "assert we found a redacted first name" \ No newline at end of file + NAME_GIVEN_RE = re.compile(r"\[NAME_GIVEN_[^\]]+\]") + assert bool(NAME_GIVEN_RE.search(redacted_transcript.redacted_text)), ( + "assert we found a redacted first name" + ) From a8671123f8e4e893151cfd035f06c32983a54d64 Mon Sep 17 00:00:00 2001 From: ethan-tonic Date: Wed, 3 Sep 2025 13:57:31 -0400 Subject: [PATCH 3/3] Formatting --- tests/tests/audio_tests/test_get_transcript.py | 1 - tests/tests/audio_tests/test_redact_audio_file.py | 1 - tests/tests/audio_tests/test_redact_transcript.py | 1 - 3 files changed, 3 deletions(-) diff --git a/tests/tests/audio_tests/test_get_transcript.py b/tests/tests/audio_tests/test_get_transcript.py index d28fb59..8b883de 100644 --- a/tests/tests/audio_tests/test_get_transcript.py +++ b/tests/tests/audio_tests/test_get_transcript.py @@ -1,4 +1,3 @@ -import pytest from tests.utils.resource_utils import get_resource_path diff --git a/tests/tests/audio_tests/test_redact_audio_file.py b/tests/tests/audio_tests/test_redact_audio_file.py index 4c7ac64..2b27551 100644 --- a/tests/tests/audio_tests/test_redact_audio_file.py +++ b/tests/tests/audio_tests/test_redact_audio_file.py @@ -1,4 +1,3 @@ -import pytest from tests.utils.resource_utils import get_resource_path diff --git a/tests/tests/audio_tests/test_redact_transcript.py b/tests/tests/audio_tests/test_redact_transcript.py index 511e701..9b736b2 100644 --- a/tests/tests/audio_tests/test_redact_transcript.py +++ b/tests/tests/audio_tests/test_redact_transcript.py @@ -1,5 +1,4 @@ import re -import pytest from tests.utils.resource_utils import get_resource_path