mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
When all matching printers were busy and a job was queued with ASAP timing, the scheduler immediately fired a "Job Waiting for Filament" notification even though the job was just waiting for a printer to finish — no user action required. Added _is_busy_only() check to skip the waiting notification when the only reason is "Busy". Notifications still fire for actionable reasons (missing filament, offline, wrong color). Also renamed the default notification template title to "Queue Job Waiting" and updated descriptions across all 7 locales.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
"""Tests for _is_busy_only() in the print scheduler."""
|
|
|
|
from backend.app.services.print_scheduler import PrintScheduler
|
|
|
|
|
|
class TestIsBusyOnly:
|
|
"""Test the _is_busy_only static method."""
|
|
|
|
def test_single_busy(self):
|
|
assert PrintScheduler._is_busy_only("Busy: Printer1") is True
|
|
|
|
def test_multiple_busy(self):
|
|
assert PrintScheduler._is_busy_only("Busy: Printer1, Printer2") is True
|
|
|
|
def test_busy_and_offline(self):
|
|
assert PrintScheduler._is_busy_only("Busy: Printer1 | Offline: Printer2") is False
|
|
|
|
def test_busy_and_filament(self):
|
|
assert PrintScheduler._is_busy_only("Busy: Printer1 | Waiting for filament: Printer2 (needs PLA)") is False
|
|
|
|
def test_offline_only(self):
|
|
assert PrintScheduler._is_busy_only("Offline: Printer1") is False
|
|
|
|
def test_filament_only(self):
|
|
assert PrintScheduler._is_busy_only("Waiting for filament: Printer1 (needs PLA)") is False
|
|
|
|
def test_no_matching_color(self):
|
|
assert PrintScheduler._is_busy_only("No matching material/color. Waiting on PLA (Blue)") is False
|
|
|
|
def test_no_available_printers(self):
|
|
assert PrintScheduler._is_busy_only("No available P1S printers configured") is False
|