Package gavo :: Package rscdef :: Module regtest
[frames] | no frames]

Module regtest

source code

A framework for regression tests within RDs.

The basic idea is that there's small pieces of python almost-declaratively defining tests for a given piece of data. These things can then be run while (or rather, after) executing gavo val.

Classes
  Keywords
A class encapsulating test selection keywords.
  DynamicOpenVocAttribute
an attribute that collects arbitrary attributes in a sequence of pairs.
  Upload
An upload going with a URL.
  DataURL
A source document for a regression test.
  RegTest
A regression test.
  RegTestSuite
A suite of regression tests.
  TestStatistics
A statistics gatherer/reporter for the regression tests.
  TestRunner
A runner for regression tests.
Functions
 
getAuthFor(authKey)
returns a header dictionary to authenticate for authKey.
source code
 
doHTTPRequest(method, host, path, query, payload, headers, timeout)
creates the HTTP request and retrieves the result.
source code
 
getHeaderValue(headers, key)
returns the value for key in the httplib headers.
source code
 
urlToURL()
converts HTTP (GET) URLs to URL elements.
source code
 
parseCommandLine(args=None)
parses the command line for main()
source code
 
main(args=None)
user interaction for gavo test.
source code
Variables
  __package__ = 'gavo.rscdef'
Function Details

getAuthFor(authKey)

source code 

returns a header dictionary to authenticate for authKey.

authKey is a key into ~/.gavo/test.creds.

getHeaderValue(headers, key)

source code 

returns the value for key in the httplib headers.

Matching is case-insensitive as required by HTTP. Missing keys raise KeyErrors.