"""conftest for integration tests.""" from datetime import datetime from os import getenv from auth.auth import GrassAuth, UserType import pytest from tests.integration.utils.api_client import APIClient @pytest.fixture(scope='session') def oa_session_token(): """Initialize OA grass auth token at start of test session.""" return GrassAuth(UserType.OA).grass_token @pytest.fixture def api_client(oa_session_token): """Initialize product digital APIClient with Workstation session token of provided user.""" return APIClient(getenv('BASE_QA_GRASS_URL'), oa_session_token) @pytest.fixture def reason_data(): """Return JSON formatted reason data.""" return { 'reason': 'test {}'.format(datetime.timestamp(datetime.now())), 'alert': 'test', 'contact': 'test', 'added_by': 1} @pytest.fixture def updated_reason_data(): """Return JSON formatted update reason data.""" time_string = datetime.timestamp(datetime.now()) return { 'reason': 'test reason {}'.format(time_string), 'alert': 'test alert {}'.format(time_string), 'contact': 'test contact {}'.format(time_string)} @pytest.fixture def word_data(): """Return blacklist word data.""" return {'word': 'test {}'.format(datetime.timestamp(datetime.now())), 'notes': 'test', 'blacklist_reason_id': 1, 'added_by': 1} @pytest.fixture def updated_word_data(): """Return updated blacklist word data.""" return {'word': 'test {}'.format(datetime.timestamp(datetime.now())), 'notes': 'test notes {}'.format(datetime.timestamp(datetime.now())), 'blacklist_reason_id': 2} @pytest.fixture def fixture_product_id(): """Fixture Product ID.""" return 6213375