code quality run
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user