Skip to content

Commit

Permalink
fixed loading of env vars in monthly_check tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottekostelic committed Nov 5, 2024
1 parent a9626d7 commit 4321153
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions tests/test_monthly_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def get_params_from_yaml(url: str, method: str) -> list:

@pytest.mark.monthly_check
@pytest.mark.webtest
@pytest.mark.usefixtures("live_keys")
class TestMetadataSessionMonthlyCheck:
"""Runs rudimentary tests against live Metadata API for monthly checks"""

Expand Down Expand Up @@ -372,9 +371,9 @@ def test_brief_bibs_get_other_editions(self, yaml_params, method_params):

def test_holdings_get_codes(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand All @@ -398,9 +397,9 @@ def test_holdings_get_codes(self, yaml_params, method_params):

def test_holdings_get_current(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand All @@ -425,9 +424,9 @@ def test_holdings_get_current(self, yaml_params, method_params):

def test_holdings_set_unset(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand Down Expand Up @@ -479,9 +478,9 @@ def test_holdings_set_unset_marcxml(
self, yaml_params, method_params, stub_marc_xml
):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand Down Expand Up @@ -537,9 +536,9 @@ def test_holdings_set_unset_marcxml(

def test_summary_holdings_get(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand All @@ -559,9 +558,9 @@ def test_summary_holdings_get(self, yaml_params, method_params):

def test_summary_holdings_search(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand Down Expand Up @@ -610,9 +609,9 @@ def test_summary_holdings_search(self, yaml_params, method_params):

def test_shared_print_holdings_search(self, yaml_params, method_params):
token = WorldcatAccessToken(
key=os.getenv("WCKey"),
secret=os.getenv("WCSecret"),
scopes=os.getenv("WCScopes"),
key=os.getenv("WCKEY"),
secret=os.getenv("WCSECRET"),
scopes=os.getenv("WCSCOPES"),
)

with MetadataSession(authorization=token) as session:
Expand Down Expand Up @@ -662,7 +661,6 @@ def test_shared_print_holdings_search(self, yaml_params, method_params):

@pytest.mark.monthly_check
@pytest.mark.webtest
@pytest.mark.usefixtures("live_keys")
class TestWorldcatAccessTokenMonthlyCheck:
"""Runs monthly tests against live service"""

Expand Down

0 comments on commit 4321153

Please sign in to comment.