From 6e37e3a126e5e054c3be4dd8f463116a32181e40 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Fri, 17 Jan 2025 16:14:32 +0100 Subject: [PATCH] single plat --- e2e-tests/cmd_test.py | 96 +++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 64 deletions(-) diff --git a/e2e-tests/cmd_test.py b/e2e-tests/cmd_test.py index ce7674f..13f52d8 100644 --- a/e2e-tests/cmd_test.py +++ b/e2e-tests/cmd_test.py @@ -43,7 +43,7 @@ def _get_utterances(self, directory): return utterances def _assert_dubbing_action(self, directory): - operating = platform.system().lower() + # operating = platform.system().lower() utterances = self._get_utterances(directory) text_array = [entry["translated_text"] for entry in utterances] @@ -56,69 +56,37 @@ def _assert_dubbing_action(self, directory): ends = [entry["end"] for entry in utterances] speeds = [entry["speed"] for entry in utterances] - if operating == "darwin": - assert 3 == len(utterances) - - assert np.allclose( - [ - 1.26284375, - 2.44409375, - 5.24534375, - 7.607843750000001, - ], - starts, - atol=0.5, - ), "Utterance start check failed" - - assert np.allclose( - [ - 2.17409375, - 3.94596875, - 6.61221875, - 8.687843750000003, - ], - ends, - atol=0.5, - ), "Utterance end check failed" - - assert "- Bon dia. - Bé." == text_array[0], "translated text 0" - assert "Em dic Jordi Mas." == text_array[1], "translated text 1" - assert "Sóc de Barcelona." == text_array[2], "translated text 2" - assert "I m'encanta aquesta ciutat." == text_array[3], "translated text 3" - - else: - assert 3 == len(utterances) - print(f"starts: {starts}") - - assert np.allclose( - [ - 1.26284375, - 5.24534375, - 7.607843750000001, - ], - starts, - atol=0.5, - ), "Utterance start check failed" - - print(f"ends: {ends}") - assert np.allclose( - [ - 3.94596875, - 6.629093750000001, - 8.687843750000003, - ], - ends, - atol=0.5, - ), "Utterance end check failed" - - print(f"speeds: {speeds}") - assert np.allclose( - [1.0, 1.0, 1.3], speeds, atol=2 - ), "Utterance speed check failed" - - assert "Bon dia, em dic Jordi Mas." == text_array[0], "translated text 0" - assert "Sóc de Barcelona." == text_array[1], "translated text 1" - assert "I m'encanta aquesta ciutat." == text_array[2], "translated text 2" + print(f"starts: {starts}") + + assert np.allclose( + [ + 1.26284375, + 5.24534375, + 7.607843750000001, + ], + starts, + atol=0.5, + ), "Utterance start check failed" + + print(f"ends: {ends}") + assert np.allclose( + [ + 3.94596875, + 6.629093750000001, + 8.687843750000003, + ], + ends, + atol=0.5, + ), "Utterance end check failed" + + print(f"speeds: {speeds}") + assert np.allclose( + [1.0, 1.0, 1.3], speeds, atol=2 + ), "Utterance speed check failed" + + assert "Bon dia, em dic Jordi Mas." == text_array[0], "translated text 0" + assert "Sóc de Barcelona." == text_array[1], "translated text 1" + assert "I m'encanta aquesta ciutat." == text_array[2], "translated text 2" def _assert_update_action(self, directory): operating = platform.system().lower()