From 154958585d649691c1fec60fbbf62e59e0c76592 Mon Sep 17 00:00:00 2001 From: nadzyah Date: Mon, 19 Jun 2023 14:39:10 +0300 Subject: [PATCH] Fix style issues --- backend/tests/controllers/families/test_families.py | 11 ++++------- backend/tests/helpers.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/tests/controllers/families/test_families.py b/backend/tests/controllers/families/test_families.py index eddd4b12..0e669788 100644 --- a/backend/tests/controllers/families/test_families.py +++ b/backend/tests/controllers/families/test_families.py @@ -22,15 +22,12 @@ from random import randint from fastapi.testclient import TestClient -from requests_mock import Mocker from sqlalchemy.orm import Session from tests.helpers import create_artefact -def test_retreive_family( - db_session: Session, test_client: TestClient, requests_mock: Mocker -): +def test_retreive_family(db_session: Session, test_client: TestClient): """ We should get json for a specific family with its stages and artefacts """ @@ -52,15 +49,15 @@ def test_retreive_family( version=str(randint(1, 100)), ) ) - stage = artefacts[0].stage + snap_stage = artefacts[0].stage # Act response = test_client.get("/v1/families/snap") # Assert assert response.json() == { - "id": stage.family_id, - "name": stage.family.name, + "id": snap_stage.family_id, + "name": snap_stage.family.name, "stages": [ { "id": 1, diff --git a/backend/tests/helpers.py b/backend/tests/helpers.py index 4c9f581e..4443e034 100644 --- a/backend/tests/helpers.py +++ b/backend/tests/helpers.py @@ -6,7 +6,7 @@ from test_observer.data_access.models_enums import FamilyName -def create_artefact(db_session: Session, stage_name: str, **kwargs): +def create_artefact(db_session: Session, stage_name: str, **kwargs) -> Artefact: """Create a dummy artefact""" stage = db_session.query(Stage).filter(Stage.name == stage_name).first() artefact = Artefact(