From 85705df44b77ee51679cf146cc35d1241e837e3c Mon Sep 17 00:00:00 2001 From: sepandhaghighi Date: Sat, 10 Feb 2024 19:09:35 +0330 Subject: [PATCH] fix : tests updated --- test/function_test.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/function_test.py b/test/function_test.py index 058f1ed..be68a5a 100644 --- a/test/function_test.py +++ b/test/function_test.py @@ -2,23 +2,26 @@ """ >>> import os >>> import time ->>> from nava import play, stop, stop_all ->>> play(os.path.join("others", "test.wav")) ->>> sound_id_1 = play(os.path.join("others", "test.wav"), async_mode=True) +>>> import nava +>>> nava.play(os.path.join("others", "test.wav")) +>>> sound_id_1 = nava.play(os.path.join("others", "test.wav"), async_mode=True) >>> sound_id_1 == 1001 True ->>> sound_id_2 = play(os.path.join("others", "test.wav"), async_mode=True) +>>> sound_id_2 = nava.play(os.path.join("others", "test.wav"), async_mode=True) >>> sound_id_2 == 1002 True ->>> sound_id_3 = play(os.path.join("others", "test.wav"), async_mode=True) +>>> sound_id_3 = nava.play(os.path.join("others", "test.wav"), async_mode=True) >>> sound_id_3 == 1003 True ->>> stop(1001) ->>> stop_all() +>>> nava.stop(sound_id_1) >>> for i in range(40): ... sound_id = play(os.path.join("others", "test.wav"), async_mode=True) -... time.sleep(0.5) -... stop(sound_id) +... time.sleep(0.2) +>>> nava.stop_all() +>>> len(nava._play_threads_map) == 43 +True +>>> nava._play_threads_counter == 43 +True >>> from nava.functions import nava_help >>> nava_help()