Changed initial_weight to be net weight, not gross weight
This commit is contained in:
@@ -86,7 +86,7 @@ def test_update_spool_weights(random_filament: dict[str, Any]):
|
||||
"filament_id": random_filament["id"],
|
||||
"remaining_weight": 1000,
|
||||
"initial_weight": 1255,
|
||||
"empty_weight": 246,
|
||||
"spool_weight": 246,
|
||||
"location": "The Pantry",
|
||||
"lot_nr": "123456789",
|
||||
},
|
||||
@@ -98,8 +98,8 @@ def test_update_spool_weights(random_filament: dict[str, Any]):
|
||||
first_used = "2023-01-01T12:00:00+02:00"
|
||||
last_used = "2023-01-02T12:00:00+02:00"
|
||||
remaining_weight = 750
|
||||
initial_weight = 1250
|
||||
empty_weight = 245
|
||||
initial_weight = 1005
|
||||
spool_weight = 245
|
||||
location = "Living Room"
|
||||
lot_nr = "987654321"
|
||||
comment = "abcdefghåäö"
|
||||
@@ -117,13 +117,13 @@ def test_update_spool_weights(random_filament: dict[str, Any]):
|
||||
"archived": archived,
|
||||
"price": price,
|
||||
"initial_weight": initial_weight,
|
||||
"empty_weight": empty_weight,
|
||||
"spool_weight": spool_weight,
|
||||
},
|
||||
)
|
||||
result.raise_for_status()
|
||||
|
||||
# Verify
|
||||
used_weight = initial_weight - empty_weight - remaining_weight
|
||||
used_weight = initial_weight - remaining_weight
|
||||
used_length = length_from_weight(
|
||||
weight=used_weight,
|
||||
density=random_filament["density"],
|
||||
@@ -139,7 +139,7 @@ def test_update_spool_weights(random_filament: dict[str, Any]):
|
||||
assert spool["first_used"] == "2023-01-01T10:00:00Z"
|
||||
assert spool["last_used"] == "2023-01-02T10:00:00Z"
|
||||
assert spool["initial_weight"] == pytest.approx(initial_weight)
|
||||
assert spool["empty_weight"] == pytest.approx(empty_weight)
|
||||
assert spool["spool_weight"] == pytest.approx(spool_weight)
|
||||
assert spool["remaining_weight"] == pytest.approx(remaining_weight)
|
||||
assert spool["used_weight"] == pytest.approx(used_weight)
|
||||
assert spool["remaining_length"] == pytest.approx(remaining_length)
|
||||
|
||||
Reference in New Issue
Block a user