forked from Vonage/vonage-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
46 lines (33 loc) · 1.07 KB
/
Copy pathconftest.py
File metadata and controls
46 lines (33 loc) · 1.07 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
import os
import os.path
import platform
import pytest
# Ensure our client isn't being configured with real values!
os.environ.clear()
def read_file(path):
with open(os.path.join(os.path.dirname(__file__), path)) as input_file:
return input_file.read()
class DummyData(object):
def __init__(self):
import nexmo
self.api_key = "nexmo-api-key"
self.api_secret = "nexmo-api-secret"
self.signature_secret = "secret"
self.application_id = "nexmo-application-id"
self.private_key = read_file("data/private_key.txt")
self.public_key = read_file("data/public_key.txt")
self.user_agent = "nexmo-python/{}/{}".format(
nexmo.__version__, platform.python_version()
)
@pytest.fixture(scope="session")
def dummy_data():
return DummyData()
@pytest.fixture
def client(dummy_data):
import nexmo
return nexmo.Client(
key=dummy_data.api_key,
secret=dummy_data.api_secret,
application_id=dummy_data.application_id,
private_key=dummy_data.private_key,
)