mardi 3 octobre 2017

Compare XML documents for equality

How can I compose an XML document, then test another data stream to compare the two for equivalent content?

For a test suite I want to call the function which generates an XML document, and assert that its structure and content are equal.

import the_real_system

test_input = make_test_data()
expected_xml_document = carefully_compose_the_expected_structure(
    input_data)

real_document = the_real_system.generate_output(test_input)

assert xml_documents_are_equivalent(real_document, expected_xml_document)

Is there an already implemented assert_xml_documents_are_equivalent in a PyPI library?

Aucun commentaire:

Enregistrer un commentaire