ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/DBS/Clients/Tests/testCreatePrimaryDS.py
Revision: 1.1
Committed: Sun Feb 5 06:45:13 2006 UTC (19 years, 3 months ago) by afaq
Content type: text/x-python
Branch: MAIN
Log Message:
Added a Test Suite (A simple Framework to write Unit test for API calls, and some TestCases, More to come).

File Contents

# User Rev Content
1 afaq 1.1 import dbsException
2     import dbsPrimaryDataset
3     import testCaseInterface
4     # Unit testing.
5    
6    
7     class testCreatePrimaryDS(testCaseInterface.testCaseInterface) :
8    
9     def __init__(self):
10     funcName = "%s.%s" % (self.__class__.__name__, "__init__()")
11     print "Now executing ", funcName
12     testCaseInterface.testCaseInterface.__init__(self)
13     self.addTestCase(self.createPrimaryDS)
14     #self.addTestCase(self.printYahoo)
15    
16     def createPrimaryDS(self):
17     funcName = "%s.%s" % (self.__class__.__name__, "createPrimaryDS")
18     print "Now executing ", funcName
19    
20     try:
21    
22     dataset = dbsPrimaryDataset.DbsPrimaryDataset(datasetName="ThisIsATestDataset")
23    
24     primaryDatasetId = self.api.createPrimaryDataset(dataset)
25     print "Got primary dataset id: %s" % primaryDatasetId
26    
27     except dbsException.DbsException, ex:
28     return 1
29    
30     return 0
31    
32     def printYahoo(self) :
33     print "YAhooooooooooooooooooooooooo"
34     return 0
35    
36