当前位置: 首页>>代码示例>>Python>>正文


Python pydevtest_common.assertiCmdFail函数代码示例

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


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


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