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

Update to vcrpy-6.0.2 #250

Open
wants to merge 2 commits 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
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- run: pytest
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
NOTION_TEST_PAGE_ID: ${{ secrets.NOTION_TEST_PAGE_ID }}
- uses: codecov/codecov-action@v5
with:
env_vars: PYTHON
Expand Down
3 changes: 0 additions & 3 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ pytest-asyncio
pytest-cov
pytest-timeout
pytest-vcr

# I'm unable to use vcrpy 6.x cassettes (UnicodeDecodeError on JSON body), let's try again later
vcrpy<6
9 changes: 6 additions & 3 deletions tests/cassettes/test_api_async_request_bad_request_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ interactions:
method: GET
uri: https://mock.httpstatus.io/400
response:
content: 400 Bad Request
body:
string: !!binary |
H4sIAAAAAAAE/zMxMFBwSkxRCEotLE0tLgEA1aEoBA8AAAA=
headers: {}
http_version: HTTP/1.1
status_code: 400
status:
code: 400
message: Bad Request
version: 1
27 changes: 27 additions & 0 deletions tests/cassettes/test_api_http_response_error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
interactions:
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
authorization:
- ntn_...
connection:
- keep-alive
host:
- mock.httpstatus.io
notion-version:
- '2022-06-28'
method: GET
uri: https://mock.httpstatus.io/400
response:
body:
string: !!binary |
H4sIAAAAAAAE/zMxMFBwSkxRCEotLE0tLgEA1aEoBA8AAAA=
headers: {}
status:
code: 400
message: Bad Request
version: 1
20 changes: 12 additions & 8 deletions tests/cassettes/test_api_response_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ interactions:
method: GET
uri: https://api.notion.com/v1/invalid
response:
content: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
body:
string: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
headers: {}
http_version: HTTP/1.1
status_code: 400
status:
code: 400
message: Bad Request
- request:
body: ''
headers:
Expand All @@ -40,9 +42,11 @@ interactions:
method: GET
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"15ca8906-fcb1-4d90-b25a-ad03ba508350"}'
body:
string: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"b85cdcf1-7ec8-4eac-8ce8-05dc3da2eae9"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
status:
code: 401
message: Unauthorized
version: 1
20 changes: 12 additions & 8 deletions tests/cassettes/test_async_api_response_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ interactions:
method: GET
uri: https://api.notion.com/v1/invalid
response:
content: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
body:
string: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
headers: {}
http_version: HTTP/1.1
status_code: 400
status:
code: 400
message: Bad Request
- request:
body: ''
headers:
Expand All @@ -40,9 +42,11 @@ interactions:
method: GET
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"d11a2027-fae9-4cad-a6ea-ab6e34136dc5"}'
body:
string: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"81436b9e-4c86-43e6-aa51-7840e8bee746"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
status:
code: 401
message: Unauthorized
version: 1
26 changes: 18 additions & 8 deletions tests/cassettes/test_async_client_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ interactions:
method: GET
uri: https://api.notion.com/v1/invalid
response:
content: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
body:
string: '{"object":"error","status":400,"code":"invalid_request_url","message":"Invalid
request URL."}'
headers: {}
http_version: HTTP/1.1
status_code: 400
status:
code: 400
message: Bad Request
- request:
body: ''
headers:
Expand All @@ -40,9 +42,17 @@ interactions:
method: GET
uri: https://api.notion.com/v1/users
response:
content: '{"object":"list","results":[{"object":"user","id":"a4f789cc-7bc8-4cf0-82b9-a8ba7d985ecf","name":"Guillaume
Gelin","avatar_url":"https://s3-us-west-2.amazonaws.com/public.notion-static.com/01d7053d-e135-4f27-bba0-5de532d39296/ramnes3.jpeg","type":"person","person":{"email":"[email protected]"}},{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78","name":"notion-sdk-py","avatar_url":null,"type":"bot","bot":{"owner":{"type":"workspace","workspace":true},"workspace_name":"notion-sdk-py"}}],"next_cursor":null,"has_more":false,"type":"user","user":{},"request_id":"9f260c07-a0cf-4dda-afa0-2c6e005301c5"}'
body:
string: !!binary |
H4sIAAAAAAAAA3RSSW7cMBD8StBntUYjauXJNz8iMIQm1YxlU6LCxRNH0N8DecYLguTCLrBA1MLe
wKkn1hEk2ClEyMBzSDYGkN+3Ty4F9pDBNIIEqkzb9Vpjq3SHlTYFdqXqkTpF7dh3NWsDGSw0M0i4
T5O1lGb+ds92WiADeqFIfkjegoTHGNcgT6cgMAW8cIhY5jTTb7fQJeTazac1KTvpfHFxcguGSHHS
b0RxHtuiFiPyWdRYmbJFpajAeuRalKPoy745eZoXDiJ/WvkHZBBf18PVyj64w8wNyA14pulwdNW5
u77LOcG+Z/9pom3b2ggS2PXCYCUMoWrKGqum0M256Cvddp9NvAcYn3F9/auHJVn7YU654x+OU27g
Lgv7A9zIi/PPYSXNkH3BMvrE+5eb4Z+i+/6QwcK/4qCTD86/Cz9SGGbnGaQhG/jDyS3s25DbfizH
z8QhDtf4TdMrXXdYCKGx4ubo31RoSlE2tTHUk4H9DwAAAP//AwAaRI0JYgIAAA==
headers: {}
http_version: HTTP/1.1
status_code: 200
status:
code: 200
message: OK
version: 1
26 changes: 18 additions & 8 deletions tests/cassettes/test_async_client_request_auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ interactions:
method: GET
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"649c77c8-264f-4e74-a2c9-4a1c6adf08ec"}'
body:
string: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid.","request_id":"a3e6c161-51f0-47e2-a7ec-055e724f444b"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
status:
code: 401
message: Unauthorized
- request:
body: ''
headers:
Expand All @@ -40,9 +42,17 @@ interactions:
method: GET
uri: https://api.notion.com/v1/users
response:
content: '{"object":"list","results":[{"object":"user","id":"a4f789cc-7bc8-4cf0-82b9-a8ba7d985ecf","name":"Guillaume
Gelin","avatar_url":"https://s3-us-west-2.amazonaws.com/public.notion-static.com/01d7053d-e135-4f27-bba0-5de532d39296/ramnes3.jpeg","type":"person","person":{"email":"[email protected]"}},{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78","name":"notion-sdk-py","avatar_url":null,"type":"bot","bot":{"owner":{"type":"workspace","workspace":true},"workspace_name":"notion-sdk-py"}}],"next_cursor":null,"has_more":false,"type":"user","user":{},"request_id":"a1e1dc6c-d7e2-4e5f-856b-cd1414e7c987"}'
body:
string: !!binary |
H4sIAAAAAAAAAwAAAP//dFLbbpwwEP2Vap4ZlsWAsZ/ylo+oIjSYoSExmPqSbYr494rN5qKqffEc
+cg6F88Grn9iE0GDnUKEDDyHZGMA/X375FJgDxlMA2igapStMgZlb1qszFhgW/YKqe1JDqqt2YyQ
wUIzg4b7NFlLaeZv92ynBTKgF4rku+QtaHiMcQ36dAoCU8ALh4hlTjP9dgtdQm7cfFpTbyeTLy5O
bsEQKU7mShTnQRa1GJDPosZqLCX2PRVYD1yLchCqVM3J07xwEPnTyj8gg/i6Hq5W9sEdZm5Ab8Az
TYejN527t3c5J9j37D9NSCnrUZDAVokRKzES9k1ZY9UUpjkXqjKy/WziPcDwjOvrXz0sydoPc707
/uE49QbusrA/wI28OP8cVjIM2Reso0+8f7np/im67w8ZLPwrdib54Py78COFbnaeQY9kA384uYW9
Dr3tx3L8TBxid43ftmJUJVXYFHWBVd8wqpoUUikrrko51M0Z9j8AAAD//wMA4+wsRmICAAA=
headers: {}
http_version: HTTP/1.1
status_code: 200
status:
code: 200
message: OK
version: 1
27 changes: 21 additions & 6 deletions tests/cassettes/test_async_collect_paginated_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ interactions:
method: POST
uri: https://api.notion.com/v1/search
response:
content: '{"object":"list","results":[{"object":"page","id":"95ba0116-6776-4c19-9e45-54e77415f03b","created_time":"2023-06-29T12:47:00.000Z","last_edited_time":"2024-12-30T17:22:00.000Z","created_by":{"object":"user","id":"a4f789cc-7bc8-4cf0-82b9-a8ba7d985ecf"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"cover":null,"icon":null,"parent":{"type":"workspace","workspace":true},"archived":false,"in_trash":false,"properties":{"title":{"id":"title","type":"title","title":[]}},"url":"https://www.notion.so/95ba011667764c199e4554e77415f03b","public_url":null}],"next_cursor":null,"has_more":false,"type":"page_or_database","page_or_database":{},"request_id":"42e3d551-2338-49d2-9d1b-705340893950"}'
body:
string: !!binary |
H4sIAAAAAAAAAwAAAP//fJLRbuQgDEX/xc9hhiQQAt/Rp62qCIjZYZuGLJBOq1H+vWJmM213pX2z
wbq+9vEFgvmFNoOCyacMFURM65QTqMfL59+ifyJU4EdQILnRtK470gnREWZrSSQyTjhDIVjNHW0N
VGAj6ozjkP0LgoKGNi2hHWnkQ90oJhSlB0rpD6hg0ikPOPrv1YzUDWnpQy1Uy79U77rmHdQXh2vC
uDvUzIleWkuEsT1h1lHSN0YS3RstRtlztA62743/IyeE4K7VLell6whrnSamazhhHbVdTSWzoi9y
NrxiBDWv01SBt2He40VHnHPRz+9LGe8c4nNatC07/YxVjituFehoT/4VR1BOTwkr8POQo06n+8MS
w4Ixe0xXUZ8nLMHV7S2r9lb39Fb0+LRtFaxxAgWnnJekjsfz+XyYQ/ZhPqRw3PEWugVuYfsX2mU1
k7fDVaVMuD1VMONbHuwaU7iv4KTT8BIi3m3/sVSOaQhxGHXWRqfi7p8nddnKKf5eMeXhRoEywwpF
zsvZUSeI4bohnWiE5axtrJOwfQAAAP//AwANv0Nh0AIAAA==
headers: {}
http_version: HTTP/1.1
status_code: 200
status:
code: 200
message: OK
- request:
body: '{"query":"This should have no results"}'
headers:
Expand All @@ -47,8 +57,13 @@ interactions:
method: POST
uri: https://api.notion.com/v1/search
response:
content: '{"object":"list","results":[],"next_cursor":null,"has_more":false,"type":"page_or_database","page_or_database":{},"request_id":"d71d978b-b503-4577-9709-68365c8ddcfd"}'
body:
string: !!binary |
H4sIAAAAAAAAA2TNQQ6CMBAF0Lv8dbsoQoBexZhmoINiKtXONNEQ7m5cu32btyNPd54VHmkVhUFh
qUkF/nwx2PitYa5FcoHfakoGN5LwyIXhF0rCBvp5MjyedOWQS4ikNJEwzD/5/fgFr8qiYY3w6OPg
4riMlvuObcvO2aHpWtu3dOqaxbmRZhxfAAAA//8DAOf7jmamAAAA
headers: {}
http_version: HTTP/1.1
status_code: 200
status:
code: 200
message: OK
version: 1
Loading
Loading