Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tests (and github automation) to library #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
1 change: 1 addition & 0 deletions tests/pallas/assest-tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pallas.asset import Asset, VersionIdentifier, VersionCompatibilities
26 changes: 26 additions & 0 deletions tests/pallas/response-tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from datetime import datetime

from pallas.response import Response
from pallas.utils.Assets import UAFAssets
from pallas.utils.Audience import Audience

def test_response():
example_response = {
"Nonce": "abc123",
"PallasNonce": "def456",
"SessionId": "ghi789",
"LegacyXmlUrl": "jkl012",
"PostingDate": datetime.now().strftime("%Y-%m-%d"),
"Assets": [],
"AssetSetId": "75cfb472-8fe2-4c35-8e2d-5e59fc97af03",
"AssetAudience": "d0854246-c9d0-456e-a2c7-7183c5bf11d1"
}
resp = Response(response=example_response)
assert resp.asset_audience == example_response["AssetAudience"]
assert resp.asset_set_id == example_response["AssetSetId"]
assert resp.assets == example_response["Assets"]
assert resp.posting_date == example_response["PostingDate"]
assert resp.legacy_xml_url == example_response["LegacyXmlUrl"]
assert resp.session_id == example_response["SessionId"]
assert resp.pallas_nonce == example_response["PallasNonce"]
assert resp.nonce == example_response["Nonce"]
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions tests/pallas/utils/pallasrequest-tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from pallas.utils.PallasRequest import PallasRequest
from pallas.utils.Audience import Audience
from pallas.utils.Assets import UAFAssets
from pallas.utils.DeviceType import DeviceType
from pallas.utils.OSTrainDevicePair import OSTrainDevicePair

def test_pallasrequest():
pr = PallasRequest()
pallas_resp = pr.request(asset_audience=Audience.ios_generic,
asset_type=UAFAssets.SiriPlatformAssets,
device_type=DeviceType.iPhone,
train_name=OSTrainDevicePair.CrystalSeed)