Repository navigation
Expand file tree
/
Copy pathbase_test_class.py
More file actions
49 lines (40 loc) · 1.68 KB
/
Copy pathbase_test_class.py
File metadata and controls
49 lines (40 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright © 2022 CCP ehf.
import json
import os
import unittest
import blue
from .utils import GetAudioMetadataFromFile
from .debug_utils import debug_delay_if_enabled
SOUNDBANK_FILEPATH = os.path.abspath(os.path.join(os.path.dirname(__file__), "test", "soundbanks"))
ONE_SHOT_BNK = "TestOneShot.bnk"
ONE_SHOT_EVENT = "Play_TestOneShot"
COMMON_BNK = "Common.bnk"
LOOP_BNK = "TestLoop.bnk"
LOOP_EVENT = "Play_TestLoop"
LOAD_BANK_BNK = "TestLoadBank.bnk"
LOAD_BANK_EVENT = "Play_TestLoadBank"
ESSENTIAL_BNK = "TestMusicEssential.bnk"
ESSENTIAL_EVENT = "Play_TestEssential"
NONESSENTIAL_BNK = "NonEssentialSoundBank.bnk"
NONESSENTIAL_BNK_EVENT = "Play_NonEssentialBank"
NONESSENTIAL_STREAM_BNK = "NonEssentialStream.bnk"
NONESSENTIAL_STREAM_EVENT = "Play_NonEssentialStream"
class BaseAudio2TestClass(unittest.TestCase):
"""Initializes Wwise for other test classes."""
@classmethod
def setUpClass(cls):
from audio2.audiomanager import AudioManager
super().setUpClass()
# Add a delay to the test if configured.
debug_delay_if_enabled()
blue.paths.SetSearchPath("soundbanks", SOUNDBANK_FILEPATH)
applicationName = "Audio2 Testing"
baseSoundbankPath = "soundbanks:/"
languageDirectory = "English(US)"
cls.audioManager = AudioManager(baseSoundbankPath, languageDirectory, applicationName)
def Initialize(self, defaultSoundBanks=[]):
audioMetadata = GetAudioMetadataFromFile()
self.audioManager.Initialize(audioMetadata, defaultSoundBanks=defaultSoundBanks)
def alwaysTrueBoolean(self):
'''This can be used with the PumpOsWithTimeout function to simply have it pump a few times.'''
return True