diff options
Diffstat (limited to 'app/tests/test_backends.py')
| -rw-r--r-- | app/tests/test_backends.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/tests/test_backends.py b/app/tests/test_backends.py index 2cb5a95..acee6b6 100644 --- a/app/tests/test_backends.py +++ b/app/tests/test_backends.py @@ -5,7 +5,18 @@ import unittest from pathlib import Path from unittest.mock import patch -from backends import REGISTRY, detect_all, get +from backends import REGISTRY, ServerSpec, detect_all, format_launch_hint, get + + +class FormatLaunchHintTests(unittest.TestCase): + def test_plain_specs_join_argv(self): + specs = [ServerSpec("a", "http://x", ["cmd", "--flag"])] + self.assertEqual(format_launch_hint(specs), "cmd --flag") + + def test_cwd_prefixes_the_command(self): + specs = [ServerSpec("a", "http://x", ["cmd"], cwd=Path("/opt/audio.cpp"))] + self.assertEqual(format_launch_hint(specs), + "cd /opt/audio.cpp && cmd") class RegistryTests(unittest.TestCase): |
