Пример #1
0
 def test_error_is_ignored_for_more_than_one_spectrum(self):
     # Arrange
     orig_name = "orig"
     can_name = "can"
     result_name = "result"
     provide_workspace_with_x_errors(orig_name, True, 2)
     provide_workspace_with_x_errors(can_name, True, 2)
     provide_workspace_with_x_errors(result_name, False, 2)
     orig = mtd[orig_name]
     can = mtd[can_name]
     result = mtd[result_name]
     # Act
     su.correct_q_resolution_for_can(orig, can, result)
     # Assert
     self.assertFalse(result.hasDx(0))
     # Clean up
     DeleteWorkspace(orig)
     DeleteWorkspace(can)
     DeleteWorkspace(result)
Пример #2
0
 def test_error_is_not_passed_on_when_did_not_exist_beforehand(self):
     # Arrange
     orig_name = "orig"
     can_name = "can"
     result_name = "result"
     provide_workspace_with_x_errors(orig_name, False, 1)
     provide_workspace_with_x_errors(can_name, False, 1)
     provide_workspace_with_x_errors(result_name, False, 1)
     orig = mtd[orig_name]
     can = mtd[can_name]
     result = mtd[result_name]
     # Act
     su.correct_q_resolution_for_can(orig, can, result)
     # Assert
     self.assertFalse(result.hasDx(0))
     # Clean up
     DeleteWorkspace(orig)
     DeleteWorkspace(can)
     DeleteWorkspace(result)
Пример #3
0
 def test_error_is_passed_from_original_to_subtracted_workspace(self):
     # Arrange
     orig_name = "orig"
     can_name = "can"
     result_name = "result"
     provide_workspace_with_x_errors(orig_name, True)
     provide_workspace_with_x_errors(can_name, True)
     provide_workspace_with_x_errors(result_name, False)
     orig = mtd[orig_name]
     can = mtd[can_name]
     result = mtd[result_name]
     # Act
     su.correct_q_resolution_for_can(orig, can, result)
     # Assert
     dx_orig = orig.dataDx(0)
     dx_result = result.dataDx(0)
     self.assertTrue(result.hasDx(0))
     for index in range(0, len(dx_orig)):
         self.assertEqual(dx_orig[index], dx_result[index])
     # Clean up
     DeleteWorkspace(orig)
     DeleteWorkspace(can)
     DeleteWorkspace(result)