本文整理汇总了Python中DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer.subRequests["transfer"][0]["Files"][0]["Status"]方法的典型用法代码示例。如果您正苦于以下问题:Python RequestContainer.subRequests["transfer"][0]["Files"][0]["Status"]方法的具体用法?Python RequestContainer.subRequests["transfer"][0]["Files"][0]["Status"]怎么用?Python RequestContainer.subRequests["transfer"][0]["Files"][0]["Status"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer
的用法示例。
在下文中一共展示了RequestContainer.subRequests["transfer"][0]["Files"][0]["Status"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_01_getRequestStatus
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import subRequests["transfer"][0]["Files"][0]["Status"] [as 别名]
def test_01_getRequestStatus( self ):
self.assertEqual( self.requestDB.getRequestStatus( "testRequest" ),
{'OK': True, 'Value': {'SubRequestStatus': 'Waiting', 'RequestStatus': 'Waiting'}})
## get request
getRemoval = self.requestDB.getRequest( "removal" )
oRequest = RequestContainer( getRemoval["Value"]["RequestString"] )
self.assertEqual( self.requestDB.getRequestStatus( "testRequest" ),
{'OK': True, 'Value': {'SubRequestStatus': 'Assigned', 'RequestStatus': 'Waiting'}} )
## make removal Done
oRequest.subRequests["removal"][0]["Attributes"]["Status"] = "Done"
oRequest.subRequests["removal"][0]["Files"][0]["Status"] = "Done"
update = self.requestDB.updateRequest( getRemoval["Value"]["RequestName"],
oRequest.toXML()["Value"] )
## get status
self.assertEqual( self.requestDB.getRequestStatus( "testRequest" ),
{'OK': True, 'Value': {'SubRequestStatus': 'Waiting', 'RequestStatus': u'Waiting'}})
## make transfer Done
oRequest.subRequests["transfer"][0]["Attributes"]["Status"] = "Done"
oRequest.subRequests["transfer"][0]["Files"][0]["Status"] = "Done"
update = self.requestDB.updateRequest( getRemoval["Value"]["RequestName"],
oRequest.toXML()["Value"] )
## get status
self.assertEqual( self.requestDB.getRequestStatus( "testRequest" ),
{'OK': True, 'Value': {'SubRequestStatus': 'Done', 'RequestStatus': 'Done'}} )