def test_custom_encoding(self):
     encoding = 'ISO-8859-1'
     self.writer.close()
     self.writer = XmlWriter(PATH, encoding=encoding)
     self.writer.element('test', u'hyv\xe4')
     self._verify_content('encoding="ISO-8859-1"', encoding=encoding)
     self._verify_node(None, 'test', u'hyv\xe4')
Beispiel #2
0
 def write(self, libdoc, outfile):
     formatter = DocFormatter(libdoc.doc_format, self._force_html_doc)
     writer = XmlWriter(outfile, usage='Libdoc output')
     self._write_start(libdoc, writer, formatter)
     self._write_keywords('init', libdoc.inits, writer, formatter)
     self._write_keywords('kw', libdoc.keywords, writer, formatter)
     self._write_end(writer)
 def write(self, libdoc, outfile):
     if self._spec_doc_format == 'HTML':
         libdoc.convert_doc_to_html()
     writer = XmlWriter(outfile, usage='Libdoc spec')
     self._write_start(libdoc, writer)
     self._write_keywords('inits', 'init', libdoc.inits, libdoc.source, writer)
     self._write_keywords('keywords', 'kw', libdoc.keywords, libdoc.source, writer)
     self._write_end(writer)
Beispiel #4
0
 def _get_writer(self, path, rpa, generator):
     if not path:
         return NullMarkupWriter()
     writer = XmlWriter(path, write_empty=False, usage='output')
     writer.start('robot', {'generator': get_full_version(generator),
                            'generated': get_timestamp(),
                            'rpa': 'true' if rpa else 'false'})
     return writer
Beispiel #5
0
 def _get_writer(self, path, generator):
     if not path:
         return NullMarkupWriter()
     try:
         writer = XmlWriter(path, encoding='UTF-8')
     except EnvironmentError, err:
         raise DataError("Opening output file '%s' failed: %s" %
                         (path, err.strerror))
Beispiel #6
0
 def write(self, libdoc, outfile):
     writer = XmlWriter(outfile, usage='Libdoc spec')
     self._write_start(libdoc, writer)
     self._write_keywords('inits', 'init', libdoc.inits, libdoc.source,
                          writer)
     self._write_keywords('keywords', 'kw', libdoc.keywords, libdoc.source,
                          writer)
     self._write_end(writer)
Beispiel #7
0
 def write(self, libdoc, outfile):
     writer = XmlWriter(outfile, usage='Libdoc spec')
     self._write_start(libdoc, writer)
     self._write_keywords('inits', 'init', libdoc.inits, libdoc.source, writer)
     self._write_keywords('keywords', 'kw', libdoc.keywords, libdoc.source, writer)
     # Write deprecated '<datatypes>' element.
     self._write_data_types(libdoc.type_docs, writer)
     # Write new '<types>' element.
     self._write_type_docs(libdoc.type_docs, writer)
     self._write_end(writer)
Beispiel #8
0
 def _get_writer(self, path, generator):
     if not path:
         return NullMarkupWriter()
     try:
         writer = XmlWriter(path, encoding='UTF-8', write_empty=False)
     except EnvironmentError as err:
         raise DataError("Opening output file '%s' failed: %s" %
                         (path, err.strerror))
     writer.start('robot', {'generator': get_full_version(generator),
                            'generated': get_timestamp()})
     return writer
Beispiel #9
0
 def write(self, libdoc, outfile):
     writer = XmlWriter(outfile, encoding='UTF-8')
     writer.start('keywordspec', {'name': libdoc.name, 'type': libdoc.type,
                                  'generated': get_timestamp(millissep=None)})
     writer.element('version', libdoc.version)
     writer.element('scope', libdoc.scope)
     writer.element('namedargs', 'yes' if libdoc.named_args else 'no')
     writer.element('doc', libdoc.doc)
     self._write_keywords('init', libdoc.inits, writer)
     self._write_keywords('kw', libdoc.keywords, writer)
     writer.end('keywordspec')
     writer.close()
 def write(self, output):
     xml_writer = XmlWriter(output, usage='xunit')
     writer = XUnitFileWriter(xml_writer)
     self._execution_result.visit(writer)
 def setUp(self):
     self.writer = XmlWriter(PATH)
Beispiel #12
0
 def write(self, output):
     writer = XUnitFileWriter(XmlWriter(output, encoding='UTF-8'),
                              self._skip_noncritical)
     self._execution_result.visit(writer)
Beispiel #13
0
 def __init__(self, output):
     self._writer = XmlWriter(output, encoding='UTF-8')
     self._root_suite = None