Skip to content

Commit

Permalink
Fix tests not finding test spectrum file
Browse files Browse the repository at this point in the history
  • Loading branch information
ansaminard committed Nov 25, 2024
1 parent 786b04d commit fd043d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
6 changes: 0 additions & 6 deletions src/ansys/sound/core/sound_composer/source_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
# SOFTWARE.

"""Sound Composer's spectrum source."""
import os
import warnings

from ansys.dpf.core import Field, Operator
Expand Down Expand Up @@ -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)

Expand Down
12 changes: 0 additions & 12 deletions tests/tests_sound_composer/test_sound_composer_source_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fd043d5

Please sign in to comment.