python-xmltodict: update to 1.0.4

Update package to 1.0.4.

Add test.sh to verify XML parsing and unparsing functionality.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2026-04-05 01:31:59 +03:00
committed by Alexandru Ardelean
parent 10a5d4024c
commit e05e7ab598
2 changed files with 33 additions and 2 deletions

View File

@@ -8,16 +8,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-xmltodict
PKG_VERSION:=0.13.0
PKG_VERSION:=1.0.4
PKG_RELEASE:=1
PYPI_NAME:=xmltodict
PKG_HASH:=341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56
PKG_HASH:=6d94c9f834dd9e44514162799d344d815a3a4faec913717a9ecbfa5be1bb8e61
PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=python-setuptools/host
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../python3-package.mk

View File

@@ -0,0 +1,29 @@
#!/bin/sh
[ "$1" = python3-xmltodict ] || exit 0
python3 - << 'EOF'
import xmltodict
# Basic XML to dict conversion
xml = """<root>
<name>test</name>
<value>42</value>
<items>
<item>a</item>
<item>b</item>
</items>
</root>"""
data = xmltodict.parse(xml)
assert data['root']['name'] == 'test'
assert data['root']['value'] == '42'
assert isinstance(data['root']['items']['item'], list)
assert data['root']['items']['item'] == ['a', 'b']
# Dict to XML conversion
d = {'doc': {'title': 'Hello', 'body': 'World'}}
result = xmltodict.unparse(d)
assert '<title>Hello</title>' in result
assert '<body>World</body>' in result
print("xmltodict OK")
EOF