"""One order, one machine (Marcus, 2026-11-26): UV and textile never share an order; basic and premium textile may. Run from the repository root: python3 -m unittest tests.test_one_machine -v. """ import unittest from app.core.models import ONE_MACHINE, Item, check_one_machine from tests.test_sheet_trim import sheet_item def items(*modes): return [Item.model_validate(sheet_item(mode=mode)) for mode in modes] class OneMachineTests(unittest.TestCase): def test_uv_and_textile_never_share_an_order(self): for modes in (('file', 'uvfile'), ('premium', 'uvfile'), ('uvfile', 'file', 'file')): with self.assertRaises(ValueError) as caught: check_one_machine(items(*modes)) self.assertEqual(str(caught.exception), ONE_MACHINE) def test_one_line_passes(self): check_one_machine(items('file', 'premium', 'file')) check_one_machine(items('uvfile', 'uvfile')) if __name__ == '__main__': unittest.main()