-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate auth with AuthBase from requests module
- Loading branch information
Showing
2 changed files
with
44 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
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 |
---|---|---|
|
@@ -288,3 +288,16 @@ def test_sample_seed(): | |
def test_subset(): | ||
url = "https://api.openalex.org/works?select=id,doi,display_name" | ||
assert url == Works().select(["id", "doi", "display_name"]).url | ||
|
||
|
||
def test_auth(): | ||
w_no_auth = Works().get() | ||
pyalex.config.email = "[email protected]" | ||
pyalex.config.api_key = "my_api_key" | ||
|
||
w_auth = Works().get() | ||
|
||
pyalex.config.email = None | ||
pyalex.config.api_key = None | ||
|
||
assert len(w_no_auth) == len(w_auth) |