diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/test.fmf b/plans/test.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/test.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/base/main.fmf b/tests/base/main.fmf new file mode 100644 index 0000000..d657f11 --- /dev/null +++ b/tests/base/main.fmf @@ -0,0 +1,5 @@ +summary: Simple test of python-pycotap +test: ./test.sh +framework: beakerlib +require: + - python3-pycotap diff --git a/tests/base/test.py b/tests/base/test.py new file mode 100755 index 0000000..3c350e9 --- /dev/null +++ b/tests/base/test.py @@ -0,0 +1,36 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +import unittest +import sys + +from pycotap import TAPTestRunner +from pycotap import LogMode + + +class SimpleTest(unittest.TestCase): + @classmethod + def function_name(cls): + return sys._getframe().f_back.f_code.co_name + + @classmethod + def setUpClass(cls): + print(cls.function_name()) + + def setUp(self): + print(SimpleTest.function_name()) + + def main(self): + print(SimpleTest.function_name()) + + def test_foo(self): + print(SimpleTest.function_name()) + + +def main(): + loader = unittest.TestLoader() + runner = TAPTestRunner(test_output_log=LogMode.LogToError) + unittest.main(testRunner=runner, testLoader=loader) + +if __name__ == '__main__': + main() diff --git a/tests/base/test.sh b/tests/base/test.sh new file mode 100755 index 0000000..b61d891 --- /dev/null +++ b/tests/base/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +rlJournalStart + rlPhaseStartTest + rlRun -t "./test.py" + rlPhaseEnd +rlJournalEnd