"""
pytest fixtures
"""
import unittest.mock as mock
import pytest
import virtual_dealer.api


@pytest.fixture(name="client")
def fixture_client():
    """
    Client test fixture for testing flask APIs
    """
    return virtual_dealer.api.app.test_client()


@pytest.fixture(name="store")
def fixture_store():
    """
    Mock for store::Store
    """
    with mock.patch("virtual_dealer.api.store", autospec=True) as mock_store:
        yield mock_store


@pytest.fixture(name="datastore")
def fixture_datastore():
    """
    Client test fixture for testing Google's datastore APIs
    """
    with mock.patch("virtual_dealer.store.datastore", autospec=True) as mock_datastore:
        yield mock_datastore


@pytest.fixture(name="datastore_key")
def fixture_datastore_key():
    """
    Datastore Key Mock
    """
    return mock.MagicMock()


@pytest.fixture(name="datastore_entity")
def fixture_datastore_entity():
    """
    Datastore Entity Mock
    """
    return mock.MagicMock()

[((9, 1, 9, 30), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((17, 1, 17, 29), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((26, 1, 26, 33), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((35, 1, 35, 37), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((43, 1, 43, 40), 'pytest.fixture', 'pytest.fixture', (), '', False, 'import pytest\n'), ((40, 11, 40, 27), 'unittest.mock.MagicMock', 'mock.MagicMock', ({}, {}), '()', True, 'import unittest.mock as mock\n'), ((48, 11, 48, 27), 'unittest.mock.MagicMock', 'mock.MagicMock', ({}, {}), '()', True, 'import unittest.mock as mock\n'), ((22, 9, 22, 62), 'unittest.mock.patch', 'mock.patch', (), '', True, 'import unittest.mock as mock\n'), ((31, 9, 31, 68), 'unittest.mock.patch', 'mock.patch', (), '', True, 'import unittest.mock as mock\n')]