Skip to content

Commit

Permalink
fix : error_test.py updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Aug 17, 2024
1 parent d410e14 commit fe4ef1f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/error_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
"""
>>> import os
>>> import sys
>>> from nava import play, stop
>>> test_sound_path = os.path.join("others", "test.wav")
>>> play("test.wav")
Expand All @@ -23,6 +24,25 @@
Traceback (most recent call last):
...
nava.errors.NavaBaseError: `engine` type must be `Engine` enum.
>>> sys_platform = sys.platform
>>> if sys_platform == "win32":
... sound_id = nava.play(test_sound_path, async_mode=False, engine=nava.Engine.AFPLAY)
... elif sys_platform == "darwin":
... sound_id = nava.play(test_sound_path, async_mode=False, engine=nava.Engine.WINSOUND)
... else:
... sound_id = nava.play(test_sound_path, async_mode=False, engine=nava.Engine.WINSOUND)
Traceback (most recent call last):
...
nava.errors.NavaBaseError: Sound can not play due to some issues.
>>> if sys_platform == "win32":
... sound_id = nava.play(test_sound_path, async_mode=True, engine=nava.Engine.AFPLAY)
... elif sys_platform == "darwin":
... sound_id = nava.play(test_sound_path, async_mode=True, engine=nava.Engine.WINSOUND)
... else:
... sound_id = nava.play(test_sound_path, async_mode=True, engine=nava.Engine.WINSOUND)
Traceback (most recent call last):
...
nava.errors.NavaBaseError: Sound can not play due to some issues.
>>> import nava
>>> nava.functions.play_cli("test2.wav")
Error: Given sound file doesn't exist.
Expand Down

0 comments on commit fe4ef1f

Please sign in to comment.