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_id
suite_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_id
TestDescriptor
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_id
test_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
.basename
Derived classes may override this method.
_GetLabels ( self, directory, scan_subdirs, label, predicate, )
directory
.directory
scan_subdirs
directory
should be scanned.label
directory
.predicate
directory
. that
satisfy predicate
If scan_subdirs
is true, subdirectories
are scanned as well._GetPath ( self, kind, id, )
id
.kind
id
_GetPathFromLabel ( self, label )
label
.label
_GetRelativeLabelPath ( self, label )
label
as a relative filename.label
._GetResourceFromPath ( self, resource_id, path, )
path
.resource_id
path
path
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_id
path
path
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_id
path
path
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
.kind
Database.ITEM_KINDS
.path
path
is a file of the indicated kind.Derived classes must override this method.
_IsResourceFile ( self, path )
path
is a resource file.path
Derived classes must override this method.
Exceptions | |
---|---|
NotImplementedError |
_IsSuiteFile ( self, path )
path
is a test suite file or directory.path
Derived 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.path
Derived classes must override this method.
Exceptions | |
---|---|
NotImplementedError |