def test_f6_tally_scale_results(f6_tally_data): # arrange F6_object = tallies.F6Tally(f6_tally_data) # act F6_object.scale_result(scaling_factor=2) # assert assert F6_object.results['3']['result'] == 2.45307E-05 * 2
def test_f6_init_calls_subclass_results(mocker, f6_tally_data): # arrange tally_data = f6_tally_data mocked_subclass_get_results = mocker.patch('eddymc.mcnp.tallies.F6Tally.get_results', return_value=None) mocked_superclass_get_results = mocker.patch('eddymc.mcnp.tallies.Tally.get_results', return_value=None) # act tallies.F6Tally(tally_data) # assert mocked_subclass_get_results.assert_any_call() mocked_superclass_get_results.assert_not_called()
def test_f6_init_creates_f6plus_object(f6_plus_tally_data): # arrange tally_data = f6_plus_tally_data # act F6_object = tallies.F6Tally(tally_data) # assert assert type(F6_object) == tallies.F6Tally assert F6_object.tally_type == "energy deposition units mev/gram" assert F6_object.particles == "Collision Heating" assert F6_object.f_type == "F6+" assert F6_object.dose_functions == "This tally is not modified by any dose function"
def test_f6_init_creates_object(f6_tally_data): # arrange tally_data = f6_tally_data # act F6_object = tallies.F6Tally(tally_data) # assert assert type(F6_object) == tallies.F6Tally assert F6_object.tally_type == "track length estimate of heating. units mev/gram" assert F6_object.particles == "neutrons" assert F6_object.f_type == "F6" assert F6_object.dose_functions == "This tally is not modified by any dose function"
def test_f6_plus_tally_get_results(f6_plus_tally_data): # arrange tally = tallies.F6Tally(f6_plus_tally_data) # act tally.results = tally.get_results() # assert assert type(tally.results) == dict assert tally.results['3']['region'] == "Cell 3" assert tally.results['3']['result'] == 2.60440E-05 assert tally.results['3']['variance'] == 0.0005 assert tally.results['4']['region'] == "Cell 4" assert tally.results['4']['result'] == 2.13145E-05 assert tally.results['4']['variance'] == 0.0005