• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python testutils.remove_testhook函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中testutils.remove_testhook函数的典型用法代码示例。如果您正苦于以下问题:Python remove_testhook函数的具体用法?Python remove_testhook怎么用?Python remove_testhook使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了remove_testhook函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:get-bootable-blocks_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:qmove_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:get-bootable-blocks_test.py


示例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
开发者ID:ido,项目名称:cobalt,代码行数:35,代码来源:qselect_test.py


示例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
开发者ID:ido,项目名称:cobalt,代码行数:33,代码来源:qselect_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt,代码行数:34,代码来源:nodelist_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:releaseres_test.py


示例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
开发者ID:ido,项目名称:cobalt,代码行数:34,代码来源:showres_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:boot-block_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:schedctl_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:boot-block_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:slpstat_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:partlist_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:34,代码来源:schedctl_test.py


示例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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:59,代码来源:partlist_test.py


示例16: test_releaseres_arg_3

def test_releaseres_arg_3():
    """
    releaseres test run: arg_3

    """

    args      = """s1 s2"""

    cmdout    = \
"""Released reservation 's1' for partitions: ['p1', 'p2']
Released reservation 's2' for partitions: ['p1', 'p2']
"""

    cmderr    = ''

    stubout   = \
"""
GET_RESERVATIONS

name:s1
name type: <type 'str'>
partitions:*
partitions type: <type 'str'>
name:s2
name type: <type 'str'>
partitions:*
partitions type: <type 'str'>
\RELEASE_RESERVATIONS

name:s1
name type: <type 'str'>
partitions:*
partitions type: <type 'str'>
name:s2
name type: <type 'str'>
partitions:*
partitions type: <type 'str'>
user: gooduser
"""

    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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:58,代码来源:releaseres_test.py


示例17: test_slpstat_debug_2

def test_slpstat_debug_2():
    """
    slpstat test run: debug_2

    """

    args      = """-d"""

    cmdout    = \
"""no services registered
"""

    cmderr    = \
"""
slpstat.py -d

component: "service-location.get_services", defer: False
  get_services(
     [{'stamp': '*', 'tag': 'service', 'name': '*', 'location': '*'}],
     )


"""

    stubout   = \
"""
GET_SERVICES

location:*
location type: <type 'str'>
name:*
name type: <type 'str'>
stamp:*
stamp type: <type 'str'>
tag:service
tag 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("NO SERVICES")

    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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:56,代码来源:slpstat_test.py


示例18: test_boot_block_nofree_noreboot_3

def test_boot_block_nofree_noreboot_3():
    """
    boot-block test run: nofree_noreboot_3

    """

    args      = """--jobid 1 --block b"""

    cmdout    = \
"""status 1
status 2
status 3
Boot for locaiton b complete.
"""

    cmderr    = ''

    stubout   = \
"""
INITIATE_PROXY_BOOT

block: b, type = <type 'str'>
user: gooduser
jobid: 1, type = <type 'int'>

GET_BOOT_STATUSES_AND_STRINGS

block: b, type = <type 'str'>

GET_BOOT_STATUSES_AND_STRINGS

block: b, type = <type 'str'>

REAP_BOOT

block: b, 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('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
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:56,代码来源:boot-block_test.py


示例19: test_userres_arg_2

def test_userres_arg_2():
    """
    userres test run: arg_2

    """

    args      = """s1"""

    cmdout    = \
"""Setting new start time for for reservation 's1': Tue Mar 26 17:01:40 2013
"""

    cmderr    = ''

    stubout   = \
"""
GET_RESERVATIONS

cycle:*
cycle type: <type 'str'>
duration:*
duration type: <type 'str'>
name:s1
name type: <type 'str'>
start:*
start type: <type 'str'>
users:*
users type: <type 'str'>

SET_RESERVATIONS

name:s1
name type: <type 'str'>
start:1364335300.0
start type: <type 'float'>
user: gooduser
"""

    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('userres.py',args,stubout_file) 
    result  = testutils.validate_results(results,expected_results)

    testutils.remove_testhook()

    correct = 1
    assert result == correct, "Result:\n%s" % result
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:56,代码来源:userres_test.py


示例20: test_nodeadm_down_1

def test_nodeadm_down_1():
    """
    nodeadm test run: down_1

    """

    args      = """--down p1 p2 p3"""

    cmdout    = \
"""nodes marked down:
   D1
   D2
   D3
   D4
   D5

unknown nodes:
   p1
   p2
   p3
"""

    cmderr    = ''

    stubout   = \
"""
GET_IMPLEMENTATION


NODES_DOWN

whoami: gooduser
p1
p2
p3
"""

    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('nodeadm.py',args,stubout_file) 
    result  = testutils.validate_results(results,expected_results)

    testutils.remove_testhook()

    correct = 1
    assert result == correct, "Result:\n%s" % result
开发者ID:benmcclelland,项目名称:cobalt-orcm,代码行数:55,代码来源:nodeadm_test.py



注:本文中的testutils.remove_testhook函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python testutils.run_cmd函数代码示例发布时间:2022-05-27
下一篇:
Python testutils.random_ipc_endpoint函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap