def test_no_transmission_workspace_names_returned_if_not_in_ADS(self): # Check transmission sample returned_name = get_transmission_names_to_save(self.reduction_package_transmissions, False) self.assertEqual(returned_name, '', "Should have returned an empty string because " "transmission sample was not in the ADS. " "Returned {} instead.".format(returned_name)) # Check transmission_can returned_name = get_transmission_names_to_save(self.reduction_package_transmissions, True) self.assertEqual(returned_name, '', "Should have returned an empty string because " "transmission can was not in the ADS. " "Returned {} instead".format(returned_name))
def test_no_transmission_workspace_names_returned_if_not_in_ADS(self): # Check transmission sample returned_name = get_transmission_names_to_save(self.reduction_package_transmissions, False) self.assertEqual(returned_name, [], "Should have returned an empty string because " "transmission sample was not in the ADS. " "Returned {} instead.".format(returned_name)) # Check transmission_can returned_name = get_transmission_names_to_save(self.reduction_package_transmissions, True) self.assertEqual(returned_name, [], "Should have returned an empty string because " "transmission can was not in the ADS. " "Returned {} instead".format(returned_name))
def test_that_empty_string_returned_if_transmission_base_name_is_none(self): # Test when base name is None reduction_package = self.reduction_package reduction_package.unfitted_transmission_base_name = None returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, '', "Should have returned an empty string because " "transmission sample base name was None. " "Returned {} instead".format(returned_name)) # Test when base name is not None but name is None reduction_package.unfitted_transmission_base_name = 'Base' reduction_package.unfitted_transmission_name = None returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, '', "Should have returned an empty string because " "transmission sample name was None. " "Returned {} instead".format(returned_name))
def test_that_empty_string_returned_if_transmission_base_name_is_none(self): # Test when base name is None reduction_package = self.reduction_package reduction_package.unfitted_transmission_base_name = None returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, [], "Should have returned an empty string because " "transmission sample base name was None. " "Returned {} instead".format(returned_name)) # Test when base name is not None but name is None reduction_package.unfitted_transmission_base_name = 'Base' reduction_package.unfitted_transmission_name = None returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, [], "Should have returned an empty string because " "transmission sample name was None. " "Returned {} instead".format(returned_name))
def test_transmission_workspace_names_from_reduction_package_are_returned_if_in_ADS(self): reduction_package = self.reduction_package_transmissions reduction_package.unfitted_transmission_base_name = 'Base' reduction_package.unfitted_transmission_name = 'transmission' reduction_package.unfitted_transmission_can_base_name = 'Base' reduction_package.unfitted_transmission_can_name = 'transmission_can' # Check transmission sample returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, 'transmission', "Should have transmission as name because " "transmission sample was in the ADS. " "Returned {} instead.".format(returned_name)) # Check transmission_can returned_name = get_transmission_names_to_save(reduction_package, True) self.assertEqual(returned_name, 'transmission_can', "Should have returned transmission can as name because " "transmission can was not in the ADS. " "Returned {} instead.".format(returned_name))
def test_transmission_workspace_names_from_reduction_package_are_returned_if_in_ADS(self): reduction_package = self.reduction_package_transmissions reduction_package.unfitted_transmission_base_name = 'Base' reduction_package.unfitted_transmission_name = ['transmission'] reduction_package.unfitted_transmission_can_base_name = 'Base' reduction_package.unfitted_transmission_can_name = ['transmission_can'] # Check transmission sample returned_name = get_transmission_names_to_save(reduction_package, False) self.assertEqual(returned_name, ['transmission'], "Should have transmission as name because " "transmission sample was in the ADS. " "Returned {} instead.".format(returned_name)) # Check transmission_can returned_name = get_transmission_names_to_save(reduction_package, True) self.assertEqual(returned_name, ['transmission_can'], "Should have returned transmission can as name because " "transmission can was not in the ADS. " "Returned {} instead.".format(returned_name))