code quality run

This commit is contained in:
2025-09-13 21:58:54 +02:00
parent 0dfd885847
commit 3eb18ef91e
63 changed files with 1802 additions and 1289 deletions

View File

@@ -1,5 +1,6 @@
# tests/test_stock.py
import pytest
from models.database_models import Stock
@@ -9,7 +10,7 @@ class TestStockAPI:
stock_data = {
"gtin": "1234567890123",
"location": "WAREHOUSE_A",
"quantity": 100
"quantity": 100,
}
response = client.post("/api/v1/stock", headers=auth_headers, json=stock_data)
@@ -30,7 +31,7 @@ class TestStockAPI:
stock_data = {
"gtin": "1234567890123",
"location": "WAREHOUSE_A",
"quantity": 75
"quantity": 75,
}
response = client.post("/api/v1/stock", headers=auth_headers, json=stock_data)
@@ -49,10 +50,12 @@ class TestStockAPI:
stock_data = {
"gtin": "1234567890123",
"location": "WAREHOUSE_A",
"quantity": 25
"quantity": 25,
}
response = client.post("/api/v1/stock/add", headers=auth_headers, json=stock_data)
response = client.post(
"/api/v1/stock/add", headers=auth_headers, json=stock_data
)
assert response.status_code == 200
data = response.json()
@@ -68,10 +71,12 @@ class TestStockAPI:
stock_data = {
"gtin": "1234567890123",
"location": "WAREHOUSE_A",
"quantity": 15
"quantity": 15,
}
response = client.post("/api/v1/stock/remove", headers=auth_headers, json=stock_data)
response = client.post(
"/api/v1/stock/remove", headers=auth_headers, json=stock_data
)
assert response.status_code == 200
data = response.json()
@@ -87,10 +92,12 @@ class TestStockAPI:
stock_data = {
"gtin": "1234567890123",
"location": "WAREHOUSE_A",
"quantity": 20
"quantity": 20,
}
response = client.post("/api/v1/stock/remove", headers=auth_headers, json=stock_data)
response = client.post(
"/api/v1/stock/remove", headers=auth_headers, json=stock_data
)
assert response.status_code == 400
assert "Insufficient stock" in response.json()["detail"]