test_scheduler_busy_only.py 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. """Tests for _is_busy_only() in the print scheduler."""
  2. from backend.app.services.print_scheduler import PrintScheduler
  3. class TestIsBusyOnly:
  4. """Test the _is_busy_only static method."""
  5. def test_single_busy(self):
  6. assert PrintScheduler._is_busy_only("Busy: Printer1") is True
  7. def test_multiple_busy(self):
  8. assert PrintScheduler._is_busy_only("Busy: Printer1, Printer2") is True
  9. def test_busy_and_offline(self):
  10. assert PrintScheduler._is_busy_only("Busy: Printer1 | Offline: Printer2") is False
  11. def test_busy_and_filament(self):
  12. assert PrintScheduler._is_busy_only("Busy: Printer1 | Waiting for filament: Printer2 (needs PLA)") is False
  13. def test_offline_only(self):
  14. assert PrintScheduler._is_busy_only("Offline: Printer1") is False
  15. def test_filament_only(self):
  16. assert PrintScheduler._is_busy_only("Waiting for filament: Printer1 (needs PLA)") is False
  17. def test_no_matching_color(self):
  18. assert PrintScheduler._is_busy_only("No matching material/color. Waiting on PLA (Blue)") is False
  19. def test_no_available_printers(self):
  20. assert PrintScheduler._is_busy_only("No available P1S printers configured") is False