From d73fe4bb20e544443476ebb4c9fc593fa0a8ad4a Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 27 Apr 2024 02:20:46 +0300 Subject: fix tests --- tests/test_sfx.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests/test_sfx.py') diff --git a/tests/test_sfx.py b/tests/test_sfx.py index 1aaf53e..35483a5 100644 --- a/tests/test_sfx.py +++ b/tests/test_sfx.py @@ -18,3 +18,27 @@ class TestSfx(unittest.TestCase): def test_play(self): sfx.play("laser") + + def test_music(self): + sfx.music("baby") + sfx.music("baby") + sfx.music("glass") + sfx.music(None) + + def test_sfx_volume_control(self): + old_vol = sfx.sfx_volume + sfx.sfx_up() + self.assertNotEqual(old_vol, sfx.sfx_volume) + for _ in range(10): + sfx.sfx_up() + self.assertEqual(old_vol, sfx.sfx_volume) + + def test_music_volume_control(self): + old_vol = sfx.music_volume + sfx.music(None) + sfx.music_up() + sfx.music("glass") + self.assertNotEqual(old_vol, sfx.music_volume) + for _ in range(10): + sfx.music_up() + self.assertEqual(old_vol, sfx.music_volume) -- cgit v1.2.3