Changed to show filament price if no spool price set and added tests

This commit is contained in:
pdsccode
2024-01-06 21:42:09 +01:00
parent 291d61fbba
commit 577ed1e680
4 changed files with 38 additions and 0 deletions

View File

@@ -185,3 +185,15 @@ def test_add_spool_both_used_and_remaining_weight(random_filament: dict[str, Any
},
)
assert result.status_code == 400 # Cannot set both used and remaining weight
def test_add_spool_price(random_filament: dict[str, Any]):
"""Test adding a spool to the database."""
# Execute
result = httpx.post(
f"{URL}/api/v1/spool",
json={
"filament_id": random_filament["id"],
"price": 25,
},
)
assert result.status_code == 400 # Cannot set price