fix: a proof sheet counts its real length in the machine's metres, in metres, not 15 m
PROOF_SHEET_CM (15) was added to a total in metres, so every proof counted 15 m of film: one proof was enough for the 10 m cleaning alert, and Números overstated production. A proof now counts the film it took, the finest stroke's window and the colour samples with the clear film between them (up to 30 cm, Marcus, 2026-11-26), read from its print file; 15 cm for a sheet made before the samples. One function serves the machine log and Números. The Kanban's proof rule says 30 cm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import unittest
|
||||
from decimal import Decimal
|
||||
|
||||
from app.hotfolder import reprint_default
|
||||
from app.machine_stats import _film
|
||||
from app.machine_log import film_metres
|
||||
|
||||
|
||||
class ReprintTests(unittest.TestCase):
|
||||
@@ -27,8 +27,24 @@ class ReprintTests(unittest.TestCase):
|
||||
|
||||
def test_the_machine_counts_only_the_items_printed_again(self):
|
||||
snapshot = {'items': [{'billed_metres': '2.0'}, {'billed_metres': '3.5'}]}
|
||||
self.assertEqual(_film(snapshot), Decimal('5.5'))
|
||||
self.assertEqual(_film(snapshot, [1]), Decimal('3.5'))
|
||||
self.assertEqual(film_metres(snapshot), Decimal('5.5'))
|
||||
self.assertEqual(film_metres(snapshot, [1]), Decimal('3.5'))
|
||||
|
||||
|
||||
class ProofFilmTests(unittest.TestCase):
|
||||
# A proof sheet is centimetres of film, counted in metres: it once counted
|
||||
# 15 m per proof, enough for the machine's 10 m cleaning alert.
|
||||
proof = {'proof_of': 81, 'items': [{'billed_metres': '0'}, {'billed_metres': '0'}]}
|
||||
|
||||
def test_a_proof_with_colour_samples_counts_its_real_length(self):
|
||||
# Marcus, 2026-11-26: the finest stroke's 15 cm and two 5 cm samples,
|
||||
# 1 cm of clear film between them: 27 cm.
|
||||
windows = {'0': [['10', '25'], ['40', '45'], ['80', '85']]}
|
||||
self.assertEqual(film_metres(self.proof, [0], windows), Decimal('0.27'))
|
||||
|
||||
def test_a_proof_made_before_the_samples_counts_15_cm(self):
|
||||
self.assertEqual(film_metres(self.proof), Decimal('0.30'))
|
||||
self.assertEqual(film_metres(self.proof, None, {'1': [['0', '15']]}), Decimal('0.30'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user