mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 12:52:19 +01:00
fix: satisfy master's stricter mypy settings after the merge
master now requires full annotations outside tests and disables implicit re-exports, so annotate RomListedByPlaylistException and check the patched upload tmp dir through tmp_path instead of reading the config constant off the upload endpoint module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HSvProqsBrUknEAs4nNKDs
This commit is contained in:
@@ -50,14 +50,14 @@ class RomAlreadyExistsException(Exception):
|
||||
|
||||
|
||||
class RomListedByPlaylistException(Exception):
|
||||
def __init__(self, playlist: str):
|
||||
def __init__(self, playlist: str) -> None:
|
||||
self.message = (
|
||||
f"{playlist} lists this disc, so moving it into a folder would break "
|
||||
"the playlist. Move the set into a folder of its own first"
|
||||
)
|
||||
super().__init__(self.message)
|
||||
|
||||
def __repr__(self):
|
||||
def __repr__(self) -> str:
|
||||
return self.message
|
||||
|
||||
|
||||
|
||||
@@ -882,6 +882,7 @@ def test_start_into_a_file_a_playlist_lists_returns_400(
|
||||
platform: Platform,
|
||||
admin_user: User,
|
||||
rom_upload_fs: Path,
|
||||
tmp_path: Path,
|
||||
):
|
||||
rom = _single_file_rom(platform, admin_user, rom_upload_fs)
|
||||
_write(rom_upload_fs, f"{rom.fs_path}/solo.m3u", b"solo.zip\n")
|
||||
@@ -892,7 +893,7 @@ def test_start_into_a_file_a_playlist_lists_returns_400(
|
||||
|
||||
assert response.status_code == status.HTTP_400_BAD_REQUEST
|
||||
assert "solo.m3u" in response.json()["detail"]
|
||||
assert not upload_endpoint.ROM_UPLOAD_TMP_BASE.exists()
|
||||
assert not (tmp_path / "uploads").exists()
|
||||
assert (rom_upload_fs / rom.fs_path / "solo.zip").read_bytes() == b"romdata"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user