gh-131453: Add additional constants to winsound module (GH-131454)

This commit is contained in:
AN Long 2025-03-21 01:35:52 +09:00 committed by GitHub
parent a2ea417578
commit 00a9844888
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 81 additions and 1 deletions

View file

@ -82,6 +82,18 @@ class MessageBeepTest(unittest.TestCase):
def test_question(self):
safe_MessageBeep(winsound.MB_ICONQUESTION)
def test_error(self):
safe_MessageBeep(winsound.MB_ICONERROR)
def test_information(self):
safe_MessageBeep(winsound.MB_ICONINFORMATION)
def test_stop(self):
safe_MessageBeep(winsound.MB_ICONSTOP)
def test_warning(self):
safe_MessageBeep(winsound.MB_ICONWARNING)
def test_keyword_args(self):
safe_MessageBeep(type=winsound.MB_OK)
@ -161,6 +173,15 @@ class PlaySoundTest(unittest.TestCase):
# does not raise on systems without a sound card.
winsound.PlaySound(None, winsound.SND_PURGE)
def test_sound_sentry(self):
safe_PlaySound("SystemExit", winsound.SND_ALIAS | winsound.SND_SENTRY)
def test_sound_sync(self):
safe_PlaySound("SystemExit", winsound.SND_ALIAS | winsound.SND_SYNC)
def test_sound_system(self):
safe_PlaySound("SystemExit", winsound.SND_ALIAS | winsound.SND_SYSTEM)
if __name__ == "__main__":
unittest.main()