def test_none(self):
   """ Frames with empty (None) commands/responses should still export. """
   frame = Coqdoc_Frame(command = None, command_cd = None, response = None)
   xml = frame.toxml(doc = BeautifulStoneSoup())
   self.assertEquals(xml.command.text, "")
   self.assertFalse(xml.response)
   self.assertFalse(xml.find(name = "command-coqdoc"))
Ejemplo n.º 2
0
 def test_none(self):
     """ Frames with empty (None) commands/responses should still export. """
     frame = Coqdoc_Frame(command=None, command_cd=None, response=None)
     xml = frame.toxml(doc=BeautifulStoneSoup())
     self.assertEquals(xml.command.text, "")
     self.assertFalse(xml.response)
     self.assertFalse(xml.find(name="command-coqdoc"))
Ejemplo n.º 3
0
    def test_export_entities(self):
        """ Entities that are already escaped should not be escaped again. """
        frame = Coqdoc_Frame(
            command=" ", command_cd=BeautifulStoneSoup("<div>&nbsp;</div>"))
        xml = frame.toxml(doc=BeautifulStoneSoup())

        self.assertEquals(xml.find(name="command-coqdoc").div.text, "&nbsp;")
  def test_export_entities(self):
    """ Entities that are already escaped should not be escaped again. """
    frame = Coqdoc_Frame(command =" ", 
                         command_cd = BeautifulStoneSoup("<div>&nbsp;</div>"))
    xml = frame.toxml(doc = BeautifulStoneSoup())

    self.assertEquals(xml.find(name = "command-coqdoc").div.text, 
                      "&nbsp;")
Ejemplo n.º 5
0
    def test_nested_entities(self):
        """ Test that entities in elements escape correctly. """
        soup = BeautifulStoneSoup("<div>&amp;</div>")
        frame = Coqdoc_Frame(command="foo", response="bar", command_cd=soup)

        xml = frame.toxml(doc=BeautifulStoneSoup())
        self.assertEquals(str(xml.find(name="command-coqdoc").div),
                          "<div>&amp;</div>")
 def test_nested_entities(self):
   """ Test that entities in elements escape correctly. """
   soup = BeautifulStoneSoup("<div>&amp;</div>")
   frame = Coqdoc_Frame(command = "foo", response = "bar",
                        command_cd = soup)
   
   xml = frame.toxml(doc = BeautifulStoneSoup())
   self.assertEquals(str(xml.find(name = "command-coqdoc").div), 
                     "<div>&amp;</div>")
Ejemplo n.º 7
0
    def test_entitities(self):
        """ Test that entities in command, response and coqdoc_command are
        exported to the correct entitity codes when exporting to XML. """

        frame = Coqdoc_Frame(command="&", command_cd="&", response="&")

        xml = frame.toxml(doc=BeautifulStoneSoup())
        self.assertEquals(xml.command.text, "&amp;")
        self.assertEquals(xml.response.text, "&amp;")
 def test_entitities(self):
   """ Test that entities in command, response and coqdoc_command are
       exported to the correct entitity codes when exporting to XML. """
   
   frame = Coqdoc_Frame(command = "&",
                        command_cd = "&", 
                        response = "&")
   
   xml = frame.toxml(doc = BeautifulStoneSoup())
   self.assertEquals(xml.command.text, "&amp;")
   self.assertEquals(xml.response.text, "&amp;")