-from .module import SSHOrchestrator
+import os
+
+if 'UNITTEST' in os.environ:
+ import tests
+
+from .module import SSHOrchestrator
\ No newline at end of file
--- /dev/null
+from orchestrator import ServiceDescription
+from ..module import SSHOrchestrator
+from tests import mock
+
+
+@mock.patch("ssh.module.SSHOrchestrator.get_ceph_option", lambda _,key: __file__)
+def test_get_unique_name():
+ o = SSHOrchestrator('module_name', 0, 0)
+ existing = [
+ ServiceDescription(service_instance='mon.a')
+ ]
+ new_mon = o.get_unique_name(existing, 'mon')
+ assert new_mon.startswith('mon.')
+ assert new_mon != 'mon.a'
+
[testenv]
setenv = UNITTEST = true
deps = -rrequirements.txt
-commands = pytest --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/}
\ No newline at end of file
+commands = pytest --cov --cov-append --cov-report=term --doctest-modules {posargs:mgr_util.py tests/ ssh/}
\ No newline at end of file