Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)