1- """Test for the BookkeepingReport command class."""
1+ """Test for the ReportBookkeeping command class."""
22
33import time
44import xml .etree .ElementTree as ET
1111from LHCbDIRAC .Core .Utilities .XMLSummaries import XMLSummary
1212from pytest_mock import MockerFixture
1313
14- from dirac_cwl .commands import BookkeepingReport
14+ from dirac_cwl .commands import ReportBookkeeping
1515from dirac_cwl .commands .workflow_commons import StepStatus , WorkflowCommons
1616
1717
@@ -41,31 +41,31 @@ def get_output_file_details(output_file):
4141 return details
4242
4343
44- class TestBookkeepingReport :
45- """Collection of tests for the BookkeepingReport command."""
44+ class TestReportBookkeeping :
45+ """Collection of tests for the ReportBookkeeping command."""
4646
4747 number_of_processors = 1
4848
4949 @pytest .fixture
50- def bk_report (self , mocker : MockerFixture , job_path ):
51- """BookkeepingReport mocked command.
50+ def report_bk (self , mocker : MockerFixture , job_path ):
51+ """ReportBookkeeping mocked command.
5252
5353 Cleans created files after execution.
5454 """
55- mock_get_n_procs = mocker .patch ("dirac_cwl.commands.bookkeeping_report .getNumberOfProcessorsToUse" )
55+ mock_get_n_procs = mocker .patch ("dirac_cwl.commands.report_bookkeeping .getNumberOfProcessorsToUse" )
5656 mock_get_n_procs .return_value = self .number_of_processors
5757
58- yield BookkeepingReport ()
58+ yield ReportBookkeeping ()
5959
6060 Path (job_path ).joinpath ("00209455_00001537_1" ).unlink (missing_ok = True )
6161 Path (job_path ).joinpath ("00209455_00001537_1.sim" ).unlink (missing_ok = True )
6262 Path (job_path ).joinpath ("application.log" ).unlink (missing_ok = True )
6363 Path (job_path ).joinpath ("workflow_commons.json" ).unlink (missing_ok = True )
6464
65- def test_bkreport_prod_mcsimulation_success (
66- self , bk_report , job_path , wf_commons , bookkeeping_file , xml_summary_file
65+ def test_report_bk_prod_mcsimulation_success (
66+ self , report_bk , job_path , wf_commons , bookkeeping_file , xml_summary_file
6767 ):
68- """Test successful execution of BookkeepingReport module."""
68+ """Test successful execution of ReportBookkeeping module."""
6969 wf_commons ["steps" ][0 ]["application_name" ] = "Gauss"
7070 wf_commons ["job_type" ] = "MCSimulation"
7171
@@ -124,7 +124,7 @@ def test_bkreport_prod_mcsimulation_success(
124124
125125 WorkflowCommons (** wf_commons ).save (job_path )
126126
127- bk_report .execute (job_path )
127+ report_bk .execute (job_path )
128128
129129 updated_wf_commons = WorkflowCommons .load (job_path )
130130
@@ -187,17 +187,17 @@ def test_bkreport_prod_mcsimulation_success(
187187
188188 assert len (output_files ) == 1
189189
190- def test_bkreport_prod_mcsimulation_noinputoutput_success (
191- self , bk_report , job_path , wf_commons , bookkeeping_file , xml_summary_file
190+ def test_report_bk_prod_mcsimulation_noinputoutput_success (
191+ self , report_bk , job_path , wf_commons , bookkeeping_file , xml_summary_file
192192 ):
193- """Test successful execution of BookkeepingReport module.
193+ """Test successful execution of ReportBookkeeping module.
194194
195195 * No input files because wf_commons["stepInputData is empty
196196 * No output files because wf_commons["stepOutputData is empty
197197 * No pool xml catalog
198198 * Simulation conditions because the application used is Gauss
199199 """
200- # Mock the BookkeepingReport module
200+ # Mock the ReportBookkeeping module
201201 wf_commons ["steps" ][0 ]["application_name" ] = "Gauss"
202202 wf_commons ["job_type" ] = "MCSimulation"
203203
@@ -251,7 +251,7 @@ def test_bkreport_prod_mcsimulation_noinputoutput_success(
251251
252252 WorkflowCommons (** wf_commons ).save (job_path )
253253
254- bk_report .execute (job_path )
254+ report_bk .execute (job_path )
255255
256256 updated_wf_commons = WorkflowCommons .load (job_path )
257257
@@ -305,10 +305,10 @@ def test_bkreport_prod_mcsimulation_noinputoutput_success(
305305 output_file = root .find ("OutputFile" )
306306 assert output_file is None , "OutputFile element should not be present."
307307
308- def test_bk_report_prod_mcreconstruction_success (
309- self , bk_report , job_path , wf_commons , bookkeeping_file , xml_summary_file
308+ def test_report_bk_prod_mcreconstruction_success (
309+ self , report_bk , job_path , wf_commons , bookkeeping_file , xml_summary_file
310310 ):
311- """Test successful execution of BookkeepingReport module."""
311+ """Test successful execution of ReportBookkeeping module."""
312312 wf_commons ["steps" ][0 ]["application_name" ] = "Boole"
313313 wf_commons ["job_type" ] = "MCReconstruction"
314314
@@ -359,7 +359,7 @@ def test_bk_report_prod_mcreconstruction_success(
359359
360360 WorkflowCommons (** wf_commons ).save (job_path )
361361
362- bk_report .execute (job_path )
362+ report_bk .execute (job_path )
363363
364364 updated_wf_commons = WorkflowCommons .load (job_path )
365365
@@ -427,7 +427,7 @@ def test_bk_report_prod_mcreconstruction_success(
427427 simulation_condition = root .find ("SimulationCondition" )
428428 assert simulation_condition is None , "SimulationCondition element should not be present."
429429
430- def test_bkreport_previousError_success (self , bk_report , job_path , wf_commons , bookkeeping_file ):
430+ def test_report_bk_previousError_success (self , report_bk , job_path , wf_commons , bookkeeping_file ):
431431 """Test previous command failure."""
432432 wf_commons ["steps" ][0 ]["application_name" ] = "Gauss"
433433 wf_commons ["steps" ][0 ]["application_version" ] = wf_commons ["config_version" ]
@@ -436,6 +436,6 @@ def test_bkreport_previousError_success(self, bk_report, job_path, wf_commons, b
436436
437437 WorkflowCommons (** wf_commons ).save (job_path )
438438
439- bk_report .execute (job_path )
439+ report_bk .execute (job_path )
440440
441441 assert not Path (bookkeeping_file ).exists ()
0 commit comments