-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
125 lines (81 loc) · 2.59 KB
/
conftest.py
File metadata and controls
125 lines (81 loc) · 2.59 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import json
import logging
import os
import pathlib
import pytest
from reportportal_client import RPLogger
from mpt_api_client import AsyncMPTClient, MPTClient
@pytest.fixture
def base_url():
return os.getenv("MPT_API_BASE_URL")
@pytest.fixture
def mpt_vendor(base_url):
return MPTClient.from_config(api_token=os.getenv("MPT_API_TOKEN_VENDOR"), base_url=base_url) # type: ignore
@pytest.fixture
def async_mpt_vendor(base_url):
return AsyncMPTClient.from_config(
api_token=os.getenv("MPT_API_TOKEN_VENDOR"), base_url=base_url
) # type: ignore
@pytest.fixture
def mpt_ops(base_url):
return MPTClient.from_config(api_token=os.getenv("MPT_API_TOKEN_OPERATIONS"), base_url=base_url) # type: ignore
@pytest.fixture
def async_mpt_ops(base_url):
return AsyncMPTClient.from_config(
api_token=os.getenv("MPT_API_TOKEN_OPERATIONS"), base_url=base_url
) # type: ignore
@pytest.fixture
def mpt_client(base_url):
return MPTClient.from_config(api_token=os.getenv("MPT_API_TOKEN_CLIENT"), base_url=base_url) # type: ignore
@pytest.fixture
def async_mpt_client(base_url):
return AsyncMPTClient.from_config(
api_token=os.getenv("MPT_API_TOKEN_CLIENT"), base_url=base_url
) # type: ignore
@pytest.fixture
def rp_logger():
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logging.setLoggerClass(RPLogger)
return logger
@pytest.fixture
def logger():
return logging.getLogger("E2E")
@pytest.fixture
def project_root_path():
return pathlib.Path(__file__).parent.parent.parent
@pytest.fixture
def e2e_config(project_root_path):
filename = os.getenv("TEST_CONFIG_FILE", "e2e_config.test.json")
file_path = project_root_path.joinpath(filename)
return json.loads(file_path.read_text())
@pytest.fixture
def product_id(e2e_config):
return e2e_config["catalog.product.id"]
@pytest.fixture
def invalid_seller_id():
return "SEL-0000-0000"
@pytest.fixture
def seller_id(e2e_config):
return e2e_config["accounts.seller.id"]
@pytest.fixture
def account_id(e2e_config):
return e2e_config["accounts.account.id"]
@pytest.fixture
def invalid_account_id():
return "ACC-0000-0000"
@pytest.fixture
def invalid_buyer_id():
return "BUY-0000-0000"
@pytest.fixture
def buyer_id(e2e_config):
return e2e_config["accounts.buyer.id"]
@pytest.fixture
def buyer_account_id(e2e_config):
return e2e_config["accounts.buyer.account.id"]
@pytest.fixture
def user_group_id(e2e_config):
return e2e_config["accounts.user_group.id"]
@pytest.fixture
def invalid_user_group_id():
return "UGR-0000-0000"