Browse Source

chore(tests): replace /tmp/ literal in test_layer_timelapse_expected_archive.py to clear Bandit B108

  Synthetic value on mock_archive.file_path was "/tmp/fake.3mf" - Bandit
  flagged it as "Probable insecure usage of temp file/directory" even
  though the string is never used as a filesystem path. Swapped to
  "/test/archives/fake.3mf", matching the pattern used in commit 9f1188d7
  to clear the same finding on test_library_trash_api.py and
  test_pending_upload_display_name.py. No suppression comment needed -
  the new path no longer matches Bandit's regex.
maziggy 1 week ago
parent
commit
c5132e9839
1 changed files with 1 additions and 1 deletions
  1. 1 1
      backend/tests/unit/test_layer_timelapse_expected_archive.py

+ 1 - 1
backend/tests/unit/test_layer_timelapse_expected_archive.py

@@ -75,7 +75,7 @@ def _build_mocks(*, external_camera_enabled: bool, external_camera_url: str | No
     mock_archive.printer_id = 1
     mock_archive.print_name = "Universal Spirit Level Holder"
     mock_archive.status = "pending"
-    mock_archive.file_path = "/tmp/fake.3mf"
+    mock_archive.file_path = "/test/archives/fake.3mf"
 
     return mock_printer, mock_archive