gavo.user.validation module

A cli-facing module providing functionality to “validate” one or more resource descriptors.

Validation means giving some prognosis as to whether RD will properly work within both the DC and the VO.

While validation is active there’s base.VALIDATING=True. If RDs to anything expensive, they’re advised to have something like:

if getattr(base, "VALIDATING", False):
        (don't do the expensive thing)
class gavo.user.validation.TestsCollector[source]

Bases: object

a singleton that collects use cases to run.

Don’t instantiate, this is a global singleton.

The testsToRun attribute contains the test suites to run.

classmethod addRD(rd)[source]

adds tests from rd.

testsToRun = []
gavo.user.validation.isIVOPublished(res)[source]

returns true if res has a publication facing the VO.

gavo.user.validation.iterPublishedResources(rd, args)[source]
gavo.user.validation.loadRD(rdId)[source]

returns the RD identified by rdId.

If that fails, diagnostics are printed and None is returned.

gavo.user.validation.main()[source]
gavo.user.validation.outputDependentMessage(aString)[source]

an output function for errhandle.raiseAndCatch.

It is used here to indent dependent error messages.

gavo.user.validation.outputError(rdId, message, verbose=False)[source]
gavo.user.validation.outputWarning(rdId, message, verbose=False)[source]
gavo.user.validation.parseCommandLine()[source]
gavo.user.validation.validateAll(args)[source]

validates all accessible RDs.

gavo.user.validation.validateOne(rdId, args)[source]

outputs to stdout various information on the RD identified by rdId.

gavo.user.validation.validateOtherCode(rd, args)[source]

tries to compile other pieces of code in an RD and bails out if one is bad.

gavo.user.validation.validateRST(rd, args)[source]

outputs diagnostics on RST formatting problems.

gavo.user.validation.validateRowmakers(rd, args)[source]

tries to build all rowmakers mentioned in the RD and bails out if one is bad.

gavo.user.validation.validateServices(rd, args)[source]

outputs to stdout various diagnostics about the services on rd.

gavo.user.validation.validateTables(rd, args)[source]

does some sanity checks on the (top-level) tables within rd.