Skip to content

Commit

Permalink
Removed test len>0 for SourceControlTime, as sound composer projects …
Browse files Browse the repository at this point in the history
…can be saved in SAS even without defining source control (in which case it is empty)
  • Loading branch information
ansaminard committed Jan 6, 2025
1 parent 9fe5786 commit 3946f9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/ansys/sound/core/sound_composer/source_control_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ def control(self, control: Field):
"Specified control profile must be provided as a DPF field."
)

if len(control.data) == 0:
raise PyAnsysSoundException(
"Specified control profile must have at least one element."
)

self.__control = control

def load_from_wave_file(self, file_str: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,17 @@ def test_source_control_time_properties():
assert len(control_time.control.data) > 0


def test_source_control_time_propertiess_exceptions():
def test_source_control_time_properties_exceptions():
"""Test SourceControlTime properties' exceptions."""
control_time = SourceControlTime()

# Test control setter exception 1 (wrong control type).
# Test control setter exception (wrong control type).
with pytest.raises(
PyAnsysSoundException,
match="Specified control profile must be provided as a DPF field.",
):
control_time.control = "WrongType"

# Test control setter exception 2 (empty control).
with pytest.raises(
PyAnsysSoundException,
match="Specified control profile must have at least one element.",
):
control_time.control = Field()


def test_source_control_time___str__():
"""Test SourceControlTime __str__ method."""
Expand Down

0 comments on commit 3946f9c

Please sign in to comment.