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