autowisp.tests.test_diagnostic_types module

Class Inheritance Diagram

Inheritance diagram of DiagnosticType, TestCatalogue, TestRuntimePatterns, TestSeeding, TestVocabulary

Tests for the diagnostic vocabulary.

The catalogue was moved out of _init_diagnostic_types() so that an expression can be validated without opening a project. The risk that creates is drift: the seeder and the catalogue are now two things that must agree, where before they were one. TestSeeding is the test that keeps them honest, and is the reason the rest of this file exists.

class autowisp.tests.test_diagnostic_types.TestCatalogue(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_diagnostic_types.TestCatalogue

The shape and content of the static catalogue.

test_descriptions_are_fully_interpolated()[source]

No description may contain an unexpanded placeholder.

Guards a real defect the extraction fixed: the continuation line of the *_map_residual description was not an f-string, so every one of them was seeded reading “and smoothed {param.upper()} map” literally. A missing f prefix is silent, so only a test of the rendered text catches it coming back.

test_it_cannot_be_mutated()[source]

A shared catalogue one caller can edit is not shared, it is a bug.

test_it_is_not_empty()[source]

A catalogue that silently emptied would pass every other test.

test_names_are_exactly_the_mapping_keys()[source]

The two accessors cannot disagree about what exists.

class autowisp.tests.test_diagnostic_types.TestRuntimePatterns(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_diagnostic_types.TestRuntimePatterns

The names that are described rather than listed.

is_quantile_diagnostic is the single definition of what a quantile is called: _save_image_diagnostics asks it before creating a row, and expression validation asks it before accepting a name. The two used to disagree – a loose startswith("pixel_q") against an anchored pattern – which is exactly the drift one predicate prevents.

test_it_does_not_swallow_plausible_names()[source]

The anchor and the required digits both matter.

Without them pixel_quality would be taken for a quantile, and a real diagnostic by that name could then never be referenced – an expression naming it would be told it is shadowing something.

test_it_matches_quantile_diagnostics()[source]

calibrate names them pixel_q followed by the percentile.

class autowisp.tests.test_diagnostic_types.TestSeeding(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_diagnostic_types.TestSeeding

The catalogue and the rows it seeds must stay identical.

test_seeded_rows_match_the_catalogue()[source]

The whole point of the extraction, and the only silent failure.

Descriptions are compared as well as names: they are what the catalogue carries beyond what validation needs, so a mismatch there is exactly the drift that splitting the two invites.

class autowisp.tests.test_diagnostic_types.TestVocabulary(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_diagnostic_types.TestVocabulary

What an expression may reference, without opening any project.

test_catalogue_entries_are_diagnostics()[source]

The seeded names, recorded or not in any particular project.

test_invented_names_are_neither()[source]

The vocabulary is closed, which is what makes it checkable.

test_time_is_a_quantity_but_not_a_diagnostic()[source]

jd is a column of the image row, not an image_diagnostics value, yet it is a variable in the same flat name space.