1 |
import dbsException
|
2 |
import dbsApplication
|
3 |
import dbsProcessingPath
|
4 |
import dbsProcessedDataset
|
5 |
import testCaseInterface
|
6 |
# Unit testing.
|
7 |
|
8 |
class testGetDatasetBlocks(testCaseInterface.testCaseInterface) :
|
9 |
|
10 |
def __init__(self):
|
11 |
testCaseInterface.testCaseInterface.__init__(self)
|
12 |
self.addTestCase(self.getDatasetBlocks)
|
13 |
|
14 |
datasetPath = "/ThisIsATestDataset/Digi/ThisIsATestProcDataset"
|
15 |
app = dbsApplication.DbsApplication(
|
16 |
family="CMSAppFam",
|
17 |
executable="cmsRun",
|
18 |
version="CMSSW_XYZ",
|
19 |
parameterSet="pSetDummy")
|
20 |
|
21 |
processingPath = dbsProcessingPath.DbsProcessingPath(
|
22 |
dataTier="Digi",
|
23 |
application=app)
|
24 |
|
25 |
self.dataset = dbsProcessedDataset.DbsProcessedDataset(
|
26 |
primaryDatasetName="ThisIsATestDataset",
|
27 |
isDatasetOpen="y",
|
28 |
datasetName="ThisIsATestProcDataset",
|
29 |
processingPath=processingPath)
|
30 |
|
31 |
def getDatasetBlocks(self):
|
32 |
funcName = "%s.%s" % (self.__class__.__name__, "getDatasetBlocks : Get a list of File Blocks in a Dataset")
|
33 |
print "Now executing ", funcName
|
34 |
|
35 |
try:
|
36 |
|
37 |
fileBlockList = self.api.getDatasetFileBlocks(self.dataset)
|
38 |
for fileBlock in fileBlockList:
|
39 |
print "File block name/id: %s/%s" % (fileBlock.getBlockName(),fileBlock.getBlockId())
|
40 |
for eventCollection in fileBlock.getEventCollectionList():
|
41 |
print " %s" % eventCollection
|
42 |
|
43 |
except dbsException.DbsException, ex:
|
44 |
return 1
|
45 |
|
46 |
return 0
|
47 |
|
48 |
|