@@ -168,6 +168,15 @@ def test_params_missing_required(self):
168
168
run_processor (DummyProcessorWithRequiredParameters ,
169
169
workspace = self .workspace , input_file_grp = "OCR-D-IMG" )
170
170
proc .parameter = {'i-am-required' : 'foo' }
171
+ proc .input_file_grp = "OCR-D-IMG"
172
+ proc .output_file_grp = "OCR-D-OUT"
173
+ proc .page_id = []
174
+ proc .process_workspace (self .workspace )
175
+ run_processor (DummyProcessorWithRequiredParameters ,
176
+ workspace = self .workspace ,
177
+ input_file_grp = "OCR-D-IMG" ,
178
+ output_file_grp = "OCR-D-OUT" ,
179
+ parameter = {'i-am-required' : 'foo' })
171
180
172
181
def test_params_preset_resolve (self ):
173
182
with pushd_popd (tempdir = True ) as tempdir :
@@ -433,6 +442,31 @@ def ocrd_tool(self):
433
442
r = self .capture_out_err ()
434
443
assert 'ERROR ocrd.processor.base - Found no file for page phys_0001 in file group GRP1' in r .err
435
444
445
+ @pytest .fixture
446
+ def workspace_sbb ():
447
+ initLogging ()
448
+ with copy_of_directory (assets .path_to ('SBB0000F29300010000/data' )) as workdir :
449
+ with pushd_popd (workdir ):
450
+ resolver = Resolver ()
451
+ workspace = resolver .workspace_from_url ('mets.xml' )
452
+ yield workspace
453
+ disableLogging ()
454
+
455
+ def test_run_output_logging (workspace_sbb , caplog ):
456
+ caplog .set_level (10 )
457
+ def only_profile (logrec ):
458
+ return logrec .name == 'ocrd.process.profile'
459
+ with caplog .filtering (only_profile ):
460
+ proc = run_processor (DummyProcessorWithRequiredParameters ,
461
+ workspace = workspace_sbb ,
462
+ input_file_grp = "OCR-D-IMG" ,
463
+ output_file_grp = "OCR-D-OUT" ,
464
+ parameter = {'i-am-required' : 'foo' })
465
+ assert len (caplog .records ) == 1
466
+ #assert isinstance(proc.parameter, dict)
467
+ msg = caplog .records [0 ].message
468
+ assert msg .startswith ("Executing processor 'ocrd-test' took" )
469
+
436
470
def test_run_output_metsserver (start_mets_server ):
437
471
mets_server_url , ws = start_mets_server
438
472
assert len (ws .mets .find_all_files (fileGrp = "OCR-D-OUT" )) == 0
0 commit comments