Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests XML Comparison currently does not work if sub objects are ordered differently #157

Open
meelod opened this issue Feb 17, 2022 · 1 comment

Comments

@meelod
Copy link
Contributor

meelod commented Feb 17, 2022

Expected behavior

The assert statement comparing the actual and expected XML files in test/types should return True

Actual behavior

The assert statement returns false, as the XML files have the same values in different order

Steps to reproduce the issue

  1. Run test_xml_ini_conversion.py
    located here:
    https://github.com/kmcos/kmcos/tree/master/tests/test_types

System information

Ubuntu 18 LTS
kmcos version 0.0.63

@meelod
Copy link
Contributor Author

meelod commented Feb 17, 2022

https://stackoverflow.com/questions/321795/comparing-xml-in-a-unit-test-in-python

Maybe another option:
https://github.com/Shoobx/xmldiff
https://xmldiff.readthedocs.io/en/stable/installation.html

xmldiff is pip installable, so is fine to use. We could add it as part of the requirements in our text file describing how to do unit testing [I don’t want to add it to kmcos requirements, just like UnitTesterSG is not part of the kmcos requirements]

@AdityaSavara AdityaSavara changed the title XML Comparison tests XML Comparison currently does not work if sub objects are ordered differently Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant