2021-11-23 08:25:09 +00:00
|
|
|
import unittest
|
|
|
|
|
2022-01-04 13:37:37 +00:00
|
|
|
from tutor.__about__ import __version__
|
2022-02-07 17:11:43 +00:00
|
|
|
|
|
|
|
from .base import TestCommandMixin
|
2021-11-23 08:25:09 +00:00
|
|
|
|
|
|
|
|
2022-02-07 17:11:43 +00:00
|
|
|
class CliTests(unittest.TestCase, TestCommandMixin):
|
2021-11-23 08:25:09 +00:00
|
|
|
def test_help(self) -> None:
|
2022-02-07 17:11:43 +00:00
|
|
|
result = self.invoke(["help"])
|
2021-11-23 08:25:09 +00:00
|
|
|
self.assertEqual(0, result.exit_code)
|
|
|
|
self.assertIsNone(result.exception)
|
|
|
|
|
|
|
|
def test_cli_help(self) -> None:
|
2022-02-07 17:11:43 +00:00
|
|
|
result = self.invoke(["--help"])
|
2021-11-23 08:25:09 +00:00
|
|
|
self.assertEqual(0, result.exit_code)
|
|
|
|
self.assertIsNone(result.exception)
|
|
|
|
|
|
|
|
def test_cli_version(self) -> None:
|
2022-02-07 17:11:43 +00:00
|
|
|
result = self.invoke(["--version"])
|
2021-11-23 08:25:09 +00:00
|
|
|
self.assertEqual(0, result.exit_code)
|
|
|
|
self.assertIsNone(result.exception)
|
2022-02-07 17:11:43 +00:00
|
|
|
self.assertRegex(result.output, rf"cli, version {__version__}\n")
|