autowisp.tests.test_error_cli module

Class Inheritance Diagram

Inheritance diagram of Component, ConfigurationError, Error, PipelineError, TestCliEntryPoint, TestConfigParseErrors, TestExitCodeFor, TestReportError, TestStepEntryBoundaries, TestStepEntryEndToEnd, _CliTestCase

Unit tests for CLI error reporting and the entry decorator.

class autowisp.tests.test_error_cli.TestCliEntryPoint(methodName='runTest')[source]

Bases: _CliTestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestCliEntryPoint

cli_entry_point reports and exits non-zero on an escaping error.

test_autowisp_error_exits_with_component_code()[source]

A raised AutoWISPError -> SystemExit with the component’s code.

test_success_passes_through()[source]

No error -> the wrapped return value, no exit.

test_unknown_exception_is_wrapped_and_exits()[source]

A bare exception is wrapped (capture_errors) then reported.

class autowisp.tests.test_error_cli.TestConfigParseErrors(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestConfigParseErrors

Stored-config parse errors are catchable, not an uncatchable exit.

The pipeline builds each step’s config dict by feeding stored configuration through the step’s ManualStepArgumentParser (see ProcessingManager.get_config). A bad value there must raise a recordable ConfigurationError rather than argparse’s default SystemExit, which would silently end a detached run.

test_config_mode_raises_configuration_error()[source]

In config-parse mode, a bad value raises ConfigurationError.

test_interactive_cli_still_exits()[source]

Outside config-parse mode, a bad value keeps argparse exit.

test_mode_is_restored_after_context()[source]

Leaving the context reverts to argparse’s exit behavior.

class autowisp.tests.test_error_cli.TestExitCodeFor(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestExitCodeFor

exit_code_for distinguishes the components.

test_distinct_codes()[source]
class autowisp.tests.test_error_cli.TestReportError(methodName='runTest')[source]

Bases: _CliTestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestReportError

report_error persists, renders to the stream, returns the code.

test_default_view_summary_and_pointer()[source]

Default rendering is the summary plus a pointer line.

test_developer_view_includes_traceback()[source]

developer=True renders the full technical detail.

test_persists_a_row()[source]

Reporting records a queryable Error row.

class autowisp.tests.test_error_cli.TestStepEntryBoundaries(methodName='runTest')[source]

Bases: TestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestStepEntryBoundaries

Every pipeline-step main() is wrapped as a CLI error boundary.

test_all_step_mains_are_cli_entry_points()[source]

Each step that exposes a main() carries the CLI boundary.

Driven by autowisp.processing_steps.get_step_names() so a newly-added step is checked automatically; steps without a CLI main() (library-only steps) are skipped.

class autowisp.tests.test_error_cli.TestStepEntryEndToEnd(methodName='runTest')[source]

Bases: _CliTestCase

Inheritance diagram of autowisp.tests.test_error_cli.TestStepEntryEndToEnd

A real decorated step main() surfaces an escaping error.

test_calibrate_main_reports_and_exits()[source]

An error inside calibrate.main -> SystemExit with STEP code.

class autowisp.tests.test_error_cli._CliTestCase(methodName='runTest')[source]

Bases: TestCase

Base creating one throwaway project database for the class.

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.