def test_xml_encoding(self, capsys): """Test that the encoding listed in the XML declaration is honored.""" xml_format = u('<?xml version="1.0" encoding="%s"?><a>\u00D8</a>') data1 = (xml_format % ("UTF-8", )).encode('utf-8') data2 = (xml_format % ("latin1", )).encode('latin1') CompareSAX.data2data(data1, data2) assert_no_output(capsys)
def test_xml_encoding(self, capsys): """Test that the encoding listed in the XML declaration is honored.""" xml_format = u('<?xml version="1.0" encoding="%s"?><a>\u00D8</a>') data1 = (xml_format % ("UTF-8",)).encode('utf-8') data2 = (xml_format % ("latin1",)).encode('latin1') CompareSAX.data2data(data1, data2) assert_no_output(capsys)
def test_string_input_types(self, type1, type2, capsys): xml = "<a/>" CompareSAX.data2data(type1(xml), type2(xml)) assert_no_output(capsys)
def test_data2data(self, data1, data2, capsys): CompareSAX.data2data(data1, data2) assert_no_output(capsys)
def test_empty_document(self, capsys): a = suds.sax.document.Document() b = suds.sax.document.Document() CompareSAX.document2document(a, b) assert_no_output(capsys)
def test_failed_parsing(data, capsys): pytest.raises(xml.sax.SAXParseException, CompareSAX.data2data, data, data) assert_no_output(capsys)