#!/bin/bash
set -e
set -u

if [ ! -v AUTOPKGTEST_TMP ]; then
  fail "E: opm-autopkgtest must be invoked by autopkgtest"
fi

sourcedir=${PWD}
cd "${AUTOPKGTEST_TMP}"
cp -axv "${sourcedir}"/python/test* .

for py in $(py3versions -r 2>/dev/null) ; do
    echo "Basic tests with $py"
    $py -m unittest test/test_basic.py
    echo "Schedule tests with $py"
    $py -m unittest test/test_schedule.py
done
