-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enriched press summaries were being submitted to /judgment-url/press/summary/1?unlock=True, not press-summary. We special case press-summary as a quick fix.
- Loading branch information
1 parent
9957eca
commit 31aff74
Showing
6 changed files
with
40 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
[pytest] | ||
addopts = --disable-socket --allow-hosts=127.0.0.1 --allow-hosts=localhost | ||
env = | ||
SOURCE_BUCKET=X | ||
API_USERNAME=X | ||
API_PASSWORD=X | ||
ENVIRONMENT=X |
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
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
28 changes: 28 additions & 0 deletions
28
src/tests/lambda_tests/push_enriched_xml/test_push_enriched_xml.py
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,28 @@ | ||
# from lambdas.push_enriched_xml.index import ( # noqa: E402 | ||
# process_event, | ||
# ) | ||
from unittest.mock import patch | ||
|
||
from lambdas.push_enriched_xml.index import ( # noqa: E402 | ||
process_event, | ||
) | ||
|
||
|
||
class FakeSQSRecord(dict): | ||
def __init__(self): | ||
self.body = '{"Validated": true}' | ||
self["messageAttributes"] = { | ||
"source_key": {"stringValue": "uksc/2024/1/press-summary/1"}, | ||
"source_bucket": {"stringValue": ""}, | ||
} | ||
self["Validated"] = None | ||
|
||
|
||
@patch("lambdas.push_enriched_xml.index.boto3") | ||
@patch("lambdas.push_enriched_xml.index.requests") | ||
def test_patch_url_has_press_summary_with_a_hyphen(requests, boto3): | ||
process_event(FakeSQSRecord()) | ||
assert ( | ||
requests.patch.call_args_list[0][0][0] | ||
== "https://api.caselaw.nationalarchives.gov.uk/judgment/uksc/2024/1/press-summary/1" | ||
) |
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