Fix more and more bugs

This commit is contained in:
Santiago Lo Coco 2023-10-27 18:16:04 -03:00
parent 8b3b435b13
commit f60633817f
2 changed files with 10 additions and 3 deletions

View File

@ -205,8 +205,8 @@ test-subscription-api:
- docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE down - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE down
- docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE pull - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE pull
- docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit --renew-anon-volumes - docker compose -f subscription-domain/docker-compose.yml --env-file $ENV_DEV_FILE up --abort-on-container-exit --renew-anon-volumes
- docker cp fids_subscription_api:/usr/src/app/coverage.xml . - docker cp fids_subscriptions_api:/usr/src/app/coverage.xml .
- docker cp fids_subscription_api:/usr/src/app/report.xml . - docker cp fids_subscriptions_api:/usr/src/app/report.xml .
artifacts: artifacts:
when: always when: always
paths: paths:

View File

@ -1,6 +1,7 @@
import json import json
from datetime import datetime from datetime import datetime
from fastapi import BackgroundTasks
from fastapi.testclient import TestClient from fastapi.testclient import TestClient
from src.api.main import app from src.api.main import app
@ -33,7 +34,13 @@ def test_post_flight(test_database, get_flight):
assert db_retrieved_flight.flight_code == creating_flight["flight_code"] assert db_retrieved_flight.flight_code == creating_flight["flight_code"]
def test_patch_flight(test_database, create_flight, flight_to_create): def add_task(self, func, *args, **kwargs) -> None:
return None
def test_patch_flight(test_database, create_flight, flight_to_create, monkeypatch):
monkeypatch.setattr(BackgroundTasks, "add_task", add_task)
test_database.query(Flight).delete() test_database.query(Flight).delete()
created_flight = create_flight(flight_to_create) created_flight = create_flight(flight_to_create)
api_call_retrieved_flight = client.patch( api_call_retrieved_flight = client.patch(