Ejemplo n.º 1
0
    def test_bytechunks_quoteattr_cr(self):

        context = dict()
        attrs = dict(char='\r')
        item = (ControlChar, attrs, context)
        modelevents = [(STARTEVENT, item), (ENDEVENT, item)]
        xmlevents = XmlEvents(iter(modelevents))
        xml = ''.join(xmlevents.bytechunks())

        self.assertTrue('
' in xml)
Ejemplo n.º 2
0
    def test_bytechunks_quoteattr_cr(self):

        context = dict()
        attrs = dict(char='\r')
        item = (ControlChar, attrs, context)
        modelevents = [(STARTEVENT, item),
                       (ENDEVENT, item)]
        xmlevents = XmlEvents(iter(modelevents))
        xml = b''.join(xmlevents.bytechunks())

        self.assertTrue(b'
' in xml)
Ejemplo n.º 3
0
    def test_dump_quoteattr_cr(self):
        sio = BytesIO()

        context = dict()
        attrs = dict(char='\r')
        events = [(STARTEVENT, (ControlChar, attrs, context)),
                  (ENDEVENT, (ControlChar, attrs, context))]
        xmlevents = XmlEvents(iter(events))
        xmlevents.dump(sio)

        data = sio.getvalue()
        self.assertTrue(b'
' in data)
Ejemplo n.º 4
0
    def test_dump_quoteattr_cr(self):
        sio = BytesIO()

        context = dict()
        attrs = dict(char='\r')
        events = [(STARTEVENT, (ControlChar, attrs, context)),
                  (ENDEVENT, (ControlChar, attrs, context))]
        xmlevents = XmlEvents(iter(events))
        xmlevents.dump(sio)

        data = sio.getvalue()
        self.assertTrue('
' in data)
Ejemplo n.º 5
0
    def test_bytechunks_quoteattr_cr(self):
        from hwp5.xmlmodel import XmlEvents
        from hwp5.treeop import STARTEVENT, ENDEVENT
        from hwp5.binmodel import ControlChar

        context = dict()
        attrs = dict(char='\r')
        item = (ControlChar, attrs, context)
        modelevents = [(STARTEVENT, item), (ENDEVENT, item)]
        xmlevents = XmlEvents(iter(modelevents))
        xml = ''.join(xmlevents.bytechunks())

        self.assertTrue('
' in xml)
Ejemplo n.º 6
0
    def test_bytechunks_quoteattr_cr(self):
        from hwp5.xmlmodel import XmlEvents
        from hwp5.treeop import STARTEVENT, ENDEVENT
        from hwp5.binmodel import ControlChar

        context = dict()
        attrs = dict(char='\r')
        item = (ControlChar, attrs, context)
        modelevents = [(STARTEVENT, item),
                       (ENDEVENT, item)]
        xmlevents = XmlEvents(iter(modelevents))
        xml = ''.join(xmlevents.bytechunks())

        self.assertTrue('
' in xml)
Ejemplo n.º 7
0
    def test_dump_quoteattr_cr(self):
        from hwp5.xmlmodel import XmlEvents
        from hwp5.importhelper import importStringIO
        from hwp5.treeop import STARTEVENT, ENDEVENT
        from hwp5.binmodel import ControlChar
        StringIO = importStringIO()
        sio = StringIO()

        context = dict()
        attrs = dict(char='\r')
        events = [(STARTEVENT, (ControlChar, attrs, context)),
                  (ENDEVENT, (ControlChar, attrs, context))]
        xmlevents = XmlEvents(iter(events))
        xmlevents.dump(sio)

        data = sio.getvalue()
        self.assertTrue('
' in data)
Ejemplo n.º 8
0
    def test_dump_quoteattr_cr(self):
        from hwp5.xmlmodel import XmlEvents
        from hwp5.importhelper import importStringIO
        from hwp5.treeop import STARTEVENT, ENDEVENT
        from hwp5.binmodel import ControlChar
        StringIO = importStringIO()
        sio = StringIO()

        context = dict()
        attrs = dict(char='\r')
        events = [(STARTEVENT, (ControlChar, attrs, context)),
                  (ENDEVENT, (ControlChar, attrs, context))]
        xmlevents = XmlEvents(iter(events))
        xmlevents.dump(sio)

        data = sio.getvalue()
        self.assertTrue('
' in data)