-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconftest.py
More file actions
90 lines (58 loc) · 1.79 KB
/
conftest.py
File metadata and controls
90 lines (58 loc) · 1.79 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
from os import getenv
from pathlib import Path
import pytest
from aiohttp import ClientSession
from dotenv import load_dotenv
from src.tf2_utils.utils import read_json_file
assert load_dotenv()
MARKETPLACE_TF_API_KEY = getenv("MARKETPLACE_TF_API_KEY")
BACKPACK_TF_TOKEN = getenv("BACKPACK_TF_TOKEN")
EXPRESS_LOAD_API_KEY = getenv("EXPRESS_LOAD_API_KEY")
def get_item_data(file_name: str) -> dict:
path = Path(__file__).parent / f"tests/json/{file_name}.json"
return read_json_file(path)
# items
CRUSADERS_CROSSBOW = get_item_data("crusaders_crossbow")
UNCRAFTABLE_HAT = get_item_data("uncraftable_hat")
HONG_KONG_CONE = get_item_data("hong_kong_cone")
SPELLED_ITEM = get_item_data("spelled_item")
PAINTED_HAT = get_item_data("painted_hat")
ELLIS_CAP = get_item_data("ellis_cap")
@pytest.fixture
def steam_id() -> str:
return "76561198253325712"
@pytest.fixture
def account_id() -> str:
return "293059984"
@pytest.fixture
def marketplace_tf_api_key() -> str:
return MARKETPLACE_TF_API_KEY
@pytest.fixture
def backpack_tf_token() -> str:
return BACKPACK_TF_TOKEN
@pytest.fixture
def express_load_api_key() -> str:
return EXPRESS_LOAD_API_KEY
# items
@pytest.fixture
def crusaders_crossbow() -> dict:
return CRUSADERS_CROSSBOW
@pytest.fixture
def uncraftable_hat() -> dict:
return UNCRAFTABLE_HAT
@pytest.fixture
def hong_kong_cone() -> dict:
return HONG_KONG_CONE
@pytest.fixture
def spelled_item() -> dict:
return SPELLED_ITEM
@pytest.fixture
def painted_hat() -> dict:
return PAINTED_HAT
@pytest.fixture
def ellis_cap() -> dict:
return ELLIS_CAP
@pytest.fixture
async def aiohttp_session():
async with ClientSession() as session:
yield session