autowisp.tests.test_crash_report module

Class Inheritance Diagram

Inheritance diagram of Configuration, Error, Image, ImageProcessingProgress, LightCurveProcessingProgress, Parameter, SimpleNamespace, Step, TestBuildCrashReport, TestCollectEnvironment, TestCollectProvenance, TestCrashReportCli, TestFindErrorProgress, TestScrubConfigValues, TestScrubMapping, TestScrubText

Unit tests for the crash-report builder and its scrubbing helpers.

class autowisp.tests.test_crash_report.TestBuildCrashReport(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestBuildCrashReport

build_crash_report assembles a scrubbed, best-effort zip.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_missing_sidecar_is_a_gap()[source]

A sidecar-less error still builds, with the gap recorded.

test_report_contents_and_scrubbing()[source]

The zip holds the expected members; the DB copy is scrubbed.

test_unknown_error_raises()[source]

An unknown error id raises ValueError.

class autowisp.tests.test_crash_report.TestCollectEnvironment(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestCollectEnvironment

collect_environment records platform + requested package versions.

test_fields_and_requested_packages()[source]

Only the requested (installed) packages are reported.

class autowisp.tests.test_crash_report.TestCollectProvenance(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestCollectProvenance

collect_provenance captures the current environment, JSON-safe.

test_fields_present_and_serializable()[source]

The provenance dict has the expected fields and serializes.

test_unknown_package_omitted()[source]

A package that is not installed is simply absent (no error).

class autowisp.tests.test_crash_report.TestCrashReportCli(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestCrashReportCli

The wisp-crash-report CLI: latest-error lookup and the entry point.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_cli_errors_without_id_or_last()[source]

Omitting both an id and –last exits with an argparse error.

test_cli_last_resolves_most_recent()[source]

–last targets the most recently recorded error.

test_cli_last_with_no_errors_exits()[source]

–last with no recorded errors exits with an error.

test_cli_writes_report_for_id()[source]

Passing an id builds the report and prints where it went.

test_latest_error_id()[source]

latest_error_id returns the most recent error, None when empty.

class autowisp.tests.test_crash_report.TestFindErrorProgress(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestFindErrorProgress

find_error_progress resolves a step error to its processing record.

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_filters_by_image_type_when_image_known()[source]

When the error names an image, the image’s type disambiguates.

test_none_for_stepless_or_runless()[source]

A pipeline/BUI error (no step or run) resolves to nothing.

test_resolves_by_run_and_step()[source]

An error’s run + step pick out the matching progress.

test_resolves_lightcurve_step()[source]

A lightcurve-step error resolves via the LC progress table.

Regression for the crash-report gap where LC steps (tfa/epd/…) recorded in light_curve_processing_progress – a different table than image steps – could never resolve, so their logs were never collected.

test_select_logs_empty_without_progress()[source]

A stepless error selects no logs (and does not raise).

class autowisp.tests.test_crash_report.TestScrubConfigValues(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestScrubConfigValues

scrub_config_values redacts secret configuration values in the DB.

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

test_redacts_secret_config_only()[source]

Secret-named config values are redacted; others are kept.

class autowisp.tests.test_crash_report.TestScrubMapping(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestScrubMapping

scrub_mapping redacts values whose key names a secret.

test_nested_non_secret_parent()[source]
test_original_not_mutated()[source]
test_recurses_into_nested()[source]
test_redacts_secret_keys()[source]
class autowisp.tests.test_crash_report.TestScrubText(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_crash_report.TestScrubText

scrub_text redacts secret values, leaves everything else intact.

test_dict_repr_line()[source]

Quoted secret values in a dict repr are redacted, others kept.

test_empty_input()[source]
test_ini_assignment()[source]

An ini-style key = value secret is redacted to end of line.

test_json_assignment()[source]

A JSON-style secret value is redacted.

test_non_secret_untouched()[source]

A non-secret key (even one containing ‘pass’ fragments) stays.