summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests')
-rw-r--r--debian/tests/control6
-rw-r--r--debian/tests/data/test-yaml.py23
-rw-r--r--debian/tests/data/test-yaml.yaml10
-rwxr-xr-xdebian/tests/smoke10
4 files changed, 49 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..30f529a
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,6 @@
+Tests: smoke
+Depends:
+ python3-all,
+ python3-pytest,
+ python3-ruamel.yaml,
+Restrictions: superficial, allow-stderr
diff --git a/debian/tests/data/test-yaml.py b/debian/tests/data/test-yaml.py
new file mode 100644
index 0000000..7a1bf9e
--- /dev/null
+++ b/debian/tests/data/test-yaml.py
@@ -0,0 +1,23 @@
+# very crude smoke test of the yaml package
+
+import ruamel.yaml as yaml
+
+
+def test_load_clib():
+ import ruamel.yaml.cyaml
+
+def test_safe_load():
+
+ with open("test-yaml.yaml") as fh:
+ y = yaml.safe_load(fh)
+
+ assert len(y['testdata']) == 2
+
+ assert len(y['testdata']['test1']) == 3
+
+ assert len(y['testdata']['test-data-2']) == 2
+
+
+if __name__ == "__main__":
+ test_safe_load()
+ print("Complete.")
diff --git a/debian/tests/data/test-yaml.yaml b/debian/tests/data/test-yaml.yaml
new file mode 100644
index 0000000..770019f
--- /dev/null
+++ b/debian/tests/data/test-yaml.yaml
@@ -0,0 +1,10 @@
+testdata:
+
+ test1:
+ - value1
+ - value2
+ - value3
+
+ test-data-2:
+ - value21
+ - value22
diff --git a/debian/tests/smoke b/debian/tests/smoke
new file mode 100755
index 0000000..d417a88
--- /dev/null
+++ b/debian/tests/smoke
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e -u
+
+cp -r debian/tests/data "$AUTOPKGTEST_TMP"
+cd "$AUTOPKGTEST_TMP/data"
+
+for py in $(py3versions -s); do
+ $py -m pytest -v test-yaml.py
+done