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