mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-16 18:15:09 +00:00
97f7d5a1e7
Unit tests were breaking in nightly branch.
28 lines
871 B
Python
28 lines
871 B
Python
import unittest
|
|
|
|
from click.testing import CliRunner
|
|
|
|
from tutor.__about__ import __version__
|
|
from tutor.commands.cli import cli, print_help
|
|
|
|
|
|
class CliTests(unittest.TestCase):
|
|
def test_help(self) -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(print_help)
|
|
self.assertEqual(0, result.exit_code)
|
|
self.assertIsNone(result.exception)
|
|
|
|
def test_cli_help(self) -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli, ["--help"])
|
|
self.assertEqual(0, result.exit_code)
|
|
self.assertIsNone(result.exception)
|
|
|
|
def test_cli_version(self) -> None:
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli, ["--version"])
|
|
self.assertEqual(0, result.exit_code)
|
|
self.assertIsNone(result.exception)
|
|
self.assertRegex(result.output, r"cli, version {}\n".format(__version__))
|