44import pytest
55from omegaconf import OmegaConf
66
7- from zotero_arxiv_daily .executor import Executor , normalize_path_patterns , normalize_include_path_patterns , normalize_ignore_path_patterns
7+ from zotero_arxiv_daily .executor import Executor , normalize_path_patterns
88from zotero_arxiv_daily .protocol import CorpusPaper
99
1010
1111def test_normalize_include_path_patterns_rejects_single_string ():
1212 with pytest .raises (TypeError , match = "config.zotero.include_path must be a list of glob patterns or null" ):
13- normalize_include_path_patterns ("2026/survey/**" )
13+ normalize_path_patterns ("2026/survey/**" , "include_path " )
1414
1515
1616def test_normalize_include_path_patterns_accepts_list_config ():
1717 include_path = OmegaConf .create (["2026/survey/**" , "2026/reading-group/**" ])
1818
19- assert normalize_include_path_patterns (include_path ) == [
19+ assert normalize_path_patterns (include_path , "include_path" ) == [
2020 "2026/survey/**" ,
2121 "2026/reading-group/**" ,
2222 ]
@@ -27,7 +27,7 @@ def test_filter_corpus_matches_any_path_against_any_pattern():
2727 executor .config = SimpleNamespace (
2828 zotero = SimpleNamespace (include_path = ["2026/survey/**" , "2026/reading-group/**" ])
2929 )
30- executor .include_path_patterns = normalize_include_path_patterns (executor .config .zotero .include_path )
30+ executor .include_path_patterns = normalize_path_patterns (executor .config .zotero .include_path , "include_path" )
3131 executor .ignore_path_patterns = None
3232
3333 corpus = [
@@ -58,23 +58,23 @@ def test_filter_corpus_matches_any_path_against_any_pattern():
5858
5959def test_normalize_ignore_path_patterns_rejects_single_string ():
6060 with pytest .raises (TypeError , match = "config.zotero.ignore_path must be a list of glob patterns or null" ):
61- normalize_ignore_path_patterns ("archive/**" )
61+ normalize_path_patterns ("archive/**" , "ignore_path " )
6262
6363
6464def test_normalize_ignore_path_patterns_accepts_list_config ():
6565 ignore_path = OmegaConf .create (["archive/**" , "2025/**" ])
6666
67- assert normalize_ignore_path_patterns (ignore_path ) == ["archive/**" , "2025/**" ]
67+ assert normalize_path_patterns (ignore_path , "ignore_path" ) == ["archive/**" , "2025/**" ]
6868
6969
7070def test_normalize_ignore_path_patterns_accepts_empty_list ():
71- assert normalize_ignore_path_patterns ([]) == []
71+ assert normalize_path_patterns ([], "ignore_path" ) == []
7272
7373
7474def test_filter_corpus_excludes_papers_matching_ignore_path ():
7575 executor = Executor .__new__ (Executor )
7676 executor .include_path_patterns = None
77- executor .ignore_path_patterns = normalize_ignore_path_patterns (["archive/**" , "2025/**" ])
77+ executor .ignore_path_patterns = normalize_path_patterns (["archive/**" , "2025/**" ], "ignore_path" )
7878
7979 corpus = [
8080 CorpusPaper (
@@ -105,8 +105,8 @@ def test_filter_corpus_excludes_papers_matching_ignore_path():
105105def test_filter_corpus_ignore_path_takes_precedence_over_include_path ():
106106 """Papers matching both include_path and ignore_path should be excluded."""
107107 executor = Executor .__new__ (Executor )
108- executor .include_path_patterns = normalize_include_path_patterns (["2026/**" ])
109- executor .ignore_path_patterns = normalize_ignore_path_patterns (["2026/ignore/**" ])
108+ executor .include_path_patterns = normalize_path_patterns (["2026/**" ], "include_path" )
109+ executor .ignore_path_patterns = normalize_path_patterns (["2026/ignore/**" ], "ignore_path" )
110110
111111 corpus = [
112112 CorpusPaper (
0 commit comments