-
Notifications
You must be signed in to change notification settings - Fork 0
/
conftest.py
32 lines (24 loc) · 830 Bytes
/
conftest.py
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
from livechat.agent.rtm.client import AgentRTM
from livechat.customer.rtm.client import CustomerRTM
from livechat.configuration.client import ConfigurationApi
import pytest
@pytest.fixture
def agent_rtm():
return AgentRTM.get_client()
@pytest.fixture
def customer_rtm(pytestconfig):
return CustomerRTM.get_client(int(pytestconfig.getoption('--license')))
@pytest.fixture
def configuration_api(pytestconfig):
return ConfigurationApi.get_api_client(token=pytestconfig.getoption('--agent'))
@pytest.fixture(autouse=True)
def teardown(agent_rtm, customer_rtm):
yield
agent_rtm.logout()
agent_rtm.ws.close()
customer_rtm.ws.close()
def pytest_addoption(parser):
parser.addoption('--agent')
parser.addoption('--customer')
parser.addoption('--license')
parser.addoption('--client_id')