mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
fix tests
This commit is contained in:
@@ -256,7 +256,7 @@ class RomSchema(BaseModel):
|
||||
sha1_hash: str | None
|
||||
|
||||
# TODO: Remove this after 4.3 release
|
||||
multi: Annotated[int, Field(deprecated="Replaced by has_multiple_files")]
|
||||
multi: Annotated[bool, Field(deprecated="Replaced by has_multiple_files")]
|
||||
has_simple_single_file: bool
|
||||
has_nested_single_file: bool
|
||||
has_multiple_files: bool
|
||||
|
||||
@@ -378,7 +378,6 @@ async def head_rom_content(
|
||||
if file_ids:
|
||||
file_id_values = {int(f.strip()) for f in file_ids.split(",") if f.strip()}
|
||||
files = [f for f in rom.files if f.id in file_id_values]
|
||||
|
||||
files.sort(key=lambda x: x.file_name)
|
||||
|
||||
# Serve the file directly in development mode for emulatorjs
|
||||
|
||||
@@ -164,7 +164,7 @@ class TestFSRomsHandler:
|
||||
assert languages == []
|
||||
assert other_tags == []
|
||||
|
||||
def testexclude_multi_roms_filters_excluded(self, handler: FSRomsHandler, config):
|
||||
def test_exclude_multi_roms_filters_excluded(self, handler: FSRomsHandler, config):
|
||||
"""Test exclude_multi_roms filters out excluded multi-file ROMs"""
|
||||
roms = ["Game1", "excluded_multi", "Game2", "Game3"]
|
||||
|
||||
@@ -176,7 +176,7 @@ class TestFSRomsHandler:
|
||||
|
||||
assert result == expected
|
||||
|
||||
def testexclude_multi_roms_no_exclusions(self, handler: FSRomsHandler):
|
||||
def test_exclude_multi_roms_no_exclusions(self, handler: FSRomsHandler):
|
||||
"""Test exclude_multi_roms with no exclusions"""
|
||||
roms = ["Game1", "Game2", "Game3"]
|
||||
config = Config(
|
||||
|
||||
@@ -51,6 +51,8 @@ async def test_scan_rom():
|
||||
rom=rom,
|
||||
fs_rom={
|
||||
"fs_name": "Paper Mario (USA).z64",
|
||||
"flat": True,
|
||||
"nested": False,
|
||||
"files": [
|
||||
RomFile(
|
||||
file_name="Paper Mario (USA).z64",
|
||||
@@ -71,8 +73,7 @@ async def test_scan_rom():
|
||||
assert type(rom) is Rom
|
||||
assert rom.fs_name == "Paper Mario (USA).z64"
|
||||
assert rom.name == "Paper Mario"
|
||||
assert rom.fs_path == "n64/Paper Mario (USA)"
|
||||
assert rom.igdb_id == 3340
|
||||
assert rom.fs_size_bytes == 1024
|
||||
assert rom.tags == []
|
||||
assert rom.has_simple_single_file
|
||||
assert not rom.has_multiple_files
|
||||
|
||||
@@ -75,7 +75,7 @@ export type DetailedRomSchema = {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
multi: number;
|
||||
multi: boolean;
|
||||
has_simple_single_file: boolean;
|
||||
has_nested_single_file: boolean;
|
||||
has_multiple_files: boolean;
|
||||
|
||||
@@ -69,7 +69,7 @@ export type SimpleRomSchema = {
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
multi: number;
|
||||
multi: boolean;
|
||||
has_simple_single_file: boolean;
|
||||
has_nested_single_file: boolean;
|
||||
has_multiple_files: boolean;
|
||||
|
||||
Reference in New Issue
Block a user