pyangbind
pyangbind copied to clipboard
fix: serialisation element ordering for py<3.6
Found an issue where serialised XML output would have incorrect ordering sometimes. It turns out I never saw this because I was developing with python 3.6, which features an ordered dict implementation.
I have made an update to explicitly use OrderedDict instead, so we have the same behaviour for python <3.6.
To be honest, I think this patch probably obviates the need for the structural XML document equality test I was doing to prove serialised outputs were the same. It turns out, I think, ordering does matter[1] and we may as well be consistent about it.
[1] found issues with NETCONF requests getting denied because of unexpected element ordering
Codecov Report
Merging #217 into master will not change coverage. The diff coverage is
100%.
@@ Coverage Diff @@
## master #217 +/- ##
=======================================
Coverage 71.51% 71.51%
=======================================
Files 7 7
Lines 1741 1741
Branches 463 463
=======================================
Hits 1245 1245
Misses 370 370
Partials 126 126
| Impacted Files | Coverage Δ | |
|---|---|---|
| pyangbind/lib/serialise.py | 77.87% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update ea73fb3...7039a3a. Read the comment docs.
Hi,
Could you please rebase to a recent versions of pyangbind, and python >= 3.7 (lowest automatically-tested version) ?
Thanks.
Closing old Issue. Pyangbind has moved to Python >= 3.7