Skip to content

Commit

Permalink
Fix tests and rebuild cassettes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramnes committed Oct 19, 2023
1 parent 40891a6 commit d6b5c1e
Show file tree
Hide file tree
Showing 39 changed files with 329 additions and 751 deletions.
4 changes: 2 additions & 2 deletions tests/cassettes/test_api_async_request_bad_request_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ interactions:
connection:
- keep-alive
host:
- httpstat.us
- mock.httpstatus.io
notion-version:
- '2022-06-28'
method: GET
uri: https://httpstat.us/400
uri: https://mock.httpstatus.io/400
response:
content: 400 Bad Request
headers: {}
Expand Down
2 changes: 1 addition & 1 deletion tests/cassettes/test_api_response_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interactions:
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid."}'
token is invalid.","request_id":"f8d8b05a-5cb0-4a90-8a67-db7ac50b3c62"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
Expand Down
2 changes: 1 addition & 1 deletion tests/cassettes/test_async_api_response_error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interactions:
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid."}'
token is invalid.","request_id":"b5bb6768-751f-43d1-8ed6-03ed8c318f0f"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
Expand Down
2 changes: 1 addition & 1 deletion tests/cassettes/test_async_client_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interactions:
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/1cddf30d-ef25-4372-a8bd-b510a11e26e8/avatar.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":{}}'
Gelin","avatar_url":"https://s3-us-west-2.amazonaws.com/public.notion-static.com/1cddf30d-ef25-4372-a8bd-b510a11e26e8/avatar.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":"efc82635-6f20-473b-97c7-2086f292dce3"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand Down
4 changes: 2 additions & 2 deletions tests/cassettes/test_async_client_request_auth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interactions:
uri: https://api.notion.com/v1/users
response:
content: '{"object":"error","status":401,"code":"unauthorized","message":"API
token is invalid."}'
token is invalid.","request_id":"c9a6f21b-c688-4c0e-9a68-3ff503ccef7f"}'
headers: {}
http_version: HTTP/1.1
status_code: 401
Expand All @@ -41,7 +41,7 @@ interactions:
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/1cddf30d-ef25-4372-a8bd-b510a11e26e8/avatar.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":{}}'
Gelin","avatar_url":"https://s3-us-west-2.amazonaws.com/public.notion-static.com/1cddf30d-ef25-4372-a8bd-b510a11e26e8/avatar.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":"362d4f97-6a25-421c-aad7-6c4e6cc4cb88"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand Down
113 changes: 4 additions & 109 deletions tests/cassettes/test_async_collect_paginated_api.yaml

Large diffs are not rendered by default.

