@@ -87,12 +87,26 @@ def _ns(**overrides):
8787 output = None ,
8888 interactive = False ,
8989 quiet = False ,
90+ google_scholar = False ,
9091 )
9192 defaults .update (overrides )
9293 return argparse .Namespace (** defaults )
9394
9495 # -- Missing / bad input --------------------------------------------------
9596
97+ def test_google_scholar_flag_passed_through (self , capsys ):
98+ """fix #10: --google-scholar flag must be forwarded to process_references."""
99+ captured = {}
100+
101+ def _fake (* , use_google_scholar , ** kw ):
102+ captured ['gs' ] = use_google_scholar
103+ return {"results" : ["OK" ], "report" : {"total" : 1 , "succeeded" : 1 , "failed_entries" : []}}
104+
105+ with patch ("onecite.cli.process_references" , side_effect = _fake ):
106+ cli .process_command (self ._ns (input_file = "10.1/x" , quiet = True , google_scholar = True ))
107+
108+ assert captured ['gs' ] is True
109+
96110 def test_string_input_passed_directly (self , capsys ):
97111 """fix #36: non-file argument is treated as inline reference content."""
98112 captured = {}
@@ -131,7 +145,7 @@ def test_quiet_writes_to_file(self, tmp_path, capsys):
131145 outf = tmp_path / "out.bib"
132146
133147 def _fake (* , input_content , input_type , template_name ,
134- output_format , interactive_callback ):
148+ output_format , interactive_callback , ** kw ):
135149 # quiet mode → callback should auto-skip
136150 assert interactive_callback (
137151 [{"title" : "T" , "authors" : [], "journal" : "" , "year" : 2020 , "match_score" : 75 }]
@@ -154,7 +168,7 @@ def test_interactive_selects_first(self, tmp_path, capsys):
154168 inf .write_text ("query" , encoding = "utf-8" )
155169
156170 def _fake (* , input_content , input_type , template_name ,
157- output_format , interactive_callback ):
171+ output_format , interactive_callback , ** kw ):
158172 choice = interactive_callback ([
159173 {"title" : "A" , "authors" : ["X" ], "journal" : "J" , "year" : 2020 , "match_score" : 75 },
160174 {"title" : "B" , "authors" : ["Y" ], "journal" : "J" , "year" : 2021 , "match_score" : 74 },
@@ -177,7 +191,7 @@ def test_interactive_invalid_then_skip(self, tmp_path, capsys):
177191 inf .write_text ("query" , encoding = "utf-8" )
178192
179193 def _fake (* , input_content , input_type , template_name ,
180- output_format , interactive_callback ):
194+ output_format , interactive_callback , ** kw ):
181195 choice = interactive_callback ([
182196 {"title" : "A" , "authors" : [], "journal" : "" , "year" : 2020 , "match_score" : 75 },
183197 ])
@@ -196,7 +210,7 @@ def test_interactive_ctrl_c(self, tmp_path, capsys):
196210 inf .write_text ("query" , encoding = "utf-8" )
197211
198212 def _fake (* , input_content , input_type , template_name ,
199- output_format , interactive_callback ):
213+ output_format , interactive_callback , ** kw ):
200214 assert interactive_callback ([
201215 {"title" : "A" , "authors" : [], "journal" : "" , "year" : 2020 , "match_score" : 75 },
202216 ]) == - 1
@@ -229,7 +243,7 @@ def test_output_saved_message_and_failures(self, tmp_path, capsys):
229243 outf = tmp_path / "out.bib"
230244
231245 def _fake (* , input_content , input_type , template_name ,
232- output_format , interactive_callback ):
246+ output_format , interactive_callback , ** kw ):
233247 return {
234248 "results" : ["OK" ],
235249 "report" : {"total" : 2 , "succeeded" : 1 ,
0 commit comments