mirror of
https://github.com/rommapp/romm.git
synced 2026-12-06 07:54:18 +01:00
Ignore Windows Zone.Identifier files
This commit is contained in:
1 parent
9e6337ec12
commit
c15d3e7385
2 files changed
+11
No files matched your search
@@ -47,6 +47,7 @@ DEFAULT_EXCLUDED_FILES: Final = [
|
||||
".Trashes",
|
||||
".stfolder",
|
||||
"@SynoResource",
|
||||
"*:Zone.Identifier",
|
||||
"gamelist.xml",
|
||||
"metadata.pegasus.txt",
|
||||
]
|
||||
|
||||
@@ -9,6 +9,7 @@ from unittest.mock import Mock, patch
|
||||
import pytest
|
||||
from fastapi import UploadFile
|
||||
|
||||
from config.config_manager import DEFAULT_EXCLUDED_FILES
|
||||
from handler.filesystem.base_handler import FSHandler
|
||||
from models.base import FILE_NAME_MAX_LENGTH
|
||||
|
||||
@@ -199,6 +200,15 @@ class TestFSHandler:
|
||||
assert "game.nds" in result
|
||||
assert "game.rom" in result
|
||||
|
||||
def test_exclude_single_files_zone_identifier(self, handler: FSHandler):
|
||||
files = ["game.iso", "game.iso:Zone.Identifier"]
|
||||
|
||||
with patch("handler.filesystem.base_handler.cm.get_config") as mock_config:
|
||||
mock_config.return_value.EXCLUDED_SINGLE_EXT = []
|
||||
mock_config.return_value.EXCLUDED_SINGLE_FILES = DEFAULT_EXCLUDED_FILES
|
||||
|
||||
assert handler.exclude_single_files(files) == ["game.iso"]
|
||||
|
||||
async def test_make_directory(self, handler: FSHandler):
|
||||
"""Test directory creation"""
|
||||
await handler.make_directory("test_dir")
|
||||
|
||||
Reference in new issue
Block a user