python-et_xmlfile: bump to 2.0.0
authorAlexandru Ardelean <alex@shruggie.ro>
Tue, 24 Dec 2024 12:27:09 +0000 (14:27 +0200)
committerAlexandru Ardelean <ardeleanalex@gmail.com>
Wed, 25 Dec 2024 19:33:52 +0000 (21:33 +0200)
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
lang/python/python-et_xmlfile/Makefile
lang/python/python-et_xmlfile/test.sh [new file with mode: 0644]

index 10c04d004d15d48eae2dba04abce2c84b4de670e..bc5457b2dda648a144795411224b0804773f3584 100644 (file)
@@ -6,14 +6,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-et_xmlfile
-PKG_VERSION:=1.1.0
+PKG_VERSION:=2.0.0
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Eneas U de Queiroz <cotequeiroz@gmail.com>
 PKG_LICENSE:=MIT
 
 PYPI_NAME:=et_xmlfile
-PKG_HASH:=8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c
+PKG_HASH:=dab3f4764309081ce75662649be815c4c9081e88f0837825f90fd28317d4da54
 
 include ../pypi.mk
 include $(INCLUDE_DIR)/package.mk
diff --git a/lang/python/python-et_xmlfile/test.sh b/lang/python/python-et_xmlfile/test.sh
new file mode 100644 (file)
index 0000000..cb4e5af
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+EXPECTED_VER="$2"
+
+python3 - << EOF
+
+import sys
+from io import BytesIO
+from xml.etree.ElementTree import Element
+
+from et_xmlfile import xmlfile
+
+if (et_xmlfile.__version__ != "$EXPECTED_VER"):
+    print("Invalid version obtained '" + et_xmlfile.__version__ + "'")
+    sys.exit(1)
+
+out = BytesIO()
+with xmlfile(out) as xf:
+    el = Element("root")
+    xf.write(el) # write the XML straight to the file-like object
+
+if (out.getvalue() != b"<root />"):
+    print("Does not seem to work")
+    sys.exit(1)
+
+sys.exit(0)
+
+EOF
+