def test_process_tag_rep_options_replace_element(self): action = "replace-element" attribute = "a very nice attribute" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\na very nice " \ "attribute\nText between the tags." \ "\n<second tag_num= \"2-nd tag's num\">" \ "Other text in the second tag</second>\n" \ "Text after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText "\ "between the tags.\na very nice " \ "attribute\nText after the tags." assert process_tag_replace_options(orig_text=self.no_end, tag="first", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options(orig_text=self.no_end, tag="second", action=action, attribute=attribute) == self.no_end
def test_process_tag_rep_options_remove_tag(self): action = "Remove Tag" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\n Some text in the " \ "first tag \nText between the tags." \ "\n<second tag_num= \"2-nd tag's num\">" \ "Other text in the second tag</second>\n" \ "Text after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText between" \ " the tags.\n Other text in the second " \ "tag \nText after the tags." assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == "The ending tags here are a bit " \ "<second> messed up." assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == "The ending <first> tags here <first> " \ "are a bit messed up."
def test_process_tag_rep_options_remove_tag(self): action = "remove-tag" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\n Some text in the " \ "first tag \nText between the tags." \ "\n<second tag_num= \"2-nd tag's num\">" \ "Other text in the second tag</second>\n" \ "Text after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText between" \ " the tags.\n Other text in the second " \ "tag \nText after the tags." assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == "The ending tags here are a bit " \ "<second> messed up." assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == "The ending <first> tags here <first> " \ "are a bit messed up."
def test_process_tag_rep_options_leave_tag(self): action = "leave-alone" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == self.no_end
def test_process_tag_rep_options_remove_element(self): action = "Remove Element" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\n \nText between the" \ " tags.\n<second tag_num= \"2-nd tag's " \ "num\">Other text in the second tag" \ "</second>\nText after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText between " \ "the tags.\n \nText after the tags." assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == self.no_end
def test_process_tag_rep_options_remove_element(self): action = "remove-element" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\n \nText between the" \ " tags.\n<second tag_num= \"2-nd tag's " \ "num\">Other text in the second tag" \ "</second>\nText after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText between " \ "the tags.\n \nText after the tags." assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == self.no_end
def test_process_tag_rep_options_replace_element(self): action = "replace-element" attribute = "a very nice attribute" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action=action, attribute=attribute) == "Text before tags.\na very nice " \ "attribute\nText between the tags." \ "\n<second tag_num= \"2-nd tag's num\">" \ "Other text in the second tag</second>\n" \ "Text after the tags." assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action=action, attribute=attribute) == "Text before tags.\n<first> Some text in" \ " the first tag </first>\nText "\ "between the tags.\na very nice " \ "attribute\nText after the tags." assert process_tag_replace_options( orig_text=self.no_end, tag="first", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="second", action=action, attribute=attribute) == self.no_end
def test_process_tag_rep_options_other(self): action = "remove-tag" attribute = "" assert process_tag_replace_options( orig_text=self.tag_text, tag="first", action="fake-option", attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.tag_text, tag="second", action="fake-option", attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.no_end, tag="first", action="fake-option", attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="second", action="fake-option", attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.tag_text, tag="Text", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.tag_text, tag=" ", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.tag_text, tag="", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.tag_text, tag=".", action=action, attribute=attribute) == self.tag_text assert process_tag_replace_options( orig_text=self.no_end, tag="Text", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( self.no_end, " ", action, attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag="", action=action, attribute=attribute) == self.no_end assert process_tag_replace_options( orig_text=self.no_end, tag=".", action=action, attribute=attribute) == self.no_end