mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 14:17:46 +00:00
fix: unit tests in nightly
Unit tests were breaking in nightly branch.
This commit is contained in:
parent
72843c06f9
commit
97f7d5a1e7
@ -2,6 +2,7 @@ import unittest
|
|||||||
|
|
||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
|
|
||||||
|
from tutor.__about__ import __version__
|
||||||
from tutor.commands.cli import cli, print_help
|
from tutor.commands.cli import cli, print_help
|
||||||
|
|
||||||
|
|
||||||
@ -23,4 +24,4 @@ class CliTests(unittest.TestCase):
|
|||||||
result = runner.invoke(cli, ["--version"])
|
result = runner.invoke(cli, ["--version"])
|
||||||
self.assertEqual(0, result.exit_code)
|
self.assertEqual(0, result.exit_code)
|
||||||
self.assertIsNone(result.exception)
|
self.assertIsNone(result.exception)
|
||||||
self.assertRegex(result.output, r"cli, version \d+.\d+.\d+\n")
|
self.assertRegex(result.output, r"cli, version {}\n".format(__version__))
|
||||||
|
@ -4,6 +4,7 @@ from unittest.mock import Mock, patch
|
|||||||
from click.testing import CliRunner
|
from click.testing import CliRunner
|
||||||
|
|
||||||
from tests.helpers import TestContext, temporary_root
|
from tests.helpers import TestContext, temporary_root
|
||||||
|
from tutor.__about__ import __version__
|
||||||
from tutor import images, plugins
|
from tutor import images, plugins
|
||||||
from tutor.commands.config import config_command
|
from tutor.commands.config import config_command
|
||||||
from tutor.commands.images import ImageNotFoundError, images_command
|
from tutor.commands.images import ImageNotFoundError, images_command
|
||||||
@ -65,7 +66,7 @@ class ImagesTests(unittest.TestCase):
|
|||||||
self.assertEqual(0, result.exit_code)
|
self.assertEqual(0, result.exit_code)
|
||||||
self.assertIsNone(result.exception)
|
self.assertIsNone(result.exception)
|
||||||
self.assertRegex(
|
self.assertRegex(
|
||||||
result.output, r"docker.io/overhangio/openedx:\d+.\d+.\d+\n"
|
result.output, r"docker.io/overhangio/openedx:{}\n".format(__version__)
|
||||||
)
|
)
|
||||||
|
|
||||||
@patch.object(plugins.BasePlugin, "iter_installed", return_value=[])
|
@patch.object(plugins.BasePlugin, "iter_installed", return_value=[])
|
||||||
|
Loading…
Reference in New Issue
Block a user