feat: add ops center and node onboarding flow
This commit is contained in:
44
domain-api/tests/test_ops_command_service.py
Normal file
44
domain-api/tests/test_ops_command_service.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import unittest
|
||||
|
||||
from app.services.ops_command_service import build_bash_command, ops_script_path
|
||||
|
||||
|
||||
class OpsCommandServiceTests(unittest.TestCase):
|
||||
def test_ops_script_path_prefixes_multi_region_directory(self) -> None:
|
||||
self.assertEqual(
|
||||
"domain-api/deploy/multi-region/drive_ops_center.sh",
|
||||
ops_script_path("drive_ops_center.sh"),
|
||||
)
|
||||
|
||||
def test_ops_script_path_normalizes_leading_slash(self) -> None:
|
||||
self.assertEqual(
|
||||
"domain-api/deploy/multi-region/check_ops_center_stack.sh",
|
||||
ops_script_path("/check_ops_center_stack.sh"),
|
||||
)
|
||||
|
||||
def test_build_bash_command_joins_non_empty_args(self) -> None:
|
||||
self.assertEqual(
|
||||
"bash domain-api/deploy/multi-region/drive_ops_center.sh driver-resolve http://127.0.0.1:8100 handover_first_gap",
|
||||
build_bash_command(
|
||||
"drive_ops_center.sh",
|
||||
"driver-resolve",
|
||||
"http://127.0.0.1:8100",
|
||||
"handover_first_gap",
|
||||
),
|
||||
)
|
||||
|
||||
def test_build_bash_command_skips_blank_args(self) -> None:
|
||||
self.assertEqual(
|
||||
"bash domain-api/deploy/multi-region/drive_release_hub.sh http://127.0.0.1:8100 launchpad",
|
||||
build_bash_command(
|
||||
"drive_release_hub.sh",
|
||||
"http://127.0.0.1:8100",
|
||||
"",
|
||||
"launchpad",
|
||||
" ",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user