Package qm :: Package test :: Package web :: Module web :: Class DirPage
[hide private]
[frames] | no frames]

Class DirPage
source code

web.DtmlPage --+        
               |        
 DefaultDtmlPage --+    
                   |    
          QMTestPage --+
                       |
                      DirPage

A test database directory page.

These attributes are available in DTML:

'path' -- The label directory that is being displayed.

'subdirs' -- A sequence of labels giving the subdirectories of this directory.

'test_ids' -- A sequence of labels giving the tests in this directory.

'suite_ids' -- A sequence of labels giving the suites in this directory.

'resource_ids' -- A sequence of labels giving the resources in this directory.

Nested Classes [hide private]

Inherited from web.DtmlPage: default_class


Instance Methods [hide private]
  __init__(self, server, path)
Construct a 'DirPage'.
  GetRunUrl(self)
Return the URL for running this directory.
  GetTestResultsForDirectory(self, directory)
Return all of the test results for tests in 'directory'.
  GetUnexpectedResultsByOutcome(self, results)
Compute the tests in 'results' with each outcome.
  GetUnexpectedOutcomePercentages(self, results)
Compute percentages of unexpected 'results'.
  CountUnexpected(self, results)
Count the unexpected 'results'.
  GetResultURL(self, id, kind)
Generate a URL for the result page for 'id'.
  GetTests(self, sort)
Return information about all of the tests.
  GetTestOutcome(self, test_id)
Return the 'Result' for 'test_id'.
  GetDetailURL(self, test_id)
Return the detail URL for 'test_id'.
  GetExpectation(self, test_id)
Return the expected outcome for 'test_id'.
  GetSortURL(self, sort)
Get the URL for this page, but sorted as indicated.
  IsFinished(self)
Return true iff no more results are forthcoming.
  GetRefreshDelay(self)
Returns the number of seconds to wait before refreshing the page.

Inherited from QMTestPage: GenerateHtmlHeader, GenerateStartBody, GetExpectationUrl

Inherited from DefaultDtmlPage: FormatId, GetDatabase, GetMainPageUrl, GetName, GetOutcomePercentages, GetResultsByOutcome, HasModifiableExpectations, IsLabelInDirectory, MakeListingUrl

Inherited from web.DtmlPage: GenerateEndBody, GenerateEndScript, GenerateStartScript, GenerateXMLHeader, GetProgramName, MakeButton, MakeImageUrl, MakeLoginForm, MakeRule, MakeSpacer, UserIsInGroup, WebRequest, __call__


Class Variables [hide private]
SORT_NAME Sort by name.
SORT_OUTCOME Sort by outcome.
SORT_EXPECTATION Sort by expectation.
SORT_KINDS The kinds of sorting available.

Inherited from DefaultDtmlPage: EXPECTATION_KINDS, EXPECTED, NEGATIVE_UNEXPECTED, POSITIVE_UNEXPECTED, html_generator, outcomes

Inherited from web.DtmlPage: common_javascript, html_stylesheet, qm_bug_system_url, web


Method Details [hide private]

__init__(self, server, path)
(Constructor)

source code 

Construct a 'DirPage'.

'server' -- The 'QMTestServer' creating this page.

'path' -- The label directory to display.
Overrides: QMTestPage.__init__

GetRunUrl(self)

source code 
Return the URL for running this directory.

GetTestResultsForDirectory(self, directory)

source code 

Return all of the test results for tests in 'directory'.

'directory' -- A string giving the label for a directory.

returns -- A sequence of 'Result' instances corresponding to results for tests from the indicated directory.

GetUnexpectedResultsByOutcome(self, results)

source code 

Compute the tests in 'results' with each outcome.

'results' -- A sequence of 'Result' instances.

returns -- A dictionary mapping outcomes to the results with that outcome -- and for which that outcome is unexpected. The (fake) outcome 'self.EXPECTED' is mapped to expected results.

GetUnexpectedOutcomePercentages(self, results)

source code 

Compute percentages of unexpected 'results'.

'results' -- A sequence of 'Result' instances.

returns -- A dictionary mapping the 'EXPECTATION_KINDS' to the percentage (as a floating point number) of tests in 'results' that have that expectation.

CountUnexpected(self, results)

source code 

Count the unexpected 'results'.

'results' -- A dictionary of the form returned by 'GetUnexpectedResultsByOutcome'.

returns -- The total number of unexpected results.

GetResultURL(self, id, kind)

source code 

Generate a URL for the result page for 'id'.

'id' -- The name of a test or resource.

'kind' -- either 'test' or 'resource'.

returns -- A url string for the result page for 'id'.

GetTests(self, sort)

source code 

Return information about all of the tests.

'sort' -- One of the 'SORT_KINDS' indicating how the results should be sorted.

returns -- A sequence of 'Item' instances corresponding to all of the tests in this diretory.

GetTestOutcome(self, test_id)

source code 

Return the 'Result' for 'test_id'.

'test_id' -- The name of the test whose result is requested.

'result' -- The result associated with the 'test_id', or 'None' if no result is available.

GetDetailURL(self, test_id)

source code 

Return the detail URL for 'test_id'.

'test_id' -- The name of the test.

returns -- The URL that contains details about the 'test_id'.

GetExpectation(self, test_id)

source code 

Return the expected outcome for 'test_id'.

'test_id' -- The name of the test.

returns -- A string giving the expected outcome for 'test_id', or 'None' if there is no expectation.

GetSortURL(self, sort)

source code 

Get the URL for this page, but sorted as indicated.

'sort' -- One of the 'SORT_KINDS'.

returns -- A URL indicating this page, but sorted as indicated.

IsFinished(self)

source code 

Return true iff no more results are forthcoming.

returns -- True if no more tests are running.
Overrides: QMTestPage.IsFinished

GetRefreshDelay(self)

source code 

Returns the number of seconds to wait before refreshing the page.

returns -- The number of seconds to wait before refreshing this page. A value of zero means that te page should never be refreshed. This function is only called if 'IsFinished' returns true.
Overrides: QMTestPage.GetRefreshDelay

Class Variable Details [hide private]

SORT_NAME

Sort by name.
Value:
'name'                                                                 
      

SORT_OUTCOME

Sort by outcome.
Value:
'outcome'                                                              
      

SORT_EXPECTATION

Sort by expectation. In other words, put unexpected outcomes before expected outcomes.
Value:
'expectation'                                                          
      

SORT_KINDS

The kinds of sorting available.
Value:
['name', 'outcome', 'expectation']