def test_get_fragment_target_ampersand_inside_word(self): """Test with ampersand occurring inside the word.""" utterance = 'dont&handle' actual_output = Extractor.get_fragment_target(utterance) desired_output = 'dont&handle' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_one_char_fragment(self): """Test with a fragment consisting of one character.""" utterance = 'This is &a test' actual_output = Extractor.get_fragment_target(utterance) desired_output = 'This is xxx test' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_ampersand_outside(self): """Test get_fragment_target with ampersand outside fragment.""" utterance = '&=laugh &wow &-um' actual_output = Extractor.get_fragment_target(utterance) desired_output = '&=laugh xxx &-um' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_no_fragments(self): """Test get_fragment_target using an utt without fragments.""" utterance = 'a b .' actual_output = Extractor.get_fragment_target(utterance) desired_output = 'a b .' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_multiple_fragments(self): """Test get_fragment_target with 3 fragments.""" utterance = '&ab a &ab b &ab .' actual_output = Extractor.get_fragment_target(utterance) desired_output = 'xxx a xxx b xxx .' self.assertEqual(actual_output, desired_output)
def test_get_fragment_target_one_fragment(self): """Test get_fragment_target with 1 fragment.""" utterance = '&ab .' actual_output = Extractor.get_fragment_target(utterance) desired_output = 'xxx .' self.assertEqual(actual_output, desired_output)