113 changes: 4 additions & 109 deletions tests/cassettes/test_async_iterate_paginated_api.yaml

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions tests/cassettes/test_blocks_children_create.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: '{"parent": {"page_id": "95ba011667764c199e4554e77415f03b"}, "properties":
{"title": [{"text": {"content": "Test 2023-09-15 21:09:19.814765"}}]}, "children":
{"title": [{"text": {"content": "Test 2023-10-19 19:15:42.948193"}}]}, "children":
[]}'
headers:
accept:
Expand All @@ -23,9 +23,9 @@ interactions:
method: POST
uri: https://api.notion.com/v1/pages
response:
content: '{"object":"page","id":"2d674fd2-ca62-4ca7-8663-ab19c9a7e89b","created_time":"2023-09-15T19:09:00.000Z","last_edited_time":"2023-09-15T19:09:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"cover":null,"icon":null,"parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"archived":false,"properties":{"title":{"id":"title","type":"title","title":[{"type":"text","text":{"content":"Test
2023-09-15 21:09:19.814765","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Test
2023-09-15 21:09:19.814765","href":null}]}},"url":"https://www.notion.so/Test-2023-09-15-21-09-19-814765-2d674fd2ca624ca78663ab19c9a7e89b","public_url":null}'
content: '{"object":"page","id":"8cdca001-83f3-489a-925f-3111990cb922","created_time":"2023-10-19T17:15:00.000Z","last_edited_time":"2023-10-19T17:15:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"cover":null,"icon":null,"parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"archived":false,"properties":{"title":{"id":"title","type":"title","title":[{"type":"text","text":{"content":"Test
2023-10-19 19:15:42.948193","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Test
2023-10-19 19:15:42.948193","href":null}]}},"url":"https://www.notion.so/Test-2023-10-19-19-15-42-948193-8cdca00183f3489a925f3111990cb922","public_url":null,"request_id":"3bb8feee-65df-419e-8e63-79b15bae04d0"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand All @@ -50,11 +50,11 @@ interactions:
notion-version:
- '2022-06-28'
method: PATCH
uri: https://api.notion.com/v1/blocks/2d674fd2-ca62-4ca7-8663-ab19c9a7e89b/children
uri: https://api.notion.com/v1/blocks/8cdca001-83f3-489a-925f-3111990cb922/children
response:
content: '{"object":"list","results":[{"object":"block","id":"101af717-de35-455c-8064-06586486bbcc","parent":{"type":"page_id","page_id":"2d674fd2-ca62-4ca7-8663-ab19c9a7e89b"},"created_time":"2023-09-15T19:09:00.000Z","last_edited_time":"2023-09-15T19:09:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":false,"archived":false,"type":"paragraph","paragraph":{"rich_text":[{"type":"text","text":{"content":"I''m
content: '{"object":"list","results":[{"object":"block","id":"30c03277-bf1c-407a-96f2-c3684912f556","parent":{"type":"page_id","page_id":"8cdca001-83f3-489a-925f-3111990cb922"},"created_time":"2023-10-19T17:15:00.000Z","last_edited_time":"2023-10-19T17:15:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":false,"archived":false,"type":"paragraph","paragraph":{"rich_text":[{"type":"text","text":{"content":"I''m
a paragraph.","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"I''m
a paragraph.","href":null}],"color":"default"}}],"next_cursor":null,"has_more":false,"type":"block","block":{}}'
a paragraph.","href":null}],"color":"default"}}],"next_cursor":null,"has_more":false,"type":"block","block":{},"request_id":"7cc95e93-aae0-4dc8-bba7-b96ab49747a2"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand All @@ -74,10 +74,10 @@ interactions:
notion-version:
- '2022-06-28'
method: DELETE
uri: https://api.notion.com/v1/blocks/2d674fd2-ca62-4ca7-8663-ab19c9a7e89b
uri: https://api.notion.com/v1/blocks/8cdca001-83f3-489a-925f-3111990cb922
response:
content: '{"object":"block","id":"2d674fd2-ca62-4ca7-8663-ab19c9a7e89b","parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"created_time":"2023-09-15T19:09:00.000Z","last_edited_time":"2023-09-15T19:09:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":true,"archived":true,"type":"child_page","child_page":{"title":"Test
2023-09-15 21:09:19.814765"}}'
content: '{"object":"block","id":"8cdca001-83f3-489a-925f-3111990cb922","parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"created_time":"2023-10-19T17:15:00.000Z","last_edited_time":"2023-10-19T17:15:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":true,"archived":true,"type":"child_page","child_page":{"title":"Test
2023-10-19 19:15:42.948193"},"request_id":"41284b00-e0d4-4237-9182-d1de14ba56ef"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand Down
18 changes: 9 additions & 9 deletions tests/cassettes/test_blocks_children_list.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: '{"parent": {"page_id": "95ba011667764c199e4554e77415f03b"}, "properties":
{"title": [{"text": {"content": "Test 2023-09-15 21:09:22.070702"}}]}, "children":
{"title": [{"text": {"content": "Test 2023-10-19 19:15:45.490543"}}]}, "children":
[]}'
headers:
accept:
Expand All @@ -23,9 +23,9 @@ interactions:
method: POST
uri: https://api.notion.com/v1/pages
response:
content: '{"object":"page","id":"e9cd0335-f2ca-4515-839f-79a2fff3489a","created_time":"2023-09-15T19:09:00.000Z","last_edited_time":"2023-09-15T19:09:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"cover":null,"icon":null,"parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"archived":false,"properties":{"title":{"id":"title","type":"title","title":[{"type":"text","text":{"content":"Test
2023-09-15 21:09:22.070702","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Test
2023-09-15 21:09:22.070702","href":null}]}},"url":"https://www.notion.so/Test-2023-09-15-21-09-22-070702-e9cd0335f2ca4515839f79a2fff3489a","public_url":null}'
content: '{"object":"page","id":"f359e597-e1a7-4407-b219-fefa5271cb48","created_time":"2023-10-19T17:15:00.000Z","last_edited_time":"2023-10-19T17:15:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"cover":null,"icon":null,"parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"archived":false,"properties":{"title":{"id":"title","type":"title","title":[{"type":"text","text":{"content":"Test
2023-10-19 19:15:45.490543","link":null},"annotations":{"bold":false,"italic":false,"strikethrough":false,"underline":false,"code":false,"color":"default"},"plain_text":"Test
2023-10-19 19:15:45.490543","href":null}]}},"url":"https://www.notion.so/Test-2023-10-19-19-15-45-490543-f359e597e1a74407b219fefa5271cb48","public_url":null,"request_id":"73785125-c81a-4454-9f7e-2d1254a95875"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand All @@ -45,9 +45,9 @@ interactions:
notion-version:
- '2022-06-28'
method: GET
uri: https://api.notion.com/v1/blocks/e9cd0335-f2ca-4515-839f-79a2fff3489a/children
uri: https://api.notion.com/v1/blocks/f359e597-e1a7-4407-b219-fefa5271cb48/children
response:
content: '{"object":"list","results":[],"next_cursor":null,"has_more":false,"type":"block","block":{}}'
content: '{"object":"list","results":[],"next_cursor":null,"has_more":false,"type":"block","block":{},"request_id":"7495b392-8d77-4b62-8461-e89de42f57ca"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand All @@ -67,10 +67,10 @@ interactions:
notion-version:
- '2022-06-28'
method: DELETE
uri: https://api.notion.com/v1/blocks/e9cd0335-f2ca-4515-839f-79a2fff3489a
uri: https://api.notion.com/v1/blocks/f359e597-e1a7-4407-b219-fefa5271cb48
response:
content: '{"object":"block","id":"e9cd0335-f2ca-4515-839f-79a2fff3489a","parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"created_time":"2023-09-15T19:09:00.000Z","last_edited_time":"2023-09-15T19:09:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":false,"archived":true,"type":"child_page","child_page":{"title":"Test
2023-09-15 21:09:22.070702"}}'
content: '{"object":"block","id":"f359e597-e1a7-4407-b219-fefa5271cb48","parent":{"type":"page_id","page_id":"95ba0116-6776-4c19-9e45-54e77415f03b"},"created_time":"2023-10-19T17:15:00.000Z","last_edited_time":"2023-10-19T17:15:00.000Z","created_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"last_edited_by":{"object":"user","id":"7775f3a3-893f-43fa-b625-460c61094c78"},"has_children":false,"archived":true,"type":"child_page","child_page":{"title":"Test
2023-10-19 19:15:45.490543"},"request_id":"51c0fd4c-f0f3-487a-af8f-cc57bd235b40"}'
headers: {}
http_version: HTTP/1.1
status_code: 200
Expand Down
Loading

0 comments on commit d6b5c1e

Please sign in to comment.