autowisp.tests package

Class Inheritance Diagram

Inheritance diagram of AutoWISPTestCase, FloatTestCase, Interpreter, Sequence

Autowisp unit-test init.

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

Bases: FloatTestCase

Inheritance diagram of autowisp.tests.AutoWISPTestCase

Base class for AutoWISP tests.

_compare_headers(fname1, fname2, header1, header2)[source]

Assert that the two FITS headers match.

Parameters:
  • fname1 (str) – Names of the files (for messages).

  • fname2 (str) – Names of the files (for messages).

  • header1 – The astropy.io.fits.Header objects.

  • header2 – The astropy.io.fits.Header objects.

_test_failed()[source]

Whether this test has just failed or errored.

Read off the result rather than a flag the test sets, so nothing has to be remembered at the end of every test method. Two things make the obvious shortcuts wrong: _outcome.success is still True here (it is reset per test part, and tearDown is its own part), and result.errors / result.failures accumulate over the whole run – so the entries have to be matched against this test rather than merely counted.

Returns:

True if this test recorded a failure or an error.

Return type:

bool

get_inputs(inputs)[source]

Get the input files for the test step and return what to clean up.

preserve_failed_processing = True

Set False by a test that does not want its processing directory kept even when it fails (nothing does at present). Failure is detected from the test result, so a passing test never has to say anything – the previous arrangement, where each test opted in by setting successful_test, silently preserved the directory of every test that forgot to.

preserve_processing_dir = None
run_step(command)[source]

Run a calibration step and check the return code.

setUp()[source]

Make sure the data to compare against is defined.

classmethod set_test_directory(test_dirname, processing_dirname, failed_test_dirname, preserve_processing_dir=None)[source]

Set the directory where data to test against is located.

stage_catalog_cache = True
tearDown()[source]

Remove the processing directory.

Submodules