From fe4ef1f2886de25d4871b52244ab48b894e99599 Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Sat, 17 Aug 2024 19:00:59 +0430 Subject: [PATCH] fix : error_test.py updated --- test/error_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/error_test.py b/test/error_test.py index c223720..a2f8b42 100644 --- a/test/error_test.py +++ b/test/error_test.py @@ -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") @@ -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.