timetoshare.fixtures#

The bundled cases of the current version: fixtures, rejections and warnings.

The emitted manifests under fixtures/<version>/ (drawings excluded), the canonical N-Quads expected of the statement fixtures under fixtures/rdf/<version>/, the hand-authored rejection cases under fixtures/rejections/<version>/ and the hand-authored warning cases under fixtures/warnings/<version>/, found beside the schema. The cases are written in canonical YAML (.yaml); a rejection or warning case about JSON text itself would be written in JSON (.json); none is at present. Every case is read with loads(), as the JavaScript package reads it.

timetoshare.fixtures.fixture_paths()[source]#

Return every bundled manifest fixture, excluding drawings.

timetoshare.fixtures.rdf_expectation(path)[source]#

Return the canonical N-Quads file expected of a statement fixture.

fixtures/rdf/<version>/<name>.nq for the fixture statements/<name>.yaml and for its minimal twin statements/<name>.minimal.yaml alike: both read to the same graph. The file may not exist yet; the caller reads it.

timetoshare.fixtures.rejection_paths()[source]#

Return the shared rejection cases, sorted by name.

class timetoshare.fixtures.RejectionCase(manifest, path, code, error, reason)[source]#

Bases: object

One shared rejection case, read for validation.

manifest#

The value to validate, with any non-finite number in place.

Type:

Any

path#

Where the validator reports the problem.

Type:

tuple[str | int, …]

code#

The rule’s code, or None where the case raises an error without one.

Type:

str | None

error#

The name of the error class where it is not SchemaValidationError, else None.

Type:

str | None

reason#

The rule the case breaks, in words.

Type:

str

timetoshare.fixtures.rejection_case(path)[source]#

Read one shared rejection case from path.

A case holds no NaN and no infinity, which no serialization writes, so a case about the finite rule stores a finite placeholder at its path and names the value to put there under non_finite; the reader puts it in place.

Raises:

ValueError – If the file cannot be read or names an unknown non-finite value.

timetoshare.fixtures.warning_paths()[source]#

Return the shared warning cases, sorted by name.