本文整理汇总了Python中DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer._getLastOrder方法的典型用法代码示例。如果您正苦于以下问题:Python RequestContainer._getLastOrder方法的具体用法?Python RequestContainer._getLastOrder怎么用?Python RequestContainer._getLastOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer
的用法示例。
在下文中一共展示了RequestContainer._getLastOrder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test__getLastOrder
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import _getLastOrder [as 别名]
def test__getLastOrder(self):
# no files
req = RequestContainer()
res = req._getLastOrder()
self.assertEqual( res, 0 )
self.assertEqual( req.subRequests, {} )
req.addSubRequest( {'Attributes':{'Operation':'replicateAndRegister',
'TargetSE':'SE', 'ExecutionOrder': 0}},
'transfer' )
res = req._getLastOrder()
self.assertEqual( res, 0 )
req.addSubRequest( {'Attributes':{'Operation':'replicateAndRegister',
'TargetSE':'SE', 'ExecutionOrder': 1}},
'transfer' )
res = req._getLastOrder()
self.assertEqual( res, 1 )
del( req )
# with files
req = RequestContainer()
res = req._getLastOrder( 'foo' )
self.assertEqual( res, 0 )
req.addSubRequest( {'Attributes':{'Operation':'replicateAndRegister',
'TargetSE':'SE', 'ExecutionOrder': 1}},
'transfer' )
res = req._getLastOrder( 'foo' )
self.assertEqual( res, 0 )
req.setSubRequestFiles( 0, 'transfer', [{'LFN':'foo', 'Status':'Waiting'}] )
res = req._getLastOrder( 'foo' )
self.assertEqual( res, 1 )
req.addSubRequest( {'Attributes':{'Operation':'replicateAndRegister',
'TargetSE':'SE', 'ExecutionOrder': 2}},
'removal' )
res = req._getLastOrder( 'foo' )
self.assertEqual( res, 1 )
req.setSubRequestFiles( 0, 'removal', [{'LFN':'foo', 'Status':'Waiting'}] )
res = req._getLastOrder( 'foo' )
self.assertEqual( res, 2 )
示例2: test__getLastOrder
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import _getLastOrder [as 别名]
def test__getLastOrder(self):
# no files
req = RequestContainer()
res = req._getLastOrder()
self.assertEqual(res, 0)
self.assertEqual(req.subRequests, {})
req.addSubRequest(
{"Attributes": {"Operation": "replicateAndRegister", "TargetSE": "SE", "ExecutionOrder": 0}}, "transfer"
)
res = req._getLastOrder()
self.assertEqual(res, 0)
req.addSubRequest(
{"Attributes": {"Operation": "replicateAndRegister", "TargetSE": "SE", "ExecutionOrder": 1}}, "transfer"
)
res = req._getLastOrder()
self.assertEqual(res, 1)
del (req)
# with files
req = RequestContainer()
res = req._getLastOrder("foo")
self.assertEqual(res, 0)
req.addSubRequest(
{"Attributes": {"Operation": "replicateAndRegister", "TargetSE": "SE", "ExecutionOrder": 1}}, "transfer"
)
res = req._getLastOrder("foo")
self.assertEqual(res, 0)
req.setSubRequestFiles(0, "transfer", [{"LFN": "foo", "Status": "Waiting"}])
res = req._getLastOrder("foo")
self.assertEqual(res, 1)
req.addSubRequest(
{"Attributes": {"Operation": "replicateAndRegister", "TargetSE": "SE", "ExecutionOrder": 2}}, "removal"
)
res = req._getLastOrder("foo")
self.assertEqual(res, 1)
req.setSubRequestFiles(0, "removal", [{"LFN": "foo", "Status": "Waiting"}])
res = req._getLastOrder("foo")
self.assertEqual(res, 2)
示例3: test_addSubRequest
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import _getLastOrder [as 别名]
#.........这里部分代码省略.........
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 2,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
},
]
}
self.assertEqual( rc_o.subRequests, subRequestExpected )
fileDict = {'LFN':'foo', 'Status':'Waiting'}
rc_o.setSubRequestFiles( op1_Index, 'someType', [fileDict] )
subRequestExpected = {
'someType':
[
{
'Files': [{'LFN':'foo', 'Status':'Waiting'}],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 0,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': 'op1'},
'Datasets': []
},
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 0,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': 'op2'},
'Datasets': []
},
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 1,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
}
],
'someOtherType':
[
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 2,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
},
]
}
self.assertEqual( rc_o.subRequests, subRequestExpected )
fileLastOp = rc_o._getLastOrder( 'foo' )
rc_o.addSubRequest( {'Attributes': {'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743', 'ExecutionOrder': fileLastOp + 1}},
'someOtherType' )
subRequestExpected = {
'someType':
[
{
'Files': [{'LFN':'foo', 'Status':'Waiting'}],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 0,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': 'op1'},
'Datasets': []
},
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 0,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': 'op2'},
'Datasets': []
},
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 1,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
}
],
'someOtherType':
[
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 2,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
},
{
'Files': [],
'Attributes': {'Status': 'Waiting', 'LastUpdate': '', 'TargetSE': '', 'ExecutionOrder': 1,
'SubRequestID': 'x', 'CreationTime': '2012-06-06 14:53:43.763743',
'Catalogue': '', 'Error': '', 'Operation': ''},
'Datasets': []
},
]
}
self.assertEqual( rc_o.subRequests, subRequestExpected )
示例4: test_addSubRequest
# 需要导入模块: from DIRAC.RequestManagementSystem.Client.RequestContainer import RequestContainer [as 别名]
# 或者: from DIRAC.RequestManagementSystem.Client.RequestContainer.RequestContainer import _getLastOrder [as 别名]
#.........这里部分代码省略.........
"Status": "Waiting",
"LastUpdate": "",
"TargetSE": "",
"ExecutionOrder": 1,
"SubRequestID": "x",
"CreationTime": "2012-06-06 14:53:43.763743",
"Catalogue": "",
"Error": "",
"Operation": "",
},
"Datasets": [],
},
],
"someOtherType": [
{
"Files": [],
"Attributes": {
"Status": "Waiting",
"LastUpdate": "",
"TargetSE": "",
"ExecutionOrder": 2,
"SubRequestID": "x",
"CreationTime": "2012-06-06 14:53:43.763743",
"Catalogue": "",
"Error": "",
"Operation": "",
},
"Datasets": [],
}
],
}
self.assertEqual(rc_o.subRequests, subRequestExpected)
fileLastOp = rc_o._getLastOrder("foo")
rc_o.addSubRequest(
{
"Attributes": {
"SubRequestID": "x",
"CreationTime": "2012-06-06 14:53:43.763743",
"ExecutionOrder": fileLastOp + 1,
}
},
"someOtherType",
)
subRequestExpected = {
"someType": [
{
"Files": [{"LFN": "foo", "Status": "Waiting"}],
"Attributes": {
"Status": "Waiting",
"LastUpdate": "",
"TargetSE": "",
"ExecutionOrder": 0,
"SubRequestID": "x",
"CreationTime": "2012-06-06 14:53:43.763743",
"Catalogue": "",
"Error": "",
"Operation": "op1",
},
"Datasets": [],
},
{
"Files": [],
"Attributes": {
"Status": "Waiting",