本文整理汇总了Python中servicemanager.smcontext.SmContext.get_service_starter方法的典型用法代码示例。如果您正苦于以下问题:Python SmContext.get_service_starter方法的具体用法?Python SmContext.get_service_starter怎么用?Python SmContext.get_service_starter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类servicemanager.smcontext.SmContext
的用法示例。
在下文中一共展示了SmContext.get_service_starter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_external_binary_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_external_binary_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("FAKE_NEXUS", "foo", proxy=None)
expected = [ 'python', 'fakenexus.py']
cmd = starter.get_start_command("BINARY") #context will be ignored
self.assertEqual(cmd, expected)
示例2: test_python_binary_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_python_binary_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("PYTHON_SIMPLE_SERVER_ASSETS_FRONTEND", "foo", proxy=None)
expected = ['python -m SimpleHTTPServer 9032']
cmd = starter.get_start_command("BINARY")
self.assertEqual(cmd, expected)
示例3: test_python_binary_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_python_binary_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("PYTHON_SIMPLE_SERVER_ASSETS_FRONTEND", "foo", proxy=None)
expected = [ 'get_start_command() not implemented for this type of service - fork and make a pull request :)' ]
cmd = starter.get_start_command("BINARY")
self.assertEqual(cmd, expected)
示例4: test_play_source_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_play_source_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("PLAY_NEXUS_END_TO_END_TEST", True, False, None, port=None)
expected = [
"play",
"start -Dhttp.port=8500 -Dservice.manager.serviceName=PLAY_NEXUS_END_TO_END_TEST -Dservice.manager.runFrom=True -DFoo=false",
]
self.assertEqual(starter.get_start_command("SOURCE"), expected)
示例5: test_play_binary_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_play_binary_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("PLAY_NEXUS_END_TO_END_TEST", True, False, None, port=None)
#starter = SmPlayServiceStarter(context, "PLAY_NEXUS_END_TO_END_TEST", True, False, None, None, None, None)
expected = [ './basicplayapp/bin/basicplayapp',
'-DProd.microservice.whitelist.useWhitelist=false',
'-DProd.mongodb.uri=mongodb://localhost:27017/auth',
'-J-Xmx256m',
'-J-Xms256m',
'-J-XX:MaxPermSize=128m',
'-Dhttp.port=8500',
'-Dservice.manager.serviceName=PLAY_NEXUS_END_TO_END_TEST',
'-Dservice.manager.runFrom=True']
self.assertEqual(starter.get_start_command("BINARY"), expected)
示例6: test_dropwizard_binary_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_dropwizard_binary_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("DROPWIZARD_NEXUS_END_TO_END_TEST", "foo", proxy=None)
expected = [
'java',
'-Dfile.encoding=UTF8',
'-Xmx64M',
'-XX:+CMSClassUnloadingEnabled',
'-XX:MaxPermSize=64m',
'-Ddw.http.port=8080',
'-Dservice.manager.serviceName=DROPWIZARD_NEXUS_END_TO_END_TEST',
'-Dservice.manager.serviceName=DROPWIZARD_NEXUS_END_TO_END_TEST',
'-Dservice.manager.runFrom=foo',
'-jar',
'dwtest-foo-shaded.jar',
'server',
'dev_config.yml']
cmd = starter.get_start_command("BINARY")
cmd[-1] = cmd[-1].split("/")[-1]
cmd[0] = cmd[0].split("/")[-1]
cmd[len(cmd) -3] = cmd[len(cmd) -3].split("/")[-1]
self.assertEqual(cmd, expected)
示例7: test_dropwizard_source_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_dropwizard_source_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("DROPWIZARD_NEXUS_END_TO_END_TEST", "foo", proxy=None)
expected = ['./startappfromcode.sh']
self.assertEqual(starter.get_start_command("SOURCE"), expected)
示例8: test_external_source_config
# 需要导入模块: from servicemanager.smcontext import SmContext [as 别名]
# 或者: from servicemanager.smcontext.SmContext import get_service_starter [as 别名]
def test_external_source_config(self):
config_dir_override = os.path.join(os.path.dirname(__file__), "conf")
context = SmContext(SmApplication(config_dir_override), None, False, False)
starter = context.get_service_starter("FAKE_NEXUS", "foo", proxy=None)
expected = ["python", "fakenexus.py"]
self.assertEqual(starter.get_start_command("SOURCE"), expected) # context will be ignored