本文整理汇总了Python中Ganga.Lib.LCG.Grid.submit方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.submit方法的具体用法?Python Grid.submit怎么用?Python Grid.submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ganga.Lib.LCG.Grid
的用法示例。
在下文中一共展示了Grid.submit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_submit_no_proxy
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit_no_proxy(mocker):
"""
Test that the lack of a proxy object causes the submit to fail
"""
check_proxy = mocker.patch('Ganga.Lib.LCG.Grid.check_proxy', return_value=False)
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path')
assert check_proxy.call_count == 1
assert job_url is None
示例2: test_submit_bad_output
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit_bad_output(mocker):
"""
Test that the external command returning bad data causes the job to fail
"""
__set_submit_option__ = mocker.patch('Ganga.Lib.LCG.Grid.__set_submit_option__', return_value=' ')
mocker.patch('Ganga.Lib.LCG.Grid.getShell', return_value=Shell)
cmd1 = mocker.patch('Ganga.Utility.GridShell.Shell.cmd1', return_value=(0, 'some bad output', False))
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path', cred_req=FakeCred())
assert __set_submit_option__.call_count == 1
assert cmd1.call_count == 1
assert job_url is None
示例3: test_submit_expired_proxy
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit_expired_proxy(mocker):
"""
Test that an invalid proxy object causes the submit to fail
"""
check_proxy = mocker.patch('Ganga.Lib.LCG.Grid.check_proxy', return_value=True)
credential = mocker.patch('Ganga.Lib.LCG.Grid.credential', return_value=mocker.MagicMock())
credential.return_value.isValid.return_value = False
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path')
assert check_proxy.call_count == 1
assert credential.call_count == 1
assert job_url is None
示例4: test_submit
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit(mocker):
"""
Test that a job submit succeeds with valid input
"""
__set_submit_option__ = mocker.patch('Ganga.Lib.LCG.Grid.__set_submit_option__', return_value=' ')
mocker.patch('Ganga.Lib.LCG.Grid.getShell', return_value=Shell)
cmd1 = mocker.patch('Ganga.Utility.GridShell.Shell.cmd1', return_value=(0, 'https://example.com:9000/some_url', False))
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path', cred_req=FakeCred())
assert __set_submit_option__.call_count == 1
assert cmd1.call_count == 1
assert '/some/path' in cmd1.call_args[0][0], 'JDL path was not passed correctly'
assert job_url == 'https://example.com:9000/some_url'
示例5: test_submit_bad_output
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit_bad_output(mocker):
"""
Test that the external command returning bad data causes the job to fail
"""
check_proxy = mocker.patch('Ganga.Lib.LCG.Grid.check_proxy', return_value=True)
credential = mocker.patch('Ganga.Lib.LCG.Grid.credential', return_value=mocker.MagicMock())
credential.return_value.isValid.return_value = True
__set_submit_option__ = mocker.patch('Ganga.Lib.LCG.Grid.__set_submit_option__', return_value=' ')
mocker.patch('Ganga.Lib.LCG.Grid.getShell', return_value=Shell)
cmd1 = mocker.patch('Ganga.Utility.GridShell.Shell.cmd1', return_value=(0, 'some bad output', False))
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path')
assert check_proxy.call_count == 1
assert credential.call_count == 1
assert __set_submit_option__.call_count == 1
assert cmd1.call_count == 1
assert job_url is None
示例6: test_submit
# 需要导入模块: from Ganga.Lib.LCG import Grid [as 别名]
# 或者: from Ganga.Lib.LCG.Grid import submit [as 别名]
def test_submit(mocker):
"""
Test that a job submit succeeds with valid input
"""
check_proxy = mocker.patch('Ganga.Lib.LCG.Grid.check_proxy', return_value=True)
credential = mocker.patch('Ganga.Lib.LCG.Grid.credential', return_value=mocker.MagicMock())
credential.return_value.isValid.return_value = True
__set_submit_option__ = mocker.patch('Ganga.Lib.LCG.Grid.__set_submit_option__', return_value=' ')
mocker.patch('Ganga.Lib.LCG.Grid.getShell', return_value=Shell)
cmd1 = mocker.patch('Ganga.Utility.GridShell.Shell.cmd1', return_value=(0, 'https://example.com:9000/some_url', False))
from Ganga.Lib.LCG import Grid
job_url = Grid.submit('/some/path')
assert check_proxy.call_count == 1
assert credential.call_count == 1
assert __set_submit_option__.call_count == 1
assert cmd1.call_count == 1
assert '/some/path' in cmd1.call_args[0][0], 'JDL path was not passed correctly'
assert job_url == 'https://example.com:9000/some_url'