mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Skip the manual K calibration line as an internal printer job (issue #2957 follow-up)
Manual flow dynamics has two shapes and each reports under its own name with
no auto_ prefix. pa_pattern_calib_mode was already filtered; pa_line_calib_mode
was not, so it still swept FTP for a 3MF that cannot exist and wrote a no-3MF
archive named after the calibration.
This commit is contained in:
-3162
File diff suppressed because one or more lines are too long
@@ -30,15 +30,18 @@ print-complete callbacks can share one answer.
|
||||
# is reported as a *subtask name* with no ``/usr/`` path at all, which is why
|
||||
# the path rule alone was never enough.
|
||||
#
|
||||
# ``pa_pattern_calib_mode`` is the same calibration started by hand rather than
|
||||
# automatically before a print -- the manual flow-dynamics run prints a pattern
|
||||
# where the automatic one prints a line, and it carries its own name with no
|
||||
# ``auto_`` prefix. It reaches Bambuddy exactly the way the automatic one does,
|
||||
# so leaving it off the list produced the same no-3MF archive.
|
||||
# ``pa_line_calib_mode`` and ``pa_pattern_calib_mode`` are the same calibration
|
||||
# started by hand rather than automatically before a print. Manual flow dynamics
|
||||
# offers both shapes -- a line and a pattern -- and each reports under its own
|
||||
# name with no ``auto_`` prefix, so neither is covered by the automatic entry
|
||||
# above and both produced the same no-3MF archive. They are listed as two
|
||||
# literals rather than matched by a shared ``pa_`` stem for the reason the whole
|
||||
# set is exact: a stem rule would also swallow a user's own ``pa_bracket.3mf``.
|
||||
INTERNAL_JOB_NAMES = frozenset(
|
||||
{
|
||||
"auto_cali_for_user",
|
||||
"auto_pa_line_calib_mode",
|
||||
"pa_line_calib_mode",
|
||||
"pa_pattern_calib_mode",
|
||||
}
|
||||
)
|
||||
|
||||
@@ -12,9 +12,10 @@ The same name is already known to the completion guard: #2829's capture of
|
||||
queue item 649 has ``auto_pa_line_calib_mode`` arriving as the subtask name of a
|
||||
completion that had to be refused against a running job.
|
||||
|
||||
The manual flow-dynamics run reaches Bambuddy the same way under a different
|
||||
name -- ``pa_pattern_calib_mode``, a pattern rather than a line and with no
|
||||
``auto_`` prefix -- so the automatic entry never covered it.
|
||||
The manual flow-dynamics run reaches Bambuddy the same way under two further
|
||||
names -- ``pa_line_calib_mode`` and ``pa_pattern_calib_mode``, the line and the
|
||||
pattern shape, both without the ``auto_`` prefix -- so the automatic entry never
|
||||
covered either of them.
|
||||
"""
|
||||
|
||||
from unittest.mock import AsyncMock, MagicMock, patch
|
||||
@@ -43,6 +44,16 @@ class TestTheCalibrationIsRecognised:
|
||||
def test_the_manual_pressure_advance_pattern_by_filename(self):
|
||||
assert is_internal_printer_job("pa_pattern_calib_mode", None)
|
||||
|
||||
def test_the_manual_pressure_advance_line_by_subtask_name(self):
|
||||
"""Manual flow dynamics has a line shape as well as a pattern one, and
|
||||
it reports as ``pa_line_calib_mode`` -- the automatic name without its
|
||||
``auto_`` prefix, which is close enough to the automatic entry to look
|
||||
covered and is not."""
|
||||
assert is_internal_printer_job("", "pa_line_calib_mode")
|
||||
|
||||
def test_the_manual_pressure_advance_line_by_filename(self):
|
||||
assert is_internal_printer_job("pa_line_calib_mode", None)
|
||||
|
||||
def test_the_levelling_run_by_its_system_path(self):
|
||||
assert is_internal_printer_job("/usr/etc/print/auto_cali_for_user.gcode", "auto_cali_for_user")
|
||||
|
||||
@@ -63,6 +74,10 @@ class TestTheCalibrationIsRecognised:
|
||||
"pa_pattern_calib_mode.gcode.3mf",
|
||||
"PA_Pattern_Calib_Mode",
|
||||
"/data/pa_pattern_calib_mode.gcode",
|
||||
"pa_line_calib_mode",
|
||||
"pa_line_calib_mode.gcode.3mf",
|
||||
"PA_Line_Calib_Mode",
|
||||
"/data/pa_line_calib_mode.gcode",
|
||||
],
|
||||
)
|
||||
def test_however_the_name_is_dressed_up(self, reported):
|
||||
@@ -92,6 +107,11 @@ class TestItLeavesRealPrintsAlone:
|
||||
"auto_cali_for_user_test.gcode.3mf",
|
||||
"pa_pattern_calib_mode_v2.3mf",
|
||||
"my_pa_pattern_calib_mode.3mf",
|
||||
"pa_line_calib_mode_v2.3mf",
|
||||
"my_pa_line_calib_mode.3mf",
|
||||
# The stem the four calibration names share, which is why the set
|
||||
# holds literals instead of a ``pa_`` rule.
|
||||
"pa_bracket.3mf",
|
||||
],
|
||||
)
|
||||
def test_a_users_file_that_merely_contains_the_name(self, reported):
|
||||
|
||||
Reference in New Issue
Block a user