Changeset View
Changeset View
Standalone View
Standalone View
swh/graphql/tests/conftest.py
Show All 16 Lines | |||||
@pytest.fixture | @pytest.fixture | ||||
def storage(): | def storage(): | ||||
storage = get_swhstorage(cls="memory") | storage = get_swhstorage(cls="memory") | ||||
# set the global var to use the in-memory storage | # set the global var to use the in-memory storage | ||||
app_server.storage = storage | app_server.storage = storage | ||||
# populate the in-memory storage | # populate the in-memory storage | ||||
populate_dummy_data(storage) | populate_dummy_data(storage) | ||||
return storage | |||||
@pytest.fixture | @pytest.fixture | ||||
def test_app(storage): | def test_app(storage): | ||||
app = Flask(__name__) | app = Flask(__name__) | ||||
@app.route("/", methods=["POST"]) | @app.route("/", methods=["POST"]) | ||||
def graphql_server(): | def graphql_server(): | ||||
Show All 15 Lines |