Exemplo n.º 1
0
 def test_diagnose_returns_none_for_good_xml(self):
     rng_parser = RelaxNGParser(general_xml, topic_rng)
     assert rng_parser.validate() is True
     msg = rng_parser.diagnose()
     assert msg is None
Exemplo n.º 2
0
 def test_malformed_xml_fails_rng_parser(self):
     rng_parser = RelaxNGParser(malformed_xml, topic_rng)
     result = rng_parser.validate()
     assert result is False
Exemplo n.º 3
0
 def test_trouble_xml_passes_rng_parsing(self):
     rng_parser = RelaxNGParser(trouble_xml, topic_rng)
     result = rng_parser.validate()
     assert result is True
Exemplo n.º 4
0
 def test_discovery_xml_passes_rng_parsing(self):
     rng_parser = RelaxNGParser(discovery_xml, topic_rng)
     result = rng_parser.validate()
     assert result is True
Exemplo n.º 5
0
 def test_bookmap_xml_passes_rng_parsing(self):
     rng_parser = RelaxNGParser(bookmap_xml, bookmap_rng)
     result = rng_parser.validate()
     assert result is True    
Exemplo n.º 6
0
 def test_diagnose_returns_err_msg_for_bad_xml(self):
     rng_parser = RelaxNGParser(malformed_xml, topic_rng)
     assert rng_parser.validate() is False
     msg = rng_parser.diagnose()
     assert msg == 'Did not expect element note there, line 4'