mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-13 22:48:20 +00:00
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
|
import unittest
|
||
|
|
||
|
from click.exceptions import ClickException
|
||
|
from tutor.commands import compose
|
||
|
|
||
|
|
||
|
class ComposeTests(unittest.TestCase):
|
||
|
def test_mount_option_parsing(self) -> None:
|
||
|
param = compose.MountParam()
|
||
|
|
||
|
self.assertEqual(
|
||
|
[("lms", "/path/to/edx-platform", "/openedx/edx-platform")],
|
||
|
param("lms:/path/to/edx-platform:/openedx/edx-platform"),
|
||
|
)
|
||
|
self.assertEqual(
|
||
|
[
|
||
|
("lms", "/path/to/edx-platform", "/openedx/edx-platform"),
|
||
|
("cms", "/path/to/edx-platform", "/openedx/edx-platform"),
|
||
|
],
|
||
|
param("lms,cms:/path/to/edx-platform:/openedx/edx-platform"),
|
||
|
)
|
||
|
self.assertEqual(
|
||
|
[
|
||
|
("lms", "/path/to/edx-platform", "/openedx/edx-platform"),
|
||
|
("cms", "/path/to/edx-platform", "/openedx/edx-platform"),
|
||
|
],
|
||
|
param("lms, cms:/path/to/edx-platform:/openedx/edx-platform"),
|
||
|
)
|
||
|
with self.assertRaises(ClickException):
|
||
|
param("lms,:/path/to/edx-platform:/openedx/edx-platform")
|