generated from MITLibraries/python-cli-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates to type hinting, code structure, datetime objects, unit tests, fixtures, and docstrings as requested by linters
- Loading branch information
Showing
11 changed files
with
103 additions
and
111 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
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
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import json | ||
import os | ||
|
||
import boto3 | ||
import pytest | ||
|
@@ -12,29 +11,24 @@ | |
|
||
# Env fixtures | ||
@pytest.fixture(autouse=True) | ||
def test_env(): | ||
os.environ = { | ||
"ALMA_API_URL": "https://example.com", | ||
"ALMA_API_READ_KEY": "just-for-testing", | ||
"ALMA_API_TIMEOUT": "10", | ||
"SES_SEND_FROM_EMAIL": "[email protected]", | ||
"SES_RECIPIENT_EMAIL": "[email protected] [email protected]", | ||
"SENTRY_DSN": "None", | ||
"WORKSPACE": "test", | ||
} | ||
yield | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def aws_credentials(): | ||
os.environ["AWS_ACCESS_KEY_ID"] = "testing" | ||
os.environ["AWS_SECRET_ACCESS_KEY"] = "testing" | ||
os.environ["AWS_SECURITY_TOKEN"] = "testing" | ||
os.environ["AWS_SESSION_TOKEN"] = "testing" | ||
def _test_environment(monkeypatch): | ||
monkeypatch.setenv("ALMA_API_URL", "https://example.com") | ||
monkeypatch.setenv("ALMA_API_READ_KEY", "just-for-testing") | ||
monkeypatch.setenv("ALMA_API_TIMEOUT", "10") | ||
monkeypatch.setenv("SES_SEND_FROM_EMAIL", "[email protected]") | ||
monkeypatch.setenv( | ||
"SES_RECIPIENT_EMAIL", "[email protected] [email protected]" | ||
) | ||
monkeypatch.setenv("SENTRY_DSN", "None") | ||
monkeypatch.setenv("WORKSPACE", "test") | ||
monkeypatch.setenv("AWS_ACCESS_KEY_ID", "testing") | ||
monkeypatch.setenv("AWS_SECRET_ACCESS_KEY", "testing") | ||
monkeypatch.setenv("AWS_SECURITY_TOKEN", "testing") | ||
monkeypatch.setenv("AWS_SESSION_TOKEN", "testing") | ||
|
||
|
||
# CLI fixture | ||
@pytest.fixture() | ||
@pytest.fixture | ||
def runner(): | ||
return CliRunner() | ||
|
||
|
@@ -53,7 +47,7 @@ def po_line_records_fixture(): | |
|
||
|
||
# API fixtures | ||
@pytest.fixture() | ||
@pytest.fixture | ||
def alma_client(): | ||
return AlmaClient() | ||
|
||
|
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
Oops, something went wrong.