-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ venv/ | |
appconfig* | ||
|
||
# Python build artifacts | ||
.eggs/ | ||
*.egg-info/ | ||
build/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ pydantic | |
httpx | ||
aiortc | ||
construct | ||
dpkt | ||
dpkt | ||
|
||
wheel | ||
pytest-runner | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,5 +24,10 @@ | |
"aiortc", | ||
"construct", | ||
"dpkt" | ||
] | ||
], | ||
setup_requires=[ | ||
"wheel", | ||
"pytest-runner" | ||
], | ||
tests_require=["pytest"] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from typing import Dict | ||
import os | ||
import pytest | ||
|
||
@pytest.fixture(scope='session') | ||
def test_data() -> Dict[str, bytes]: | ||
data = {} | ||
data_path = os.path.join(os.path.dirname(__file__), 'data') | ||
for f in os.listdir(data_path): | ||
with open(os.path.join(data_path, f), 'rb') as fh: | ||
data[f] = fh.read() | ||
|
||
return data |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import uuid | ||
import json | ||
from xcloud.common import AppConfiguration | ||
|
||
def test_appconfig(test_data: dict): | ||
appconfig = test_data["appconfig_no_tokens.json"].decode('utf-8') | ||
appconfig = json.loads(appconfig) | ||
|
||
config = AppConfiguration(**appconfig) | ||
|
||
assert config.SigningKey.startswith("-----BEGIN EC PRIVATE KEY-----\nMH") | ||
assert config.WindowsLiveTokens is None | ||
assert config.XalParameters is not None | ||
assert config.ClientUUID == uuid.UUID("78af29d1-7572-4861-9ce2-1cd99830b9e7") | ||
assert config.XalParameters.AppId == "000000004415494b" |