Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Added new header-length test, and added options to test against dev/s…
Browse files Browse the repository at this point in the history
…taging/prod via a cmd arg
  • Loading branch information
Paige Gulley committed Jun 14, 2024
1 parent 43f7ecd commit 57bc1df
Show file tree
Hide file tree
Showing 4 changed files with 8,963 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ __pycache__
.pytest_cache
build
dist
.DS_STORE
venv/
*.egg-info
30 changes: 30 additions & 0 deletions mcnews/tests/conftest.py
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}/"
Loading

0 comments on commit 57bc1df

Please sign in to comment.