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