🐛 | Code quality fixes
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m43s
All checks were successful
SonarQube Code Quality Scan / SonarQube Scan (push) Successful in 1m43s
- config.py: move 'import shutil' to module level - player.py: unify type hints, narrow except, add debug log - discord_rpc.py: replace broad except Exception with specific types - gui.py: remove unused import; replace lambda closures with method refs; fix closure scope bug; extract _populate_list_page() to remove duplicate code; add public accessors; make flush_volume public; add AudioVisualizer.reset_activity() - tests: replace unused _f variable with Path.touch()
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
import struct
|
||||
import math
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -239,8 +240,9 @@ class TestStaleFiles:
|
||||
td = tempfile.mkdtemp(prefix="tunetti_test_")
|
||||
monkeypatch.setattr("player._TUNETTI_TMP", td)
|
||||
|
||||
with open(os.path.join(td, "vid123.mp3"), "w") as _f:
|
||||
pass # empty; _f unused intentionally
|
||||
# Create an empty file to verify it's excluded
|
||||
empty_path = os.path.join(td, "vid123.mp3")
|
||||
Path(empty_path).touch()
|
||||
|
||||
result = _stale_files("vid123")
|
||||
assert result == []
|
||||
|
||||
Reference in New Issue
Block a user