diff --git a/tests/test_api_autotag.py b/tests/test_api_autotag.py index 31ef94e..00407d0 100644 --- a/tests/test_api_autotag.py +++ b/tests/test_api_autotag.py @@ -92,7 +92,8 @@ class FakeAutotagService: class AutotagAPITestCase(AioHTTPTestCase): - """Stands up the PromptManager routes with a temp DB, temp output dir and a fake engine.""" + """Stands up the PromptManager routes with a temp DB, temp output dir and a + fake engine.""" async def get_application(self): self._temp_db = tempfile.NamedTemporaryFile(delete=False, suffix=".db") diff --git a/tests/test_database_migrations.py b/tests/test_database_migrations.py index 450b7eb..9b3283b 100644 --- a/tests/test_database_migrations.py +++ b/tests/test_database_migrations.py @@ -139,7 +139,8 @@ class TestIdempotentMigrations(MigrationTestCase): def test_stale_prompts_new_from_a_failed_rebuild_does_not_block_startup(self): self._legacy_db( [ - "INSERT INTO prompts (text, hash, workflow_name) VALUES ('a', 'h1', 'wf')", + "INSERT INTO prompts (text, hash, workflow_name)" + " VALUES ('a', 'h1', 'wf')", "CREATE TABLE prompts_new (id INTEGER PRIMARY KEY, junk TEXT)", "INSERT INTO prompts_new (junk) VALUES ('leftover')", ] @@ -155,7 +156,8 @@ class TestIdempotentMigrations(MigrationTestCase): # DROP TABLE prompts with foreign keys ON cascades into generated_images self._legacy_db( [ - "INSERT INTO prompts (text, hash, workflow_name) VALUES ('a', 'h1', 'wf')", + "INSERT INTO prompts (text, hash, workflow_name)" + " VALUES ('a', 'h1', 'wf')", "INSERT INTO generated_images (prompt_id, image_path, filename)" " VALUES (1, '/out/a.png', 'a.png')", ] @@ -193,7 +195,8 @@ class TestIdempotentMigrations(MigrationTestCase): LEGACY_IMAGES_TABLE.replace("prompt_id INTEGER", "prompt_id TEXT") ) conn.execute( - "INSERT INTO prompts (text, hash, workflow_name) VALUES ('a', 'h1', 'wf')" + "INSERT INTO prompts (text, hash, workflow_name)" + " VALUES ('a', 'h1', 'wf')" ) for prompt_id, name in ( ("1", "ok.png"), @@ -234,7 +237,8 @@ class TestIdempotentMigrations(MigrationTestCase): def test_image_table_is_rebuilt_with_uniqueness_by_full_path(self): self._legacy_db( [ - "INSERT INTO prompts (text, hash, workflow_name) VALUES ('a', 'h1', 'wf')", + "INSERT INTO prompts (text, hash, workflow_name)" + " VALUES ('a', 'h1', 'wf')", # same basename in two folders: both must survive "INSERT INTO generated_images (prompt_id, image_path, filename)" " VALUES (1, '/out/2026-01-01/a.png', 'a.png')", diff --git a/tests/test_empty_text_handling.py b/tests/test_empty_text_handling.py index 8991992..630cc3a 100644 --- a/tests/test_empty_text_handling.py +++ b/tests/test_empty_text_handling.py @@ -53,7 +53,8 @@ class TestPromptManagerTextEmptyInput(unittest.TestCase): def test_empty_text_with_prepend_append( self, mock_db, mock_integ, mock_tracker, mock_monitor ): - """Empty main text with prepend/append should produce single space, not double.""" + """Empty main text with prepend/append should produce single space, not + double.""" node = self._make_node(mock_db, mock_integ, mock_tracker, mock_monitor) result = node.process_text(text="", prepend_text="before", append_text="after") self.assertIsInstance(result, tuple) @@ -128,7 +129,8 @@ class TestPromptManagerEmptyInput(unittest.TestCase): def test_empty_text_with_prepend_append( self, mock_db, mock_integ, mock_tracker, mock_monitor ): - """Empty main text with prepend/append should produce single space, not double.""" + """Empty main text with prepend/append should produce single space, not + double.""" node, clip = self._make_node_and_clip( mock_db, mock_integ, mock_tracker, mock_monitor ) diff --git a/tests/test_image_monitor_singleton.py b/tests/test_image_monitor_singleton.py index b78b396..538c25f 100644 --- a/tests/test_image_monitor_singleton.py +++ b/tests/test_image_monitor_singleton.py @@ -52,7 +52,8 @@ class TestMonitorSingletonLifecycle(unittest.TestCase): self.assertIs(m1, m2) def test_singleton_survives_across_different_callers(self): - """Different db/tracker args on subsequent calls still return the same instance.""" + """Different db/tracker args on subsequent calls still return the same + instance.""" db1, tracker1 = MagicMock(), MagicMock() db2, tracker2 = MagicMock(), MagicMock() diff --git a/tests/test_output_dir.py b/tests/test_output_dir.py index 4920690..26cd27e 100644 --- a/tests/test_output_dir.py +++ b/tests/test_output_dir.py @@ -34,7 +34,8 @@ class TestFindComfyuiOutputDir(unittest.TestCase): GalleryConfig.MONITORING_DIRECTORIES = self._orig_dirs def test_configured_directory_takes_priority(self): - """When a valid directory is configured, it should be used instead of auto-detect.""" + """When a valid directory is configured, it should be used instead of + auto-detect.""" with tempfile.TemporaryDirectory() as tmpdir: GalleryConfig.MONITORING_DIRECTORIES = [tmpdir] self.api._cached_output_dir = None diff --git a/tests/test_path_security.py b/tests/test_path_security.py index 1041756..39914ae 100644 --- a/tests/test_path_security.py +++ b/tests/test_path_security.py @@ -1,6 +1,5 @@ """Tests for path traversal and symlink security in image serving.""" -import os import tempfile import unittest from pathlib import Path diff --git a/tests/test_prompt_usage.py b/tests/test_prompt_usage.py index b7f29c0..d96aa87 100644 --- a/tests/test_prompt_usage.py +++ b/tests/test_prompt_usage.py @@ -174,7 +174,8 @@ class TestUsageMigration(unittest.TestCase): # generated_images uses SQLite's space-separated CURRENT_TIMESTAMP format for i, ts in enumerate(("2026-03-05 08:00:00", "2026-02-01 09:00:00")): conn.execute( - "INSERT INTO generated_images (prompt_id, image_path, filename, generation_time)" + "INSERT INTO generated_images" + " (prompt_id, image_path, filename, generation_time)" " VALUES (?, ?, ?, ?)", (self.with_images, f"/out/{i}.png", f"{i}.png", ts), ) diff --git a/tests/test_search_filters.py b/tests/test_search_filters.py index d6ff2c1..cb690a3 100644 --- a/tests/test_search_filters.py +++ b/tests/test_search_filters.py @@ -32,7 +32,8 @@ def apply_filters(texts, skip_multipart=True): class TestNewlineCollapse(unittest.TestCase): - """Newlines must be collapsed so StringOutputList treats each DB entry as one prompt.""" + """Newlines must be collapsed so StringOutputList treats each DB entry as one + prompt.""" def test_single_line_unchanged(self): result = apply_filters(["a beautiful landscape"])