def test_get_counts_workspace_for_run_throws_a_key_error_if_workspace_not_found( self): group = create_group_populated_by_two_binned_and_two_unbinned_workspaces( ) with self.assertRaises(KeyError): group.get_counts_workspace_for_run([222223], True)
def test_nothing_returned_if_workspace_does_not_exist(self): group = create_group_populated_by_two_binned_and_two_unbinned_workspaces( ) rebinned_workspace_name = group.get_rebined_or_unbinned_version_of_workspace_if_it_exists( 'asymmetry_name_43333_rebin') self.assertEqual(rebinned_workspace_name, None)
def test_binned_asymmetry_name_returns_unbinned_name(self): group = create_group_populated_by_two_binned_and_two_unbinned_workspaces( ) rebinned_workspace_name = group.get_rebined_or_unbinned_version_of_workspace_if_it_exists( 'asymmetry_name_33333_rebin') self.assertEqual(rebinned_workspace_name, 'asymmetry_name_33333')
def test_get_counts_workspace_for_run_returns_workspace_name_if_it_exists( self): group = create_group_populated_by_two_binned_and_two_unbinned_workspaces( ) counts_workspace_name = group.get_counts_workspace_for_run([22222], False) rebinned_counts_workspace_name = group.get_counts_workspace_for_run( [22222], True) self.assertEqual(counts_workspace_name, 'counts_name_22222') self.assertEqual(rebinned_counts_workspace_name, 'counts_name_22222_rebin')