示例#1
0
 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())
示例#2
0
 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())
示例#3
0
 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))
示例#4
0
 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)
示例#5
0
 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'))
示例#6
0
 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)
示例#7
0
 def test_schema_only_redirect(self):
     res = run_validator("--schema", support.input_file('simple.xml'))
     self.assertEqual(res, 0)
示例#8
0
 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)
示例#9
0
 def test_schema_only_redirect(self):
     res = run_validator("--schema", support.input_file('simple.xml'))
     self.assertEqual(res, 0)