Table of Contents

Class: XMLDatabase qm/test/classes/xml_database.py

A database representing tests as XML files in a directory tree.

Base Classes   
ExtensionDatabase
Methods   
GetAttachmentStore
WriteExtension
_GetResourceFromPath
_GetSuiteFromPath
_GetTestFromPath
_Trace
__LoadItem
__MakeDataFilePath
__ParseResourceDocument
__ParseTestDocument
__StoreAttachments
__init__
  GetAttachmentStore 
GetAttachmentStore ( self )

Returns the AttachmentStore associated with the database.

returns
The AttachmentStore containing the attachments associated with tests and resources in this database.
  WriteExtension 
WriteExtension (
        self,
        id,
        extension,
        )

  _GetResourceFromPath 
_GetResourceFromPath (
        self,
        resource_id,
        resource_path,
        )

Exceptions   
TestFileError, message
  _GetSuiteFromPath 
_GetSuiteFromPath (
        self,
        suite_id,
        path,
        )

Load the test suite file at path with suite ID suite_id.

returns
A Suite object.
Exceptions   
NoSuchSuiteError, "no suite file %s" % path
RuntimeError, qm.error( "invalid id", id = id_ )
  _GetTestFromPath 
_GetTestFromPath (
        self,
        test_id,
        test_path,
        )

Exceptions   
TestFileError, message
  _Trace 
_Trace ( self,  message )

Write a trace message.

message
A string to be output as a trace message.
  __LoadItem 
__LoadItem (
        self,
        item_id,
        path,
        document_parser,
        )

Load an item (a test or resource) from an XML file.

This function is used for logic common to tests and resources.

item_id
The ID of the item to get.
path
The path to the test or resource file.
document_parser
A function that takes an XML DOM document as its argument and returns the constructed item object.
  __MakeDataFilePath 
__MakeDataFilePath (
        self,
        item_id,
        file_name,
        )

Construct the path to an attachment data file.

item_id
The test or resource item of which the attachment is part.
file_name
The file name specified for the attachment.
  __ParseResourceDocument 
__ParseResourceDocument (
        self,
        resource_id,
        document,
        )

Return a resource object constructed from a resource document.

resource_id
The resource ID of the resource.
document
A DOM document node containing a single resource element from which the resource object is constructed.
  __ParseTestDocument 
__ParseTestDocument (
        self,
        test_id,
        document,
        )

Return a test object constructed from a test document.

test_id
The test ID of the test.
document
A DOM document containing a single test element from which the test is constructed.
  __StoreAttachments 
__StoreAttachments ( self,  item )

Store all attachments in item in the attachment store.

item
A Test or Resource. If any of its fields contain attachments, add them to the AttachmentStore.
  __init__ 
__init__ (
        self,
        path,
        arguments,
        )


Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1