#!/bin/bash
set -e

pkg=pyscanfcs

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

export PYTHONPATH=/usr/lib/${pkg}
cd "${AUTOPKGTEST_TMP}"

tar -xf /usr/share/doc/${pkg}/examples/tests.tar.xz

# Skip tests which need network access

python3 -m pytest tests
