From fd043d5258e73314d823ae3ea34bfee11d4df8b0 Mon Sep 17 00:00:00 2001 From: Antoine Minard Date: Mon, 25 Nov 2024 14:26:20 +0100 Subject: [PATCH] Fix tests not finding test spectrum file --- .../sound/core/sound_composer/source_spectrum.py | 6 ------ .../test_sound_composer_source_spectrum.py | 12 ------------ 2 files changed, 18 deletions(-) diff --git a/src/ansys/sound/core/sound_composer/source_spectrum.py b/src/ansys/sound/core/sound_composer/source_spectrum.py index d8657769..58557443 100644 --- a/src/ansys/sound/core/sound_composer/source_spectrum.py +++ b/src/ansys/sound/core/sound_composer/source_spectrum.py @@ -21,7 +21,6 @@ # SOFTWARE. """Sound Composer's spectrum source.""" -import os import warnings from ansys.dpf.core import Field, Operator @@ -146,11 +145,6 @@ def load_source_spectrum(self, file_source: str): Path to the spectrum file. Supported files are the same XML and text (with the AnsysSound_Spectrum header) formats as supported by Ansys Sound SAS. """ - if not os.path.exists(file_source): - raise PyAnsysSoundException( - f"Specified spectrum source file '{file_source}' does not exist." - ) - # Set operator inputs. self.__operator_load.connect(0, file_source) diff --git a/tests/tests_sound_composer/test_sound_composer_source_spectrum.py b/tests/tests_sound_composer/test_sound_composer_source_spectrum.py index 7a4589d7..9b938552 100644 --- a/tests/tests_sound_composer/test_sound_composer_source_spectrum.py +++ b/tests/tests_sound_composer/test_sound_composer_source_spectrum.py @@ -130,18 +130,6 @@ def test_source_specrum_load_source(dpf_sound_test_server): assert source_spectrum.source_spectrum_data.data[3] == pytest.approx(EXP_SPECTRUM_DATA3) -def test_source_spectrum_load_source_exceptions(dpf_sound_test_server): - """Test SourceSpectrum load_source method exceptions.""" - source_spectrum = SourceSpectrum() - - # Test load_source method exception. - with pytest.raises( - PyAnsysSoundException, match="Specified spectrum source file 'InvalidPath' does not exist." - ): - source_spectrum.load_source_spectrum("InvalidPath") - assert source_spectrum.source_spectrum_data is None - - def test_source_spectrum_process(dpf_sound_test_server): """Test SourceSpectrum process method.""" source_spectrum = SourceSpectrum(