ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/DBS/Clients/Tests/testCreateBlock.py
Revision: 1.2
Committed: Tue Feb 7 22:26:02 2006 UTC (19 years, 2 months ago) by afaq
Content type: text/x-python
Branch: MAIN
CVS Tags: AfterJan2006SchemaChanges_v01_00_01, AfterJan2006SchemaChanges_v01_00_00, AfterJan2006SchemaChanges
Branch point for: BranchForCPPWebServiceTesting
Changes since 1.1: +2 -4 lines
Log Message:
Test cases are running fine

File Contents

# Content
1 import dbsException
2 import dbsProcessedDataset
3 import dbsApplication
4 import dbsProcessingPath
5 import dbsProcessedDataset
6 import dbsFileBlock
7 import testCaseInterface
8 # Unit testing.
9
10
11 class testCreateBlock(testCaseInterface.testCaseInterface) :
12
13 def __init__(self):
14 testCaseInterface.testCaseInterface.__init__(self)
15 self.addTestCase(self.createBlock)
16 #self.addTestCase(self.printYahoo)
17
18 def createBlock(self):
19 funcName = "%s.%s" % (self.__class__.__name__, "CreateBlock: Creates a File Block")
20 print "Now executing ", funcName
21
22 try:
23
24 datasetPath = "/ThisIsATestDataset/Digi/ThisIsATestProcDataset"
25 app = dbsApplication.DbsApplication(
26 family="CMSAppFam",
27 executable="cmsRun",
28 version="CMSSW_XYZ",
29 parameterSet="pSetDummy")
30
31 processingPath = dbsProcessingPath.DbsProcessingPath(
32 dataTier="Digi",
33 application=app)
34
35 dataset = dbsProcessedDataset.DbsProcessedDataset(
36 primaryDatasetName="ThisIsATestDataset",
37 isDatasetOpen="y",
38 datasetName="ThisIsATestProcDataset",
39 processingPath=processingPath)
40
41 block = dbsFileBlock.DbsFileBlock(
42 blockStatusName="Dummy Block Status",
43 numberOfBytes=1024,
44 numberOfFiles=10)
45
46 #print "Trying to create fileBlock"
47 fbId = self.api.createFileBlock(dataset, block)
48 print "Got file block id: %s" % fbId
49
50 except dbsException.DbsException, ex:
51 return 1
52
53 return 0
54
55
56