| Class: FileDatabase | qm/test/file_database.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A
|
| Base Classes | |
|---|---|
|
Database |
| Methods | |||
|---|---|---|---|
| GetIds | |||
GetIds (
self,
kind,
directory="",
scan_subdirs=1,
)
| |||
| GetResource | |||
GetResource ( self, resource_id ) Return the
| |||
| GetResourcePath | |||
GetResourcePath ( self, resource_id ) Return the file containing
| |||
| GetRoot | |||
GetRoot ( self ) Return the root of the test database.
Derived classes may override this method. | |||
| GetSubdirectories | |||
GetSubdirectories ( self, directory ) Return the subdirectories of
| |||
| GetSuite | |||
GetSuite ( self, suite_id ) Return the
|
| Exceptions | |
|---|---|
|
NoSuchSuiteError, suite_id |
GetSuitePath ( self, suite_id )
suite_id.suite_idsuite_id. This method works
even if no suite named suite_id exists.Derived classes may override this method.
GetTest ( self, test_id )
TestDescriptor for the test named test_id.test_idTestDescriptor corresponding to test_id.NoSuchTestError if there is no test in the database
named test_id.| Exceptions | |
|---|---|
|
NoSuchTestError, test_id |
GetTestPath ( self, test_id )
test_id.test_idtest_id. This method works even if no test
named test_id exists.Derived classes may override this method.
RemoveExtension (
self,
id,
kind,
)
| Exceptions | |
|---|---|
|
{ Database.RESOURCE : NoSuchResourceError, Database.TEST : NoSuchTestError, Database.SUITE : NoSuchSuiteError } [ kind ], id |
_AreLabelsPaths ( self )
suite_extension between directories and
the test_extension or resource_extension at the end of the
name._GetLabelFromBasename ( self, basename )
basename.basenameDerived classes may override this method.
_GetLabels (
self,
directory,
scan_subdirs,
label,
predicate,
)
directory.directoryscan_subdirsdirectory should be scanned.labeldirectory.predicatedirectory. that
satisfy predicate If scan_subdirs is true, subdirectories
are scanned as well.
_GetPath (
self,
kind,
id,
)
id.kindid_GetPathFromLabel ( self, label )
label.label_GetRelativeLabelPath ( self, label )
label as a relative filename.label.
_GetResourceFromPath (
self,
resource_id,
path,
)
path.resource_idpathpath
satisfies _IsResourceFile.ResourceDescriptor corresponding to
resource_id.Derived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |
_GetSuiteFromPath (
self,
suite_id,
path,
)
Suite given by path.suite_idpathpath
satisfies _IsSuiteFile and is a file, not a directory.Suite corresponding to suite_id.Derived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |
_GetTestFromPath (
self,
test_id,
path,
)
path.test_idpathpath satisfies
_IsTestFile.TestDescriptor corresponding to test_id.Derived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |
_IsFile (
self,
kind,
path,
)
path is a file of the indicated kind.kindDatabase.ITEM_KINDS.pathpath is a file of the indicated kind.Derived classes must override this method.
_IsResourceFile ( self, path )
path is a resource file.pathDerived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |
_IsSuiteFile ( self, path )
path is a test suite file or directory.pathDerived classes may override this method, but only to restrict the set of suites. In particular, a derived class method may return false where this method would return true, but never vice versa.
Derived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |
_IsTestFile ( self, path )
path is a test file.pathDerived classes must override this method.
| Exceptions | |
|---|---|
|
NotImplementedError |