def test_get_instructions(self):
        """
        Function takes in an input of a specific xml string with surrounding instructions
        tags and returns a valid html string.
        """
        xmltree = etree.fromstring(self.sample_xml)

        expected_xml = u"<div><p>Helper Test Instructions.</p></div>"
        actual_xml = get_instructions(xmltree)
        assert actual_xml is not None
        assert expected_xml.strip() == actual_xml.strip()

        xmltree = etree.fromstring('<annotatable>foo</annotatable>')
        actual = get_instructions(xmltree)
        assert actual is None
    def test_get_instructions(self):
        """
        Function takes in an input of a specific xml string with surrounding instructions
        tags and returns a valid html string.
        """
        xmltree = etree.fromstring(self.sample_xml)

        expected_xml = u"<div><p>Helper Test Instructions.</p></div>"
        actual_xml = get_instructions(xmltree)
        self.assertIsNotNone(actual_xml)
        self.assertEqual(expected_xml.strip(), actual_xml.strip())

        xmltree = etree.fromstring('<annotatable>foo</annotatable>')
        actual = get_instructions(xmltree)
        self.assertIsNone(actual)
Example #3
0
 def _extract_instructions(self, xmltree):
     """ Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
     return get_instructions(xmltree)
 def _extract_instructions(self, xmltree):
     """ Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
     return get_instructions(xmltree)