This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
forked from mediacloud/wayback-news-client
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new header-length test, and added options to test against dev/s…
…taging/prod via a cmd arg
- Loading branch information
Paige Gulley
committed
Jun 14, 2024
1 parent
43f7ecd
commit 57bc1df
Showing
4 changed files
with
8,963 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ __pycache__ | |
.pytest_cache | ||
build | ||
dist | ||
.DS_STORE | ||
venv/ | ||
*.egg-info |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import pytest | ||
from mcnews.searchapi import SearchApiClient, VERSION | ||
|
||
COLLECTION_MEDIACLOUD = "mc_search-*" | ||
|
||
port_map = { | ||
"prod": 8000, | ||
"staging": 8200, | ||
"dev": 8100 | ||
} | ||
|
||
env_options = tuple(port_map.keys()) | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--env", | ||
action="store", | ||
default="prod", | ||
help=f"Toggles which news-search-api environment to test against: {env_options}", | ||
choices=env_options | ||
) | ||
|
||
|
||
@pytest.fixture(scope="class") | ||
def api_client(request): | ||
environment = request.config.getoption("--env") | ||
port = port_map[environment] | ||
request.cls._api = SearchApiClient(COLLECTION_MEDIACLOUD) | ||
request.cls._api.API_BASE_URL = f"http://localhost:{port}/{VERSION}/" |
Oops, something went wrong.