From b9de4000ba80fe7c4811ae0400c406b24d5657c1 Mon Sep 17 00:00:00 2001 From: stefanogoldoni Date: Tue, 11 May 2021 23:53:36 +0200 Subject: [PATCH] aggiunta creazione repository --- code/backend/nest_backend/test/conftest.py | 5 ++++- code/backend/nest_backend/test/fixtures/flask_client.py | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/code/backend/nest_backend/test/conftest.py b/code/backend/nest_backend/test/conftest.py index 8d964cd..fb407cc 100644 --- a/code/backend/nest_backend/test/conftest.py +++ b/code/backend/nest_backend/test/conftest.py @@ -4,4 +4,7 @@ Pytest configuration file. Import global fixtures here. """ -from fixtures.flask_client import flask_client, admin_access_token, admin_headers, user_access_token, user_headers, user_exists +from fixtures.flask_client import flask_client, \ + admin_access_token, admin_headers, \ + user_access_token, user_headers, user_exists, \ + repository_exists diff --git a/code/backend/nest_backend/test/fixtures/flask_client.py b/code/backend/nest_backend/test/fixtures/flask_client.py index 27bfd1e..a760ea3 100644 --- a/code/backend/nest_backend/test/fixtures/flask_client.py +++ b/code/backend/nest_backend/test/fixtures/flask_client.py @@ -64,6 +64,13 @@ def user_exists(admin_headers, flask_client): }) +@pytest.fixture(scope="package") +def repository_exists(admin_headers, flask_client): + flask_client.post(f'/api/v1/repository/', headers=admin_headers, json={ + 'name': 'repo1' + }) + + @pytest.fixture(scope="package") def user_access_token(flask_client, user_exists): response = flask_client.post("/api/v1/login", json={