Package qm :: Package test :: Module directory_suite
[hide private]
[frames] | no frames]

Source Code for Module qm.test.directory_suite

 1  ######################################################################## 
 2  # 
 3  # File:   directory_suite.py 
 4  # Author: Mark Mitchell 
 5  # Date:   2001-10-06 
 6  # 
 7  # Contents: 
 8  #   QMTest DirectorySuite class. 
 9  # 
10  # Copyright (c) 2001 by CodeSourcery, LLC.  All rights reserved.  
11  # 
12  # For license terms see the file COPYING. 
13  # 
14  ######################################################################## 
15   
16  ######################################################################## 
17  # imports 
18  ######################################################################## 
19   
20  from qm.test.suite import * 
21   
22  ######################################################################## 
23  # classes 
24  ######################################################################## 
25   
26 -class DirectorySuite(Suite):
27 """A 'DirectorySuite' is a suite corresponding to a directory. 28 29 A 'DirectorySuite' is an implicit suite that contains all tests 30 within a given directory. The directory is given by a label, not 31 a file system directory, so a 'DirectorySuite' can work with any 32 database.""" 33
34 - def __init__(self, database, directory):
35 """Construct a new 'DirectorySuite'. 36 37 'database' -- The 'Database' instance containing this suite. 38 39 'directory' -- A label giving the directory corresponding to 40 this suite.""" 41 42 # Construct the base class. 43 super(DirectorySuite, self).__init__({}, 44 qmtest_id = directory, 45 qmtest_database = database)
46 47
48 - def GetTestIds(self):
49 """Return the tests contained in this suite. 50 51 returns -- A sequence of labels corresponding to the tests 52 contained in this suite. Tests that are contained in this suite 53 only because they are contained in a suite which is itself 54 contained in this suite are not returned.""" 55 56 return self.GetDatabase().GetTestIds(self.GetId(), scan_subdirs=0)
57 58
59 - def GetSuiteIds(self):
60 """Return the suites contained in this suite. 61 62 returns -- A sequence of labels corresponding to the suites 63 contained in this suite. Suites that are contained in this 64 suite only because they are contained in a suite which is itself 65 contained in this suite are not returned.""" 66 67 return self.GetDatabase().GetSuiteIds(self.GetId(), scan_subdirs=0)
68 69
70 - def IsImplicit(self):
71 72 return 1
73 74 ######################################################################## 75 # Local Variables: 76 # mode: python 77 # indent-tabs-mode: nil 78 # fill-column: 72 79 # End: 80