forked from SEERNET/deepaffects-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_base_setup.py
More file actions
28 lines (22 loc) · 731 Bytes
/
Copy pathtest_base_setup.py
File metadata and controls
28 lines (22 loc) · 731 Bytes
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
import os
from unittest import TestCase, SkipTest
import deepaffects
DIR = os.path.dirname(os.path.realpath(__file__))
class AudioTest(TestCase):
def initialize_api(self):
pass
def setUp(self):
self.api_key = os.getenv("DEEPAFFECTS_API_KEY")
if not self.api_key:
raise ValueError(
"API Key needs to be defined in an environment variable DEEPAFFECTS_API_KEY to run tests."
)
deepaffects.configuration.api_key = self.api_key
self.initialize_api()
@staticmethod
def _require_numpy():
try:
import numpy as np
return np
except ImportError:
raise SkipTest("Numpy is not installed!")