Skip to content

Commit

Permalink
test: record network requests using pytest-recording
Browse files Browse the repository at this point in the history
  • Loading branch information
pyoor committed Dec 5, 2024
1 parent f4390c2 commit 7f48694
Show file tree
Hide file tree
Showing 8 changed files with 1,281 additions and 2 deletions.
423 changes: 422 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pytest-black = "^0.3.12"
pytest-cov = "^6.0.0"
pytest-mock = "^3.12.0"
pytest-pylint = "^0.21.0"
pytest-recording = "^0.13.2"
python-semantic-release = "^9.15.1"
toml-sort = "^0.24.2"
types-requests = "^2.31.0.10"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.32.3
method: GET
uri: https://hg.mozilla.org/mozilla-central/raw-file/tip/config/milestone.txt
response:
body:
string: '# Holds the current milestone.
# Should be in the format of
#
# x.x.x
# x.x.x.x
# x.x.x+
#
# Referenced by build/moz.configure/init.configure.
# Hopefully I''ll be able to automate replacement of *all*
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
135.0a1
'
headers:
Access-Control-Allow-Origin:
- '*'
Cache-Control:
- no-cache
Connection:
- Keep-Alive
Content-Disposition:
- inline; filename="milestone.txt"
Content-Security-Policy:
- 'default-src ''none''; connect-src ''self'' https://bugzilla.mozilla.org/;
img-src ''self''; script-src https://hg.mozilla.org/static/ ''nonce-548S4gw7Rda8b5UxQy3Rkg'';
style-src ''self'' ''unsafe-inline''; upgrade-insecure-requests; frame-ancestors
https:'
Content-Type:
- text/plain; charset="UTF-8"
Date:
- Thu, 05 Dec 2024 14:37:18 GMT
Server:
- Apache
Strict-Transport-Security:
- max-age=31536000
Transfer-Encoding:
- chunked
Vary:
- Accept-Encoding
X-Cache-Info:
- 'not cacheable; response specified "Cache-Control: no-cache"'
X-Content-Type-Options:
- nosniff
content-length:
- '334'
status:
code: 200
message: Script output follows
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.32.3
method: GET
uri: https://product-details.mozilla.org/1.0/firefox_versions.json
response:
body:
string: "{\n \"FIREFOX_AURORA\": \"\",\n \"FIREFOX_DEVEDITION\": \"134.0b5\",\n
\ \"FIREFOX_ESR\": \"128.5.1esr\",\n \"FIREFOX_ESR115\": \"115.18.0esr\",\n
\ \"FIREFOX_ESR_NEXT\": \"\",\n \"FIREFOX_NIGHTLY\": \"135.0a1\",\n \"LAST_MERGE_DATE\":
\"2024-11-25\",\n \"LAST_RELEASE_DATE\": \"2024-11-26\",\n \"LAST_SOFTFREEZE_DATE\":
\"2024-11-21\",\n \"LAST_STRINGFREEZE_DATE\": \"2024-11-22\",\n \"LATEST_FIREFOX_DEVEL_VERSION\":
\"134.0b5\",\n \"LATEST_FIREFOX_OLDER_VERSION\": \"3.6.28\",\n \"LATEST_FIREFOX_RELEASED_DEVEL_VERSION\":
\"134.0b5\",\n \"LATEST_FIREFOX_VERSION\": \"133.0\",\n \"NEXT_MERGE_DATE\":
\"2025-01-06\",\n \"NEXT_RELEASE_DATE\": \"2025-01-07\",\n \"NEXT_SOFTFREEZE_DATE\":
\"2025-01-02\",\n \"NEXT_STRINGFREEZE_DATE\": \"2025-01-03\"\n}"
headers:
Age:
- '277'
Cache-Control:
- max-age=300
Connection:
- keep-alive
Content-Length:
- '709'
Content-Type:
- application/json
Date:
- Thu, 05 Dec 2024 14:32:44 GMT
ETag:
- '"cce9365f7f316218d2434fbc41cf5d58"'
Last-Modified:
- Wed, 04 Dec 2024 22:06:38 GMT
Server:
- AmazonS3
Vary:
- Accept-Encoding
Via:
- 1.1 cb8f9eeabb5079cbcdbabdbd476ce1a2.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- BUFqM-W8sG5KetHxpiVzp25iGRNZsLKqEmGuf70231EX0oegUk50qw==
X-Amz-Cf-Pop:
- ATL58-P5
X-Cache:
- Hit from cloudfront
access-control-allow-origin:
- '*'
strict-transport-security:
- max-age=31536000
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-xss-protection:
- 1; mode=block
status:
code: 200
message: OK
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- python-requests/2.32.3
method: GET
uri: https://product-details.mozilla.org/1.0/firefox_versions.json
response:
body:
string: "{\n \"FIREFOX_AURORA\": \"\",\n \"FIREFOX_DEVEDITION\": \"134.0b5\",\n
\ \"FIREFOX_ESR\": \"128.5.1esr\",\n \"FIREFOX_ESR115\": \"115.18.0esr\",\n
\ \"FIREFOX_ESR_NEXT\": \"\",\n \"FIREFOX_NIGHTLY\": \"135.0a1\",\n \"LAST_MERGE_DATE\":
\"2024-11-25\",\n \"LAST_RELEASE_DATE\": \"2024-11-26\",\n \"LAST_SOFTFREEZE_DATE\":
\"2024-11-21\",\n \"LAST_STRINGFREEZE_DATE\": \"2024-11-22\",\n \"LATEST_FIREFOX_DEVEL_VERSION\":
\"134.0b5\",\n \"LATEST_FIREFOX_OLDER_VERSION\": \"3.6.28\",\n \"LATEST_FIREFOX_RELEASED_DEVEL_VERSION\":
\"134.0b5\",\n \"LATEST_FIREFOX_VERSION\": \"133.0\",\n \"NEXT_MERGE_DATE\":
\"2025-01-06\",\n \"NEXT_RELEASE_DATE\": \"2025-01-07\",\n \"NEXT_SOFTFREEZE_DATE\":
\"2025-01-02\",\n \"NEXT_STRINGFREEZE_DATE\": \"2025-01-03\"\n}"
headers:
Age:
- '278'
Cache-Control:
- max-age=300
Connection:
- keep-alive
Content-Length:
- '709'
Content-Type:
- application/json
Date:
- Thu, 05 Dec 2024 14:32:44 GMT
ETag:
- '"cce9365f7f316218d2434fbc41cf5d58"'
Last-Modified:
- Wed, 04 Dec 2024 22:06:38 GMT
Server:
- AmazonS3
Vary:
- Accept-Encoding
Via:
- 1.1 002f46e348ce9568cd7a478ff65daf30.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
- YsQL7tlFjqWKnVAsTh4gkYWeHNJvy6GD64L_sHRyQ4sIdfrb8VqqGw==
X-Amz-Cf-Pop:
- ATL58-P5
X-Cache:
- Hit from cloudfront
access-control-allow-origin:
- '*'
strict-transport-security:
- max-age=31536000
x-content-type-options:
- nosniff
x-frame-options:
- SAMEORIGIN
x-xss-protection:
- 1; mode=block
status:
code: 200
message: OK
version: 1
Loading

0 comments on commit 7f48694

Please sign in to comment.