Skip to content

Commit

Permalink
Remove response assertion in test
Browse files Browse the repository at this point in the history
  • Loading branch information
michellemounde committed Nov 14, 2023
1 parent cca77d4 commit 47a1fdf
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/web/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,46 +235,42 @@ def testGuardianResponse(client, version, buildTarget, channel, code, response):

@pytest.mark.usefixtures("appconfig", "guardian_db", "disable_errorhandler", "mock_autograph")
@pytest.mark.parametrize(
"version,buildTarget,channel,code,response,jsonString",
"version,buildTarget,channel,code,jsonString",
[
(
"0.4.0.0",
"WINNT_x86_64",
"release",
200,
{"required": True, "url": "https://good.com/0.5.0.0.msi", "version": "0.5.0.0", "hashFunction": "sha512", "hashValue": "abcdef"},
'{"hashFunction":"sha512","hashValue":"abcdef","required":true,"url":"https://good.com/0.5.0.0.msi","version":"0.5.0.0"}'
),
(
"0.6.0.0",
"WINNT_x86_64",
"release",
200,
{"required": True, "url": "https://good.com/1.0.0.0.msi", "version": "1.0.0.0", "hashFunction": "sha512", "hashValue": "mnopqr"},
'{"hashFunction":"sha512","hashValue":"mnopqr","required":true,"url":"https://good.com/1.0.0.0.msi","version":"1.0.0.0"}'
),
(
"0.99.99.99",
"WINNT_x86_64",
"release",
200,
{"required": True, "url": "https://good.com/1.0.0.0.msi", "version": "1.0.0.0", "hashFunction": "sha512", "hashValue": "mnopqr"},
'{"hashFunction":"sha512","hashValue":"mnopqr","required":true,"url":"https://good.com/1.0.0.0.msi","version":"1.0.0.0"}'
),
("1.0.0.0", "WINNT_x86_64", "release", 404, {}, "{}"),
("0.6.0.0", "Linux_x86_64", "release", 404, {}, "{}"),
("0.6.0.0", "WINNT_x86_64", "beta", 404, {}, "{}"),
("1.0.0.0", "WINNT_x86_64", "release", 404, "{}"),
("0.6.0.0", "Linux_x86_64", "release", 404, "{}"),
("0.6.0.0", "WINNT_x86_64", "beta", 404, "{}"),
# This shouldn't match because the rule on the alpha channel contains fields not used by this type of update query.
("0.6.0.0", "WINNT_x86_64", "alpha", 404, {}, "{}"),
("0.6.0.0", "Darwin_x86_64", "evilrelease", 200, {}, "{}"),
("0.6.0.0", "WINNT_x86_64", "alpha", 404, "{}"),
("0.6.0.0", "Darwin_x86_64", "evilrelease", 200, "{}"),
],
)
def testGuardianResponseWithCanonicalJson(client, version, buildTarget, channel, code, response, jsonString):
def testGuardianResponseWithCanonicalJson(client, version, buildTarget, channel, code, jsonString):
ret = client.get(f"/json/1/Guardian/{version}/{buildTarget}/{channel}/update.json")
assert ret.status_code == code
if code == 200:
assert ret.mimetype == "application/json"
assert ret.get_json() == response
assert ret.text == jsonString
assert ret.headers["Content-Signature"] == "x5u=https://this.is/a.x5u; p384ecdsa=abcdef"

Expand Down

0 comments on commit 47a1fdf

Please sign in to comment.