-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
paginate
function test to new file test_requests_paginate.py
- Loading branch information
Showing
2 changed files
with
18 additions
and
11 deletions.
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
17 changes: 17 additions & 0 deletions
17
tests/sources/helpers/rest_client/test_requests_paginate.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,17 @@ | ||
import pytest | ||
|
||
from dlt.sources.helpers.requests import paginate | ||
from dlt.sources.helpers.rest_client.paginators import JSONResponsePaginator | ||
from .conftest import assert_pagination | ||
|
||
|
||
@pytest.mark.usefixtures("mock_api_server") | ||
def test_requests_paginate(): | ||
pages_iter = paginate( | ||
"https://api.example.com/posts", | ||
paginator=JSONResponsePaginator(next_url_path="next_page"), | ||
) | ||
|
||
pages = list(pages_iter) | ||
|
||
assert_pagination(pages) |