本文整理汇总了Python中DIRAC.RequestManagementSystem.Client.Request.Request.subStatusList方法的典型用法代码示例。如果您正苦于以下问题:Python Request.subStatusList方法的具体用法?Python Request.subStatusList怎么用?Python Request.subStatusList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.RequestManagementSystem.Client.Request.Request
的用法示例。
在下文中一共展示了Request.subStatusList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test04Operations
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.Request import Request [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.Request.Request import subStatusList [as 别名]
def test04Operations( self ):
""" operations arithmetic and state machine """
req = Request()
self.assertEqual( len( req ), 0 )
transfer = Operation()
transfer.Type = "ReplicateAndRegister"
transfer.addFile( File( { "LFN" : "/a/b/c", "Status" : "Waiting" } ) )
getWaiting = req.getWaiting()
self.assertEqual( getWaiting["OK"], True )
self.assertEqual( getWaiting["Value"], None )
req.addOperation( transfer )
self.assertEqual( len( req ), 1 )
self.assertEqual( transfer.Order, req.Order )
self.assertEqual( transfer.Status, "Waiting" )
getWaiting = req.getWaiting()
self.assertEqual( getWaiting["OK"], True )
self.assertEqual( getWaiting["Value"], transfer )
removal = Operation( { "Type" : "RemoveFile" } )
removal.addFile( File( { "LFN" : "/a/b/c", "Status" : "Waiting" } ) )
req.insertBefore( removal, transfer )
getWaiting = req.getWaiting()
self.assertEqual( getWaiting["OK"], True )
self.assertEqual( getWaiting["Value"], removal )
self.assertEqual( len( req ), 2 )
self.assertEqual( [ op.Status for op in req ], ["Waiting", "Queued"] )
self.assertEqual( req.subStatusList() , ["Waiting", "Queued"] )
self.assertEqual( removal.Order, 0 )
self.assertEqual( removal.Order, req.Order )
self.assertEqual( transfer.Order, 1 )
self.assertEqual( removal.Status, "Waiting" )
self.assertEqual( transfer.Status, "Queued" )
for subFile in removal:
subFile.Status = "Done"
removal.Status = "Done"
self.assertEqual( removal.Status, "Done" )
self.assertEqual( transfer.Status, "Waiting" )
self.assertEqual( transfer.Order, req.Order )
# # len, looping
self.assertEqual( len( req ), 2 )
self.assertEqual( [ op.Status for op in req ], ["Done", "Waiting"] )
self.assertEqual( req.subStatusList() , ["Done", "Waiting"] )
digest = req.toJSON()
self.assertEqual( digest["OK"], True )
getWaiting = req.getWaiting()
self.assertEqual( getWaiting["OK"], True )
self.assertEqual( getWaiting["Value"], transfer )