def test_get_fragment_actual_ampersand_inside_word(self): """Test with ampersand occurring inside the word.""" utterance = 'dont&delete' actual_output = Extractor.get_fragment_actual(utterance) desired_output = 'dont&delete' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_empty_string(self): """Test get_fragment_target with an empty string.""" utterance = '' actual_output = Extractor.get_fragment_actual(utterance) desired_output = '' self.assertEqual(actual_output, desired_output)
def test_get_fragment_actual_one_char_fragment(self): """Test with a fragment consisting of one character.""" utterance = 'This is &a test' actual_output = Extractor.get_fragment_actual(utterance) desired_output = 'This is a test' self.assertEqual(actual_output, desired_output)
def test_get_fragment_actual_ampersand_outside(self): """Test get_fragment_actual with ampersand outside fragment.""" utterance = '&=laugh &wow &-um' actual_output = Extractor.get_fragment_actual(utterance) desired_output = '&=laugh wow &-um' self.assertEqual(actual_output, desired_output)
def test_get_fragment_actual_no_fragments(self): """Test get_fragment_actual using an utt without fragments.""" utterance = 'a b .' actual_output = Extractor.get_fragment_actual(utterance) desired_output = 'a b .' self.assertEqual(actual_output, desired_output)
def test_get_fragment_actual_multiple_fragments(self): """Test get_fragment_actual with 3 fragments.""" utterance = '&ab a &ab b &ab .' actual_output = Extractor.get_fragment_actual(utterance) desired_output = 'ab a ab b ab .' self.assertEqual(actual_output, desired_output)
def test_get_fragment_actual_one_fragment(self): """Test get_fragment_actual with 1 fragment.""" utterance = '&ab .' actual_output = Extractor.get_fragment_actual(utterance) desired_output = 'ab .' self.assertEqual(actual_output, desired_output)