autowisp.tests.test_exception_hierarchy module

Class Inheritance Diagram

Inheritance diagram of AutoWISPError, BadImageError, Column, Component, ConvergenceError, FileKind, FrozenRow, HDF5LayoutError, ImageMismatchError, Integer, OutsideImageError, Path, RelatedFile, StepError, String, TestCatalogRetryExhaustion, TestExceptionHierarchy, TestFrozenRow, TestMigratedExceptions, TestSnapshotRow, TestToDetailDict, _Base, _ToyRow, datetime, partial

Unit tests for the exception hierarchy and FrozenRow.

These tests need no pipeline fixtures or database, so they subclass unittest.TestCase directly rather than AutoWISPTestCase.

class autowisp.tests.test_exception_hierarchy.TestCatalogRetryExhaustion(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestCatalogRetryExhaustion

A Gaia query that exhausts its retries surfaces as CatalogError.

test_get_result_raises_catalog_error_after_retries()[source]

The final failed attempt raises CatalogError, chaining the cause.

class autowisp.tests.test_exception_hierarchy.TestExceptionHierarchy(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestExceptionHierarchy

Contracts every concrete AutoWISP exception must satisfy.

test_all_classes_pickle_round_trip()[source]

Every concrete class round-trips with a full payload.

test_every_concrete_class_sets_component()[source]

Each concrete subclass has a Component (never None).

test_full_payload_pickle_round_trip()[source]

All context fields survive a pickle round-trip (Pool transport).

test_minimal_construction_defaults()[source]

A message-only construction leaves context fields empty.

test_stamp_subprocess_sets_and_is_idempotent()[source]

First stamp records this PID; a later stamp does not overwrite.

test_with_pipeline_run_attaches_and_sets_crashed()[source]

with_pipeline_run stores the row and fills crashed.

test_with_pipeline_run_keeps_existing_crashed()[source]

An already-set crashed is not overwritten.

class autowisp.tests.test_exception_hierarchy.TestFrozenRow(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestFrozenRow

FrozenRow attribute access, immutability, and pickling.

test_attribute_access()[source]

Columns are reachable as attributes and via columns.

test_missing_attribute_raises()[source]

An unknown column raises AttributeError.

test_pickle_round_trip()[source]

A FrozenRow survives pickling with columns intact.

class autowisp.tests.test_exception_hierarchy.TestMigratedExceptions(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestMigratedExceptions

Folded legacy classes are pure AutoWISP exceptions (no stdlib mix-in).

Phase 7 dropped the ValueError / RuntimeError / IndexError bases the legacy classes used to carry; these guard against one creeping back.

test_catalog_error_is_cross_cutting_step_error()[source]

CatalogError is a component-step error, not per-stage.

test_convergence_error_is_pure_step_error()[source]

ConvergenceError is a StepError and not a RuntimeError.

test_hdf5_layout_error_is_pipeline()[source]

HDF5LayoutError is a pipeline-component error.

test_no_stdlib_mixins()[source]

None of the folded classes subclass a stdlib exception.

test_outside_image_error_specializes_calibration()[source]

OutsideImageError is a CalibrationError (calibration-only).

class autowisp.tests.test_exception_hierarchy.TestSnapshotRow(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestSnapshotRow

snapshot_row freezes a live ORM instance into a FrozenRow.

test_exclude_omits_columns()[source]

Excluded column keys do not appear in the snapshot.

test_snapshot_captures_columns()[source]

All mapped columns are captured and reachable by attribute.

test_snapshot_pickles()[source]

A snapshot of a live row pickles cleanly (no session attached).

class autowisp.tests.test_exception_hierarchy.TestToDetailDict(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_exception_hierarchy.TestToDetailDict

to_detail_dict + sanitize_for_json (the sidecar payload).

test_detail_dict_fields()[source]

The payload carries the non-column fields, related files in full.

Models a real find_stars failure: the input is a calibrated FITS image and the (expected) output is its DR file.

test_large_array_is_summarized()[source]

A large ndarray is summarized, not dumped whole.

A str related-file path is coerced to Path, serialized POSIX.

Regression: to_detail_dict used related.path.as_posix(), which crashed when path was passed as a plain string.

test_round_trips_through_json_with_sanitizer()[source]

A details payload of awkward types serializes without raising.

class autowisp.tests.test_exception_hierarchy._ToyRow(**kwargs)[source]

Bases: Base

Throwaway ORM model for exercising snapshot_row.

host
id
secret
autowisp.tests.test_exception_hierarchy._concrete_exception_classes()[source]

All AutoWISPError subclasses defined in autowisp.exceptions.

Excludes AutoWISPError itself, which deliberately does not set a component (that is the contract every subclass must satisfy).

autowisp.tests.test_exception_hierarchy._full_payload()[source]

A populated kwargs dict exercising every context field.