[med-svn] [Git][med-team/python-wordcloud][master] Add a simple autopkgtest

Nilesh Patra gitlab at salsa.debian.org
Sun Sep 27 12:29:51 BST 2020



Nilesh Patra pushed to branch master at Debian Med / python-wordcloud


Commits:
dbcddb50 by Nilesh Patra at 2020-09-27T16:53:36+05:30
Add a simple autopkgtest

- - - - -


2 changed files:

- + debian/tests/control
- + debian/tests/run-unit-test


Changes:

=====================================
debian/tests/control
=====================================
@@ -0,0 +1,4 @@
+Tests: run-unit-test
+Depends: @, python3-all, python3-numpy, python3-matplotlib
+Restrictions: allow-stderr
+


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -e
+
+export LC_ALL=C.UTF-8
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cd "${AUTOPKGTEST_TMP}"
+
+cat >foo.py <<HERE
+import numpy as np
+import matplotlib.pyplot as plt
+from wordcloud import WordCloud
+
+text = "square"
+
+x, y = np.ogrid[:300, :300]
+
+mask = (x - 150) ** 2 + (y - 150) ** 2 > 130 ** 2
+mask = 255 * mask.astype(int)
+
+
+wc = WordCloud(background_color="white", repeat=True, mask=mask)
+wc.generate(text)
+
+plt.axis("off")
+plt.imshow(wc, interpolation="bilinear")
+plt.savefig('foo.png')
+HERE
+
+python3 foo.py
+[ -s foo.png ] || exit 1
+rm ./foo.py ./foo.png
+
+echo "PASS"
+



View it on GitLab: https://salsa.debian.org/med-team/python-wordcloud/-/commit/dbcddb50274ddadf411ae5df721adb2633405b21

-- 
View it on GitLab: https://salsa.debian.org/med-team/python-wordcloud/-/commit/dbcddb50274ddadf411ae5df721adb2633405b21
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200927/04a0d757/attachment-0001.html>


More information about the debian-med-commit mailing list