From: <pau...@us...> - 2012-09-30 22:18:15
|
Revision: 7520 http://docutils.svn.sourceforge.net/docutils/?rev=7520&view=rev Author: paultremblay Date: 2012-09-30 22:18:09 +0000 (Sun, 30 Sep 2012) Log Message: ----------- Fixed so that test_all.py works with changes. (Previous commit failed to check for this.) Modified Paths: -------------- trunk/sandbox/docbook/scripts/docutils_to_docbook.py trunk/sandbox/docbook/test/test_all.py Modified: trunk/sandbox/docbook/scripts/docutils_to_docbook.py =================================================================== --- trunk/sandbox/docbook/scripts/docutils_to_docbook.py 2012-09-30 22:10:33 UTC (rev 7519) +++ trunk/sandbox/docbook/scripts/docutils_to_docbook.py 2012-09-30 22:18:09 UTC (rev 7520) @@ -67,8 +67,7 @@ input_encode = '--input-encoding={0}'.format(in_encoding) output_encode = '--output-encoding=ascii' needed_opts = ['--traceback', '--strip-comments', '--trim-footnote-reference-space', - '--no-doctype', input_encode, output_encode, '--no-generator', - '--newlines', '--indents'] + '--no-doctype', input_encode, output_encode, '--no-generator', ] fh, temp_file = tempfile.mkstemp() if not base: base = [sys.argv[0]] Modified: trunk/sandbox/docbook/test/test_all.py =================================================================== --- trunk/sandbox/docbook/test/test_all.py 2012-09-30 22:10:33 UTC (rev 7519) +++ trunk/sandbox/docbook/test/test_all.py 2012-09-30 22:18:09 UTC (rev 7520) @@ -2,7 +2,7 @@ cur_dir = os.path.dirname(os.path.abspath(sys.argv[0])) lib_dir = os.path.abspath(os.path.join(cur_dir, '..', 'scripts')) sys.path.append(lib_dir) -import docutils_to_xml +import docutils_to_docbook import validate_docbook from xml.dom import minidom @@ -48,7 +48,7 @@ return line def test_utf8(self): - convert_obj = docutils_to_xml.ToXml(in_file = None) + convert_obj = docutils_to_docbook.ToXml(in_file = None) in_file = self._get_file('utf8.rst') needed = """<?xml version="1.0" encoding="ascii"?>\n<!-- Generated by Docutils 0.9 -->\n<document source="data/utf8.rst"><paragraph>LATIN CAPITAL LETTER O WITH DIAERESIS: Ö</paragraph></document>""" return_string = convert_obj.rst_to_xml(in_file = in_file, in_encoding='utf8') @@ -56,7 +56,7 @@ self.assertEqual(return_string, needed) def test_utf16(self): - convert_obj = docutils_to_xml.ToXml(in_file = None) + convert_obj = docutils_to_docbook.ToXml(in_file = None) in_file = self._get_file('utf16.rst') needed = """<?xml version="1.0" encoding="ascii"?>\n<!-- Generated by Docutils 0.9 -->\n<document source="data/utf16.rst"><paragraph>LATIN CAPITAL LETTER O WITH DIAERESIS: Ö</paragraph></document>""" return_string = convert_obj.rst_to_xml(in_file = in_file, in_encoding='utf16') @@ -64,7 +64,7 @@ self.assertEqual(return_string, needed) def test_math_no_conversion(self): - convert_obj = docutils_to_xml.ToXml(in_file = None) + convert_obj = docutils_to_docbook.ToXml(in_file = None) in_file = self._get_file('math.rst') needed="""<?xml version="1.0" encoding="ascii"?> <!-- Generated by Docutils 0.9 --> @@ -74,7 +74,7 @@ self.assertEqual(return_string, needed) def test_math_conversion(self): - convert_obj = docutils_to_xml.ToXml(in_file = None) + convert_obj = docutils_to_docbook.ToXml(in_file = None) in_string = """<?xml version="1.0" encoding="ascii"?> <!-- Generated by Docutils 0.9 --> <document source="data/math.rst"><paragraph>Document tests math directive.</paragraph><math_block xml:space="preserve">quad quad x = (-b +- sqrt(b^2-4ac))/(2a)</math_block></document>""" @@ -85,7 +85,7 @@ def test_to_docbook_simple(self): in_file = os.path.join('data', 'simple_docbook_res.xml') - convert_obj = docutils_to_xml.ToXml(in_file = in_file ) + convert_obj = docutils_to_docbook.ToXml(in_file = in_file ) raw_path = os.path.join('data', 'simple_raw.xml') result_file = convert_obj.to_docbook(raw_path = raw_path) return_string = self._file_to_string(result_file) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |