-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add URL Filtering Capabilities to API Request Retrieval Functions (#299) * feat: Implement URL filtering for API request retrieval * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added tests for include_url and exclude_url * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * formant and fix test * lint * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Sahil Chhoker <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
acbcfa9
commit 12171b9
Showing
2 changed files
with
40 additions
and
18 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
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 |
---|---|---|
|
@@ -39,10 +39,22 @@ def test_get_all_last_api_request(db_session): | |
def test_get_api_requests_for_one_user(db_session): | ||
user = get_user(session=db_session, email="[email protected]") | ||
db_session.add(APIRequestSQL(user_uuid=user.uuid, url="test")) | ||
db_session.add(APIRequestSQL(user_uuid=user.uuid, url="url")) | ||
|
||
requests_sql = get_api_requests_for_one_user(session=db_session, email=user.email) | ||
assert len(requests_sql) == 1 | ||
assert requests_sql[0].url == "test" | ||
assert len(requests_sql) == 2 | ||
|
||
include_filtered = get_api_requests_for_one_user( | ||
session=db_session, email=user.email, include_in_url="test" | ||
) | ||
assert len(include_filtered) == 1 | ||
assert include_filtered[0].url == "test" | ||
|
||
exclude_filtered = get_api_requests_for_one_user( | ||
session=db_session, email=user.email, exclude_in_url="test" | ||
) | ||
assert len(exclude_filtered) == 1 | ||
assert exclude_filtered[0].url == "url" | ||
|
||
|
||
def test_get_api_requests_for_one_user_start_datetime(db_session): | ||
|