mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
fix case when provided trigger path is directory
If trigger is directory and we have permissions to read it, the loaded will try to load this from it and will fail with IsADirectoryError
This commit is contained in:
@ -58,6 +58,15 @@ def test_load_trigger_path(trigger_loader: TriggerLoader, resource_path_root: Pa
|
||||
assert trigger_loader._load_trigger(f"{path}.ReportTrigger")
|
||||
|
||||
|
||||
def test_load_trigger_path_directory(trigger_loader: TriggerLoader, resource_path_root: Path) -> None:
|
||||
"""
|
||||
must raise InvalidExtension if provided import path is directory
|
||||
"""
|
||||
path = resource_path_root.parent.parent / "src" / "ahriman" / "core" / "report"
|
||||
with pytest.raises(InvalidExtension):
|
||||
trigger_loader._load_trigger(f"{path}.ReportTrigger")
|
||||
|
||||
|
||||
def test_load_trigger_path_not_found(trigger_loader: TriggerLoader) -> None:
|
||||
"""
|
||||
must raise InvalidExtension if file cannot be found
|
||||
|
Reference in New Issue
Block a user