-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconftest.py
More file actions
70 lines (42 loc) · 1.46 KB
/
conftest.py
File metadata and controls
70 lines (42 loc) · 1.46 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
import json
from base64 import b64encode
import pytest
from steampie.client import SteamClient
def my_steam_id() -> str:
return "76561198253325712"
@pytest.fixture
def partner_steam_id() -> str:
return "76561198155938401"
@pytest.fixture
def partner_trade_url() -> str:
return "https://steamcommunity.com/tradeoffer/new/?partner=195672673&token=k3YfpXNU"
@pytest.fixture
def shared_secret() -> bytes:
return b64encode(b"1234567890abcdefghij")
@pytest.fixture
def identity_secret() -> bytes:
return b64encode(b"abcdefghijklmnoprstu")
def get_credentials() -> dict:
steam_credentials = {}
with open("./credentials.json", "r") as f:
steam_credentials = json.load(f)
return steam_credentials
@pytest.fixture
def credentials() -> dict:
return get_credentials()
@pytest.fixture
def steam_guard_file() -> dict:
steam_guard_credentials = {}
steam_id = my_steam_id()
with open(f"./{steam_id}.maFile", "r") as f:
steam_guard_credentials = json.load(f)
steam_credentials = get_credentials()
steam_guard_credentials["password"] = steam_credentials["password"]
steam_guard_credentials["api_key"] = steam_credentials["api_key"]
return steam_guard_credentials
steam_credentials = get_credentials()
steam_client = SteamClient(**steam_credentials)
steam_client.login()
@pytest.fixture
def client() -> SteamClient:
return steam_client