def test_setting_radius_to_valid_value(self): # Arrange trans_radius = 23 command_iface.Clean() command_iface.SANS2D() # Act command_iface.SetTransmissionRadiusInMM(trans_radius = trans_radius) # Assert self.assertEqual(trans_radius, command_iface.GetTransmissionRadiusInMM(), 'The transmission radius should be set to 23.')
def test_setting_radius_with_invalid_input(self): # Arrange trans_radius = '23_yh' command_iface.Clean() command_iface.SANS2D() # Act command_iface.SetTransmissionRadiusInMM(trans_radius = trans_radius) # Assert self.assertEqual(None, command_iface.GetTransmissionRadiusInMM(), 'The transmission radius should be None.')
def test_that_gets_transmission_radius(self): # Arrange trans_radius = 23/1000 command_iface.Clean() command_iface.SANS2D() ReductionSingleton().transmission_calculator.radius = trans_radius # Act result = command_iface.GetTransmissionRadiusInMM() # Assert self.assertEqual(trans_radius*1000, result, 'The transmission radius should be set to 23 mm.')