"""
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()

[((96, 125), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""client"""'}), "(name='client')\n", (110, 125), False, 'import pytest\n'), ((262, 290), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""store"""'}), "(name='store')\n", (276, 290), False, 'import pytest\n'), ((460, 492), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""datastore"""'}), "(name='datastore')\n", (474, 492), False, 'import pytest\n'), ((714, 750), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""datastore_key"""'}), "(name='datastore_key')\n", (728, 750), False, 'import pytest\n'), ((850, 889), 'pytest.fixture', 'pytest.fixture', ([], {'name': '"""datastore_entity"""'}), "(name='datastore_entity')\n", (864, 889), False, 'import pytest\n'), ((830, 846), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (844, 846), True, 'import unittest.mock as mock\n'), ((975, 991), 'unittest.mock.MagicMock', 'mock.MagicMock', ([], {}), '()\n', (989, 991), True, 'import unittest.mock as mock\n'), ((363, 416), 'unittest.mock.patch', 'mock.patch', (['"""virtual_dealer.api.store"""'], {'autospec': '(True)'}), "('virtual_dealer.api.store', autospec=True)\n", (373, 416), True, 'import unittest.mock as mock\n'), ((603, 662), 'unittest.mock.patch', 'mock.patch', (['"""virtual_dealer.store.datastore"""'], {'autospec': '(True)'}), "('virtual_dealer.store.datastore', autospec=True)\n", (613, 662), True, 'import unittest.mock as mock\n')]