def test_bad_config(self): sio = StringIO() with support.stderr_replaced(sio): res = run_validator("--schema", support.input_file("simple.xml"), support.input_file("outer.conf")) self.assertEqual(res, 1) self.assertIn("'refouter' is not a known key name", sio.getvalue())
def test_cover_all_schemas(self): for name in ('base-datatype1.xml', 'base-datatype2.xml', 'base-keytype1.xml', 'base-keytype2.xml', 'base.xml', 'library.xml', 'simplesections.xml',): res = run_transform(support.input_file(name)) self.assertIn('</html>', res.getvalue()) run_transform_rst(support.input_file(name))
def test_html_section_example(self): name = 'simplesections.xml' res = run_transform(support.input_file(name)) out = res.getvalue() self.assertIn('Section Example', out) self.assertIn('Multisection Example', out)
def test_schema_only(self): res = run_transform(support.input_file('simple.xml')) self.assertIn('</html>', res.getvalue()) run_transform_rst(support.input_file('simple.xml'))
def test_good_config(self): res = run_validator("--schema", support.input_file('simple.xml'), support.input_file('simple.conf'), support.input_file('simple.conf')) self.assertEqual(res, 0)
def test_schema_only_redirect(self): res = run_validator("--schema", support.input_file('simple.xml')) self.assertEqual(res, 0)