fix(test): use /nonexistent/ instead of /tmp/ to satisfy Bandit B108

The test_returns_empty_when_3mf_missing test sets a deliberately
  non-existent file_path on a PrintArchive to verify
  compute_deficit_for_queue_item handles the missing-3MF branch
  gracefully. The path just needs to fail an existence check — the
  /tmp/ prefix was incidental.

  Bandit B108 ("insecure temp file usage") regex-matches /tmp/,
  /var/tmp/, and /dev/shm/. Dropping /tmp/ in favour of /nonexistent/
  keeps the test behaviour identical (still a guaranteed-missing
  path, still triggers the missing-file branch) while clearing the
  GitHub Advanced Security finding on PR #1514 without adding a
  # nosec annotation.
This commit is contained in:
maziggy
2026-05-24 12:03:11 +02:00
parent 7fbde1ea3d
commit eb98521e93
@@ -223,7 +223,7 @@ class TestFilamentDeficit:
printer = await printer_factory()
archive = PrintArchive(
filename="ghost.3mf",
file_path="/tmp/nope-does-not-exist.3mf",
file_path="/nonexistent/ghost.3mf",
file_size=0,
status="completed",
)