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

Python pydevtest_common.assertiCmdFail函数代码示例

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

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



在下文中一共展示了assertiCmdFail函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_iadmin_mkuser

    def test_iadmin_mkuser(self):

        # A few examples of valid and invalid usernames
        valid = ['bob',
                'jim-bob',
                'boB',
                '123.456', 
                '___haysoos___']

        invalid = ['bo',
                '.bob',
                'bob.',
                'jim--bob',
                'jamesbond..007',  
                '________________________________longer_than_NAME_LEN________________________________________________']

        # Test valid names
        for name in valid:
            assertiCmd(s.adminsession,"iadmin mkuser "+name+" rodsuser") # should be accepted
            assertiCmd(s.adminsession,"iadmin lu","LIST",name+"#"+s.adminsession.getZoneName()) # should be listed
            assertiCmd(s.adminsession,"iadmin rmuser "+name) # remove user
            assertiCmdFail(s.adminsession,"iadmin lu","LIST",name+"#"+s.adminsession.getZoneName()) # should be gone

        # Test invalid names
        for name in invalid:
            assertiCmd(s.adminsession,"iadmin mkuser "+name+" rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected

        # Invalid names with special characters
        assertiCmd(s.adminsession,r"iadmin mkuser hawai\'i rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected
        assertiCmd(s.adminsession,r"iadmin mkuser \\\/\!\*\?\|\$ rodsuser","ERROR","SYS_INVALID_INPUT_PARAM") # should be rejected
开发者ID:SyBernot,项目名称:irods,代码行数:30,代码来源:iadmin_suite.py


示例2: test_modify_resource_comment

 def test_modify_resource_comment(self):
     mycomment = "thisisacomment with some spaces"
     assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
     assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment '" + mycomment + "'")
     assertiCmd(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
     assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment 'none'")
     assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:iadmin_suite.py


示例3: test_local_imkdir

 def test_local_imkdir(self):
     # local setup
     mytestdir = "testingimkdir"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir " + mytestdir)  # imkdir
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py


示例4: test_set_resource_comment_to_emptystring_ticket_2434

 def test_set_resource_comment_to_emptystring_ticket_2434(self):
     mycomment = "notemptystring"
     assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
     assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment '" + mycomment + "'")
     assertiCmd(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
     assertiCmd(s.adminsession, "iadmin modresc " + self.testresc + " comment ''")
     assertiCmdFail(s.adminsession, "iadmin lr " + self.testresc, "LIST", mycomment)
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:iadmin_suite.py


示例5: test_local_imkdir_with_trailing_slash

 def test_local_imkdir_with_trailing_slash(self):
     # local setup
     mytestdir = "testingimkdirwithslash"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir + "/", "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir " + mytestdir + "/")  # imkdir
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py


示例6: test_local_imkdir_with_parent

 def test_local_imkdir_with_parent(self):
     # local setup
     mytestdir = "parent/testingimkdirwithparent"
     # assertions
     assertiCmdFail(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should not be listed
     assertiCmd(s.adminsession, "imkdir -p " + mytestdir)  # imkdir with parent
     assertiCmd(s.adminsession, "ils -L " + mytestdir, "LIST", mytestdir)  # should be listed
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py


示例7: test_local_imkdir_with_trailing_slash_already_exists

 def test_local_imkdir_with_trailing_slash_already_exists(self):
     # local setup
     mytestdir = "testingimkdirwithslash"
     # assertions
     assertiCmd(s.adminsession, "imkdir " + mytestdir + "/")  # imkdir
     assertiCmdFail(s.adminsession, "imkdir " + mytestdir)  # should fail, already exists
     assertiCmdFail(s.adminsession, "imkdir " + mytestdir + "/")  # should fail, already exists
开发者ID:bpow,项目名称:irods,代码行数:7,代码来源:catalog_suite.py


示例8: test_imeta_set_single_object_triple_to_double_empty_unit

    def test_imeta_set_single_object_triple_to_double_empty_unit(self, user=None):
        if user is None:
            user = s.sessions[1].get_username()

        set_and_check_avu(user, 'att0', 'val0', 'unt0')
        set_and_check_avu(user, 'att0', 'val1', '""')

        assertiCmdFail(s.adminsession, 'imeta ls -u ' + user + ' att0', 'STDOUT', 'units: unt0')
开发者ID:hurngchunlee,项目名称:irods,代码行数:8,代码来源:test_imeta_set.py


示例9: test_create_and_remove_unixfilesystem_resource_without_spaces

 def test_create_and_remove_unixfilesystem_resource_without_spaces(self):
     testresc1 = "testResc1"
     assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should not be listed
     output = commands.getstatusoutput("hostname")
     hostname = output[1]
     assertiCmd(s.adminsession,"iadmin mkresc "+testresc1+" unixfilesystem "+hostname+":/tmp/pydevtest_"+testresc1, "LIST", "Creating") # unix
     assertiCmd(s.adminsession,"iadmin lr","LIST",testresc1) # should be listed
     assertiCmd(s.adminsession,"iadmin rmresc "+testresc1) # good remove
     assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should be gone
开发者ID:SyBernot,项目名称:irods,代码行数:9,代码来源:iadmin_suite.py


示例10: test_mso_http

 def test_mso_http(self):
     test_file_path = "/"+s.adminsession.getZoneName()+"/home/"+s.adminsession.getUserName()+"/"+s.adminsession.sessionId
     assertiCmd( s.adminsession, 'ireg -D mso -R archiveResc "//http://people.renci.org/~jasonc/irods/http_mso_test_file.txt" '+test_file_path+'/test_file.txt')
     assertiCmd( s.adminsession, 'iget -f '+test_file_path+'/test_file.txt')
     assertiCmdFail( s.adminsession, 'ils -L '+test_file_path+'/test_file.txt', 'STDOUT', ' -99 ')
     os.remove( 'test_file.txt' )
     # unregister the object
     assertiCmd( s.adminsession, 'irm -U '+test_file_path+'/test_file.txt')
     assertiCmd( s.adminsession, 'ils -L', 'STDOUT', 'tempZone')
开发者ID:dthain,项目名称:irods,代码行数:9,代码来源:test_mso_suite.py


示例11: test_irm_specific_replica

 def test_irm_specific_replica(self):
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",self.testfile) # should be listed
     assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+self.testfile) # creates replica
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",self.testfile) # should be listed twice
     assertiCmd(s.adminsession,"irm -n 0 "+self.testfile) # remove original from grid
     assertiCmd(s.adminsession,"ils -L "+self.testfile,"LIST",["1 "+self.testresc,self.testfile]) # replica 1 should be there
     assertiCmdFail(s.adminsession,"ils -L "+self.testfile,"LIST",["0 "+s.adminsession.getDefResource(),self.testfile]) # replica 0 should be gone
     trashpath = "/"+s.adminsession.getZoneName()+"/trash/home/"+s.adminsession.getUserName()+"/"+s.adminsession.sessionId
     assertiCmdFail(s.adminsession,"ils -L "+trashpath+"/"+self.testfile,"LIST",["0 "+s.adminsession.getDefResource(),self.testfile]) # replica should not be in trash
开发者ID:SyBernot,项目名称:irods,代码行数:9,代码来源:resource_suite.py


示例12: test_imeta_set_single_object_abandoned_avu_triple_to_double_empty_unit

    def test_imeta_set_single_object_abandoned_avu_triple_to_double_empty_unit(self):
        user = s.sessions[1].get_username()

        set_and_check_avu(user, 'att0', 'val0', 'unt0')

        assertiCmd(s.adminsession, 'imeta rm -u %s %s %s %s' % (user, 'att0', 'val0', 'unt0'))

        set_and_check_avu(user, 'att0', 'val0', '""')

        assertiCmdFail(s.adminsession, 'imeta ls -u ' + user + ' att0', 'STDOUT', 'units: unt0')
开发者ID:hurngchunlee,项目名称:irods,代码行数:10,代码来源:test_imeta_set.py


示例13: test_create_and_remove_coordinating_resource

 def test_create_and_remove_coordinating_resource(self):
     testresc1 = "testResc1"
     assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should not be listed
     output = commands.getstatusoutput("hostname")
     hostname = output[1]
     assertiCmd(s.adminsession,"iadmin mkresc "+testresc1+" replication", "LIST", "Creating") # replication
     assertiCmd(s.adminsession,"iadmin lr","LIST",testresc1) # should be listed
     assertiCmd(s.adminsession,"iadmin lr "+testresc1,"LIST",["resc_net","EMPTY_RESC_HOST"]) # should have empty host
     assertiCmd(s.adminsession,"iadmin lr "+testresc1,"LIST",["resc_def_path","EMPTY_RESC_PATH"]) # should have empty path
     assertiCmd(s.adminsession,"iadmin rmresc "+testresc1) # good remove
     assertiCmdFail(s.adminsession,"iadmin lr","LIST",testresc1) # should be gone
开发者ID:SyBernot,项目名称:irods,代码行数:11,代码来源:iadmin_suite.py


示例14: test_local_iget_with_overwrite

 def test_local_iget_with_overwrite(self):
     # local setup
     localfile = "local.txt"
     # assertions
     assertiCmd(s.adminsession,"iget "+self.testfile+" "+localfile) # iget
     assertiCmdFail(s.adminsession,"iget "+self.testfile+" "+localfile) # already exists
     assertiCmd(s.adminsession,"iget -f "+self.testfile+" "+localfile) # already exists, so force
     output = commands.getstatusoutput( 'ls '+localfile )
     print "  output: ["+output[1]+"]"
     assert output[1] == localfile
     # local cleanup
     output = commands.getstatusoutput( 'rm '+localfile )
开发者ID:SyBernot,项目名称:irods,代码行数:12,代码来源:resource_suite.py


示例15: test_local_iput_onto_specific_resource

 def test_local_iput_onto_specific_resource(self):
     # local setup
     datafilename = "anotherfile.txt"
     f = open(datafilename,'wb')
     f.write("TESTFILE -- ["+datafilename+"]")
     f.close()
     # assertions
     assertiCmdFail(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should not be listed
     assertiCmd(s.adminsession,"iput -R "+self.testresc+" "+datafilename) # iput
     assertiCmd(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should be listed
     assertiCmd(s.adminsession,"ils -L "+datafilename,"LIST",self.testresc) # should be listed
     # local cleanup
     output = commands.getstatusoutput( 'rm '+datafilename )
开发者ID:SyBernot,项目名称:irods,代码行数:13,代码来源:resource_suite.py


示例16: test_local_iput

 def test_local_iput(self):
     '''also needs to count and confirm number of replicas after the put'''
     # local setup
     datafilename = "newfile.txt"
     f = open(datafilename,'wb')
     f.write("TESTFILE -- ["+datafilename+"]")
     f.close()
     # assertions
     assertiCmdFail(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should not be listed
     assertiCmd(s.adminsession,"iput "+datafilename) # iput
     assertiCmd(s.adminsession,"ils -L "+datafilename,"LIST",datafilename) # should be listed
     # local cleanup
     output = commands.getstatusoutput( 'rm '+datafilename )
开发者ID:SyBernot,项目名称:irods,代码行数:13,代码来源:resource_suite.py


示例17: test_ireg_as_rodsuser

    def test_ireg_as_rodsuser(self):
        # local setup
        filename = "newfile.txt"
        filepath = os.path.abspath(filename)
        f = open(filepath,'wb')
        f.write("TESTFILE -- ["+filepath+"]")
        f.close()

        # assertions
        assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed
        assertiCmd(s.sessions[1],"ireg "+filepath+" /"+s.sessions[1].getZoneName()+"/home/"+s.sessions[1].getUserName()+"/"+s.sessions[1].sessionId+"/"+filename, "ERROR","PATH_REG_NOT_ALLOWED") # ireg
        assertiCmdFail(s.sessions[1],"ils -L "+filename,"LIST",filename) # should not be listed

        # local cleanup
        output = commands.getstatusoutput( 'rm '+filepath )
开发者ID:SyBernot,项目名称:irods,代码行数:15,代码来源:resource_suite.py


示例18: test_irepl_over_existing_second_replica__ticket_1705

 def test_irepl_over_existing_second_replica__ticket_1705(self):
     # local setup
     filename = "secondreplicatest.txt"
     filepath = create_local_testfile(filename)
     # assertions
     assertiCmd(s.adminsession,"ils -L "+filename,"ERROR","does not exist") # should not be listed
     assertiCmd(s.adminsession,"iput -R "+self.testresc+" "+filename)       # put file
     assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename)          # for debugging
     assertiCmd(s.adminsession,"irepl "+filename)               # replicate to default resource
     assertiCmd(s.adminsession,"ils -L "+filename,"LIST",filename)          # for debugging
     assertiCmd(s.adminsession,"irepl "+filename)               # replicate overtop default resource
     assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should not have a replica 2
     assertiCmd(s.adminsession,"irepl -R "+self.testresc+" "+filename)      # replicate overtop test resource
     assertiCmdFail(s.adminsession,"ils -L "+filename,"LIST",[" 2 "," & "+filename]) # should not have a replica 2
     # local cleanup
     os.remove(filepath)
开发者ID:SyBernot,项目名称:irods,代码行数:16,代码来源:resource_suite.py


示例19: test_iadmin_mkuser

    def test_iadmin_mkuser(self):

        # A few examples of valid and invalid usernames
        valid = ['bo',
                 'bob',
                 'jim-bob',
                 'boB',
                 '123.456',
                 '[email protected]',
                 '[email protected]',
                 '[email protected]',
                 '___haysoos___']

        invalid = ['#',
                   '.',
                   '..',
                   '<bob>',
                   '________________________________longer_than_NAME_LEN________________________________________________']


#         invalid = ['.bob',
#                    'bob.',
#                    'jim--bob',
#                    '[email protected]',
#                    'user.',
#                    'jamesbond..007',
#                    '________________________________longer_than_NAME_LEN________________________________________________']

        # Test valid names
        for name in valid:
            assertiCmd(s.adminsession, "iadmin mkuser " + name + " rodsuser")  # should be accepted
            # should be listed
            assertiCmd(s.adminsession, "iadmin lu", "LIST", [name + "#" + s.adminsession.getZoneName()])
            assertiCmd(s.adminsession, "iadmin rmuser " + name)  # remove user
            # should be gone
            assertiCmdFail(s.adminsession, "iadmin lu", "LIST", [name + "#" + s.adminsession.getZoneName()])

        # Test invalid names
        for name in invalid:
            assertiCmd(s.adminsession, "iadmin mkuser " + name + " rodsuser",
                       "LIST", "Invalid user name format")  # should be rejected

        # Invalid names with special characters
        assertiCmd(s.adminsession, r"iadmin mkuser hawai\'i rodsuser",
                   "LIST", "Invalid user name format")  # should be rejected
        assertiCmd(s.adminsession, r"iadmin mkuser \\\/\!\*\?\|\$ rodsuser",
                   "LIST", "Invalid user name format")  # should be rejected
开发者ID:bpow,项目名称:irods,代码行数:47,代码来源:iadmin_suite.py


示例20: test_irmtrash_admin_2461

 def test_irmtrash_admin_2461(self):
     # 'irmtrash -M' was not deleting the r_objt_metamap entries for  collections it was deleting
     #  leading to orphaned avu's that 'iadmin rum' could never remove
     collection_basename = sys._getframe().f_code.co_name
     assertiCmd(s.adminsession, 'imkdir {collection_basename}'.format(**vars()))
     file_basename = 'dummy_file_to_trigger_recursive_rm'
     pydevtest_common.make_file(file_basename, 10)
     file_irods_path = os.path.join(collection_basename, file_basename)
     assertiCmd(s.adminsession, 'iput {file_basename} {file_irods_path}'.format(**vars()))
     a, v, u = ('attribute_' + collection_basename, 'value_' + collection_basename, 'unit_' + collection_basename)
     assertiCmd(s.adminsession, 'imeta add -C {collection_basename} {a} {v} {u}'.format(**vars()))
     assertiCmd(s.adminsession, 'imeta ls -C {collection_basename}'.format(**vars()), 'STDOUT_MULTILINE', [a, v, u])
     assertiCmd(s.adminsession, 'irm -r {collection_basename}'.format(**vars()))
     assertiCmd(s.adminsession, 'irmtrash -M')
     assertiCmd(s.adminsession, 'iadmin rum')
     assertiCmdFail(s.adminsession, '''iquest "select META_DATA_ATTR_NAME where META_DATA_ATTR_NAME = '{a}'"'''.format(**vars()),
                    'STDOUT', a)
开发者ID:bpow,项目名称:irods,代码行数:17,代码来源:iadmin_suite.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utils.trim_32函数代码示例发布时间:2022-05-25
下一篇:
Python pydevtest_common.assertiCmd函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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