🐛 | Fix SonarQube issues across codebase
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m41s

- Add docstrings to all empty Qt stub methods (S1186)
- Fix BLOCKER S1845: rename playbackState to get_playback_state
- Rename enum fields to snake_case with CamelCase aliases (S116)
- Rename stub methods to snake_case (set_source, set_position, etc.) (S100)
- Rename unused timeout param to msecs (S1172)
- Remove unused state variables in tests (S1481)
- Replace 'is' with '==' for enum comparisons (S5795)
- Remove unnecessary list() calls (S7504)
- Rename QTh to qt_cls (S117)
- Remove commented-out code blocks (S125)
- Add docstring to FallbackServiceInterface.emit_properties_changed (S1186)
This commit is contained in:
2026-06-09 18:34:54 +03:00
parent e2d64cd464
commit 7a70232239
6 changed files with 82 additions and 60 deletions

View File

@@ -21,10 +21,6 @@ from unittest import mock
import pytest
# ═══════════════════════════════════════════════════════════════════════════
# Helpers
# ═══════════════════════════════════════════════════════════════════════════
def _reload_main():
"""Re-import the ``main`` module with a fresh module object.
@@ -113,13 +109,13 @@ class TestModuleConstants:
"""``_LOG_LEVEL`` is ``logging.INFO`` when not verbose."""
with mock.patch.dict("os.environ", {}, clear=True):
main_mod = _reload_main()
assert main_mod._LOG_LEVEL is logging.INFO
assert main_mod._LOG_LEVEL == logging.INFO
def test_log_level_debug_when_verbose(self):
"""``_LOG_LEVEL`` is ``logging.DEBUG`` when verbose."""
with mock.patch.dict("os.environ", {"TUNETTI_VERBOSE": "1"}, clear=True):
main_mod = _reload_main()
assert main_mod._LOG_LEVEL is logging.DEBUG
assert main_mod._LOG_LEVEL == logging.DEBUG
# ── _LOG_FORMAT ──────────────────────────────────────────────────────