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

MPRester lazily get endpoint and api_key #936

Merged
merged 25 commits into from
Oct 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b076a8e
get env var lazily
DanielYang59 Sep 28, 2024
dee31a0
remove seemingly unused deprecation warn
DanielYang59 Sep 28, 2024
48fbc54
remove unused ignore tag
DanielYang59 Sep 28, 2024
b7b3d19
fix URL case
DanielYang59 Sep 28, 2024
1214f2e
access self.endpoint for updated entry
DanielYang59 Sep 28, 2024
c1fa506
only patch api key env var in CI env
DanielYang59 Sep 28, 2024
b11178c
add unit test for lazy mp api key
DanielYang59 Sep 28, 2024
d0afe41
remove skip decorator
DanielYang59 Sep 28, 2024
5540253
also check endpoint
DanielYang59 Sep 28, 2024
479a9ba
add more tests for endpoint
DanielYang59 Sep 28, 2024
c31ef7d
don't patch api_key and recover skip mark
DanielYang59 Sep 28, 2024
b3ff75a
avoid duplicate endpoint
DanielYang59 Sep 28, 2024
f740843
also test default and invalid api key
DanielYang59 Sep 28, 2024
2232e5a
os.environ.get -> os.getenv
DanielYang59 Sep 30, 2024
5648026
BaseRester also get lazily
DanielYang59 Sep 30, 2024
1b7510d
make sure self.endpoint is set
tschaume Oct 2, 2024
7edcc7f
remove duplicated pytest skip mark
DanielYang59 Oct 2, 2024
e77077b
turn off fail-fast
DanielYang59 Oct 2, 2024
38b149e
NEED CONFIRM: filter get_data_by_id deprecation warning
DanielYang59 Oct 2, 2024
0f55062
cleanup
tschaume Oct 2, 2024
b466c31
linting
tschaume Oct 2, 2024
284b18d
try upper casing secrets name
tschaume Oct 2, 2024
66f2355
use tr for uppercase
tschaume Oct 2, 2024
6435643
test api key in header
tschaume Oct 2, 2024
63dd563
Revert "test api key in header"
tschaume Oct 3, 2024
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
4 changes: 4 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import warnings

import pytest

Expand Down Expand Up @@ -66,6 +67,9 @@ def test_generic_get_methods(rester):
)

if name not in ignore_generic:
warnings.filterwarnings(
"ignore", "get_data_by_id is deprecated", DeprecationWarning
tschaume marked this conversation as resolved.
Show resolved Hide resolved
)
if name not in key_only_resters:
doc = rester._query_resource_data(
{"_limit": 1}, fields=[rester.primary_key]
Expand Down