def test_get_sound_with_default_config(default): # this test is a bit long (it loads all the default sounds) res = default res.language = "fr" sounds.load_default(res) assert sounds.get_sound("9999") is not None assert sounds.get_sound("fdsgedtgf") is None
def test_get_sound_with_default_config(default): # this test is a bit long (it loads all the default sounds) res = default res.language = "fr" sounds.load_default(res) assert sounds.get_sound("9999") is not None assert sounds.get_sound("fdsgedtgf") is None
def test_get_sound(test): res = test res.language = "en" sounds.load_default(res) assert sounds.get_sound("1000") is None assert sounds.get_sound("fdsgedtgf") is None assert sounds.get_sound("9998") is not None assert sounds.get_sound("9999") is None assert sounds.get_sound("1028") is None
def test_get_sound(test): res = test res.language = "en" sounds.load_default(res) assert sounds.get_sound("1000") is None assert sounds.get_sound("fdsgedtgf") is None assert sounds.get_sound("9998") is not None assert sounds.get_sound("9999") is None assert sounds.get_sound("1028") is None
def test_get_sound_with_locale(test): res = test res.language = "fr" sounds.load_default(res) assert sounds.get_sound("1000") is None assert sounds.get_sound("fdsgedtgf") is None assert sounds.get_sound("9998") is not None assert sounds.get_sound("9999") is not None # a sound can be stored in a sub directory assert sounds.get_sound("1028") is not None
def test_get_sound_with_locale(test): res = test res.language = "fr" sounds.load_default(res) assert sounds.get_sound("1000") is None assert sounds.get_sound("fdsgedtgf") is None assert sounds.get_sound("9998") is not None assert sounds.get_sound("9999") is not None # a sound can be stored in a sub directory assert sounds.get_sound("1028") is not None
def test_unpacked_folder_map_redefines_sound(test): from soundrts.mapfile import Map default_sound = sounds.get_sound("9998") m = Map(unpack=Map("soundrts/tests/single/map1").pack()) m.load_resources() assert isinstance(sounds.get_sound("9998"), pygame.mixer.Sound) assert sounds.get_sound("9998") is not default_sound m.unload_resources() assert sounds.get_sound("9998") is default_sound