本文整理汇总了Python中testutils.validate_results函数的典型用法代码示例。如果您正苦于以下问题:Python validate_results函数的具体用法?Python validate_results怎么用?Python validate_results使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了validate_results函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_bootable_blocks_geometry_10
def test_get_bootable_blocks_geometry_10():
"""
get-bootable-blocks test run: geometry_10
"""
args = """--geometry 90x90x90x90x11 arg"""
cmdout = ''
cmderr = \
"""Invalid Geometry. Geometry must be in the form of AxBxCxDxE
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('get-bootable-blocks.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例2: test_qmove_queu_4
def test_qmove_queu_4():
"""
qmove test run: queu_4
"""
args = """q1 q2 1 2 3"""
cmdout = ''
cmderr = \
"""jobid must be an integer: q2
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('qmove.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例3: test_get_bootable_blocks_version
def test_get_bootable_blocks_version():
"""
get-bootable-blocks test run: version
"""
args = """--version"""
cmdout = \
"""version: "get-bootable-blocks.py " + TBD + , Cobalt + TBD
"""
cmderr = ''
stubout = ''
stubout_file = "stub.out"
expected_results = (
0, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('get-bootable-blocks.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例4: test_qselect_invalid_option
def test_qselect_invalid_option():
"""
qselect test run: invalid_option
"""
args = """-k"""
cmdout = ""
cmderr = """Usage: qselect.py [options]
qselect.py: error: no such option: -k
"""
stubout = ""
stubout_file = "stub.out"
expected_results = (
512, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd("qselect.py", args, stubout_file)
result = testutils.validate_results(results, expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例5: test_qselect_only_arg
def test_qselect_only_arg():
"""
qselect test run: only_arg
"""
args = """1"""
cmdout = ""
cmderr = """qselect takes no arguments
"""
stubout = ""
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd("qselect.py", args, stubout_file)
result = testutils.validate_results(results, expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例6: test_nodelist_options_4
def test_nodelist_options_4():
"""
nodelist test run: options_4
"""
args = """--version"""
cmdout = \
"""version: "nodelist.py " + TBD + , Cobalt + TBD
"""
cmderr = ''
stubout = ''
stubout_file = "stub.out"
expected_results = (
0, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('nodelist.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例7: test_releaseres_version
def test_releaseres_version():
"""
releaseres test run: version
"""
args = """--version"""
cmdout = \
"""version: "releaseres.py " + $Id: releaseres.py 2146 2011-04-29 16:19:22Z richp $ + , Cobalt + $Version$
"""
cmderr = ''
stubout = ''
stubout_file = "stub.out"
expected_results = (
0, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('releaseres.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例8: test_showres_combo
def test_showres_combo():
"""
showres test run: combo
"""
args = """-l -x"""
cmdout = ''
cmderr = \
"""Only use -l or -x not both
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('showres.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例9: test_boot_block_free_2
def test_boot_block_free_2():
"""
boot-block test run: free_2
"""
args = """--free --jobid 1"""
cmdout = ''
cmderr = \
"""ERROR: block not specified as option or in environment.
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
768, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('boot-block.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例10: test_schedctl_save_2
def test_schedctl_save_2():
"""
schedctl test run: save_2
"""
args = """--savestate s"""
cmdout = ''
cmderr = \
"""directory s does not exist
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('schedctl.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例11: test_boot_block_combo
def test_boot_block_combo():
"""
boot-block test run: combo
"""
args = """--free --reboot --block b --jobid 1"""
cmdout = ''
cmderr = \
"""ERROR: --free may not be specified with --reboot.
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
768, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('boot-block.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例12: test_slpstat_version
def test_slpstat_version():
"""
slpstat test run: version
"""
args = """--version"""
cmdout = \
"""version: "slpstat.py " + $Revision: 1221 $ + , Cobalt + $Version$
"""
cmderr = ''
stubout = ''
stubout_file = "stub.out"
expected_results = (
0, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('slpstat.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例13: test_partlist_argument_1
def test_partlist_argument_1():
"""
partlist test run: argument_1
"""
args = """arg"""
cmdout = ''
cmderr = \
"""No arguments required
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('partlist.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例14: test_schedctl_combo_1
def test_schedctl_combo_1():
"""
schedctl test run: combo_1
"""
args = """--start --stop"""
cmdout = ''
cmderr = \
"""Option combinations not allowed with: start option(s)
"""
stubout = ''
stubout_file = "stub.out"
expected_results = (
256, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('schedctl.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result
示例15: test_partlist_argument_2
def test_partlist_argument_2():
"""
partlist test run: argument_2
"""
args = ''
cmdout = \
"""Name Queue State Backfill
==============================================================================
P10 zq:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P9 yours:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P8 myq:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P7 dito:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P6 hhh:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P5 bbb:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P4 aaa:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P3 bello:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P2 jello:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
P1 kebra:kebra:jello:bello:aaa:bbb:hhh:dito:myq:yours:zq idle -
"""
cmderr = ''
stubout = \
"""
GET_PARTITIONS
plist: [{'queue': '*', 'scheduled': '*', 'state': '*', 'tag': 'partition', 'name': '*', 'backfill_time': '*', 'children': '*', 'functional': '*', 'draining': '*', 'size': '*'}]
GET_RESERVATIONS
active:True
active type: <type 'bool'>
partitions:*
partitions type: <type 'str'>
queue:*
queue type: <type 'str'>
"""
stubout_file = "stub.out"
expected_results = (
0, # Expected return status
cmdout, # Expected command output
stubout, # Expected stub functions output
cmderr, # Expected command error output
)
testutils.save_testhook("")
results = testutils.run_cmd('partlist.py',args,stubout_file)
result = testutils.validate_results(results,expected_results)
testutils.remove_testhook()
correct = 1
assert result == correct, "Result:\n%s" % result