feat(style): Fix 1-space indentation in 27 files
Files corrected: - src/fuzzy_anchor.py (18 violations) - src/patch_modal.py (14 violations) - scripts/extract_symbols.py (4 violations) - scripts/tasks/download_fonts.py (8 violations) - tests/: 23 files with indentation issues All files verified with py_compile. Remaining 4 files (test_api_events.py, test_discussion_takes_gui.py, test_gui_updates.py, test_headless_service.py) have complex multi-line with statements that require manual correction.
This commit is contained in:
@@ -4,48 +4,48 @@ import sys
|
||||
from imgui_bundle import imgui_node_editor as ed
|
||||
|
||||
def test_imgui_node_editor_import():
|
||||
assert ed is not None
|
||||
assert hasattr(ed, "begin_node")
|
||||
assert hasattr(ed, "end_node")
|
||||
assert ed is not None
|
||||
assert hasattr(ed, "begin_node")
|
||||
assert hasattr(ed, "end_node")
|
||||
|
||||
def test_app_has_node_editor_attrs():
|
||||
from src.gui_2 import App
|
||||
# Use patch to avoid initializing the entire App
|
||||
with patch('src.app_controller.AppController'), \
|
||||
patch('src.gui_2.immapp.RunnerParams'), \
|
||||
patch('imgui_bundle.imgui_node_editor.create_editor'):
|
||||
app = App.__new__(App)
|
||||
# Manually set what we expect from __init__
|
||||
app.node_editor_config = ed.Config()
|
||||
app.node_editor_ctx = ed.create_editor(app.node_editor_config)
|
||||
app.ui_selected_ticket_id = None
|
||||
from src.gui_2 import App
|
||||
# Use patch to avoid initializing the entire App
|
||||
with patch('src.app_controller.AppController'), \
|
||||
patch('src.gui_2.immapp.RunnerParams'), \
|
||||
patch('imgui_bundle.imgui_node_editor.create_editor'):
|
||||
app = App.__new__(App)
|
||||
# Manually set what we expect from __init__
|
||||
app.node_editor_config = ed.Config()
|
||||
app.node_editor_ctx = ed.create_editor(app.node_editor_config)
|
||||
app.ui_selected_ticket_id = None
|
||||
|
||||
assert hasattr(app, 'node_editor_config')
|
||||
assert hasattr(app, 'node_editor_ctx')
|
||||
assert hasattr(app, 'ui_selected_ticket_id')
|
||||
assert hasattr(app, 'node_editor_config')
|
||||
assert hasattr(app, 'node_editor_ctx')
|
||||
assert hasattr(app, 'ui_selected_ticket_id')
|
||||
|
||||
def test_node_id_stability():
|
||||
"""Verify that node/pin IDs generated via hash are stable for the same input."""
|
||||
tid = "T-001"
|
||||
int_id = abs(hash(tid))
|
||||
in_pin_id = abs(hash(tid + "_in"))
|
||||
out_pin_id = abs(hash(tid + "_out"))
|
||||
"""Verify that node/pin IDs generated via hash are stable for the same input."""
|
||||
tid = "T-001"
|
||||
int_id = abs(hash(tid))
|
||||
in_pin_id = abs(hash(tid + "_in"))
|
||||
out_pin_id = abs(hash(tid + "_out"))
|
||||
|
||||
# Re-generate and compare
|
||||
assert int_id == abs(hash(tid))
|
||||
assert in_pin_id == abs(hash(tid + "_in"))
|
||||
assert out_pin_id == abs(hash(tid + "_out"))
|
||||
# Re-generate and compare
|
||||
assert int_id == abs(hash(tid))
|
||||
assert in_pin_id == abs(hash(tid + "_in"))
|
||||
assert out_pin_id == abs(hash(tid + "_out"))
|
||||
|
||||
# Verify uniqueness
|
||||
assert int_id != in_pin_id
|
||||
assert int_id != out_pin_id
|
||||
assert in_pin_id != out_pin_id
|
||||
# Verify uniqueness
|
||||
assert int_id != in_pin_id
|
||||
assert int_id != out_pin_id
|
||||
assert in_pin_id != out_pin_id
|
||||
|
||||
def test_link_id_stability():
|
||||
"""Verify that link IDs are stable."""
|
||||
source_tid = "T-001"
|
||||
target_tid = "T-002"
|
||||
link_id = abs(hash(source_tid + "_" + target_tid))
|
||||
"""Verify that link IDs are stable."""
|
||||
source_tid = "T-001"
|
||||
target_tid = "T-002"
|
||||
link_id = abs(hash(source_tid + "_" + target_tid))
|
||||
|
||||
assert link_id == abs(hash(source_tid + "_" + target_tid))
|
||||
assert link_id != abs(hash(target_tid + "_" + source_tid))
|
||||
assert link_id == abs(hash(source_tid + "_" + target_tid))
|
||||
assert link_id != abs(hash(target_tid + "_" + source_tid))
|
||||
Reference in New Issue
Block a user