tests¶
test_api_views.py¶
Tests for the api_views
module in the jwql
web application.
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_api_views.py
test_bad_pixel_monitor.py¶
Tests for the bad pixel monitor module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_badpix_monitor.py
- jwql.tests.test_bad_pixel_monitor.test_bad_map_to_list()[source]¶
Check that bad pixel locations are correctly retrieved from an image
- jwql.tests.test_bad_pixel_monitor.test_check_for_sufficient_files()[source]¶
Be sure that the file threshold values are being used correctly
- jwql.tests.test_bad_pixel_monitor.test_exclude_crds_mask_pix()[source]¶
Test that bad pixel images are differentiated correctly
- jwql.tests.test_bad_pixel_monitor.test_filter_query_results()[source]¶
Test MAST query filtering to extract most common filter/pupil and acceptable readout patterns
- jwql.tests.test_bad_pixel_monitor.test_get_possible_apertures(instrument, expected_list)[source]¶
Make sure the correct apertures are returned for the given instrument
- jwql.tests.test_bad_pixel_monitor.test_identify_tables()[source]¶
Be sure the correct database tables are identified
- jwql.tests.test_bad_pixel_monitor.test_locate_rate_files()[source]¶
Test that rate files are found in filesystem
test_bias_monitor.py¶
Tests for the bias_monitor
module.
Authors¶
Ben Sunnquist
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_bias_monitor.py
- jwql.tests.test_bias_monitor.test_collapse_image()[source]¶
Test that the image is collapsed correctly along its axes
- jwql.tests.test_bias_monitor.test_extract_zeroth_group()[source]¶
Test the zeroth group file creation
- jwql.tests.test_bias_monitor.test_get_amp_medians()[source]¶
Test that the amp medians are calculated correctly
test_calculations.py¶
Tests for the calculations
module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_calculations.py
- jwql.tests.test_calculations.test_double_gaussian_fit()[source]¶
Test the double Gaussian fitting function
test_dark_monitor.py¶
Tests for the dark_monitor
module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_dark_monitor.py
- jwql.tests.test_dark_monitor.test_get_metadata()[source]¶
Test retrieval of metadata from input file
- jwql.tests.test_dark_monitor.test_mast_query_darks()[source]¶
Test that the MAST query for darks is functional
- jwql.tests.test_dark_monitor.test_noise_check()[source]¶
Test the search for noisier than average pixels
test_data_containers.py¶
Tests for the data_containers
module in the jwql
web
application.
Authors¶
Matthew Bourque
Mees Fix
Bryan Hilbert
Bradley Sappington
Melanie Clarke
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_data_containers.py
- jwql.tests.test_data_containers.test_get_acknowledgements()[source]¶
Tests the
get_acknowledgements
function.
- jwql.tests.test_data_containers.test_get_additional_exposure_info()[source]¶
Tests
get_additional_exposure_info
function.
- jwql.tests.test_data_containers.test_get_all_proposals()[source]¶
Tests the
get_all_proposals
function.
- jwql.tests.test_data_containers.test_get_available_suffixes(untracked, input_suffixes, expected)[source]¶
- jwql.tests.test_data_containers.test_get_expstart(inst, fileroot, value)[source]¶
Tests the
get_expstart
function.
- jwql.tests.test_data_containers.test_get_filenames_by_instrument()[source]¶
Tests the
get_filenames_by_instrument
function.
- jwql.tests.test_data_containers.test_get_filenames_by_proposal()[source]¶
Tests the
get_filenames_by_proposal
function.
- jwql.tests.test_data_containers.test_get_filenames_by_rootname()[source]¶
Tests the
get_filenames_by_rootname
function.
- jwql.tests.test_data_containers.test_get_filesystem_filenames(pid, rname, success)[source]¶
Tests the
get_filesystem_filenames
function.
- jwql.tests.test_data_containers.test_get_filesystem_filenames_options()[source]¶
Tests the
get_filesystem_filenames
function.
- jwql.tests.test_data_containers.test_get_instrument_looks(keys, viewed, sort_as, exp_type, cat_type)[source]¶
Tests the
get_instrument_looks
function.
- jwql.tests.test_data_containers.test_get_instrument_proposals()[source]¶
Tests the
get_instrument_proposals
function.
- jwql.tests.test_data_containers.test_get_preview_images_by_proposal()[source]¶
Tests the
get_preview_images_by_proposal
function.
- jwql.tests.test_data_containers.test_get_preview_images_by_rootname()[source]¶
Tests the
get_preview_images_by_rootname
function.
- jwql.tests.test_data_containers.test_get_proposal_info()[source]¶
Tests the
get_proposal_info
function.
- jwql.tests.test_data_containers.test_get_proposals_by_category()[source]¶
Tests the
get_proposals_by_category
function.
- jwql.tests.test_data_containers.test_get_thumbnail_by_rootname()[source]¶
Tests the
get_thumbnail_by_rootname
function.
- jwql.tests.test_data_containers.test_get_thumbnails_by_proposal()[source]¶
Tests the
get_thumbnails_by_proposal
function.
test_database_interface.py¶
Tests for the database_interface.py
module.
Authors¶
Joe Filippazzo
Matthew Bourque
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s database_interface.py
- jwql.tests.test_database_interface.test_all_tables_exist()[source]¶
Test that the table ORMs defined in
database_interface
actually exist as tables in the database
- jwql.tests.test_database_interface.test_anomaly_orm_factory()[source]¶
Test that the
anomaly_orm_factory
function successfully creates an ORM and contains the appropriate columns
- jwql.tests.test_database_interface.test_anomaly_records()[source]¶
Test to see that new records can be entered
test_edb.py¶
Tests for the engineering_database
module.
Authors¶
Johannes Sahlmann
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output tostdout
):pytest -s test_edb.py
- jwql.tests.test_edb.test_add()[source]¶
Test addition (i.e. concatenation) of two EdbMnemonic objects
- jwql.tests.test_edb.test_change_only_bounding_points()[source]¶
Make sure we correctly add starting and ending time entries to a set of change-only data
- jwql.tests.test_edb.test_daily_stats()[source]¶
Test that the daily statistics are calculated correctly
- jwql.tests.test_edb.test_full_stats()[source]¶
Test that the statistics calculated over the entire data set are correct
test_edb_telemetry_monitor.py¶
Tests for the EDB telemetry
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_edb_telemetry_monitor.py
- jwql.tests.test_edb_telemetry_monitor.test_add_every_change_history()[source]¶
Test that every_change data is correctly combined with an existing set of every_change data
- jwql.tests.test_edb_telemetry_monitor.test_change_only_add_points()[source]¶
Make sure we convert change-only data to AllPoints data correctly
- jwql.tests.test_edb_telemetry_monitor.test_conditions()[source]¶
Test the extraction of data using the
`equal`
class.
- jwql.tests.test_edb_telemetry_monitor.test_get_averaging_time_duration()[source]¶
Test that only allowed string formats are used for averaging time duration
- jwql.tests.test_edb_telemetry_monitor.test_get_query_duration()[source]¶
Test that the correct query duration is found
- jwql.tests.test_edb_telemetry_monitor.test_multiple_conditions()[source]¶
Test that filtering using multiple conditions is working as expected.
test_instrument_properties.py¶
Tests for the instrument_properties
module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_instrument_properties.py
test_loading_times.py¶
Tests various webpages of the jwql
web application to make sure
that loading times are not too long
Authors¶
Matthew Bourque
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_loading_times.py
test_logging_functions.py¶
Tests for the logging_functions
module.
Authors¶
Matthew Bourque
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_logging_functions.py
- jwql.tests.test_logging_functions.perform_basic_logging()[source]¶
Performs some basic logging to the test log file
- jwql.tests.test_logging_functions.test_configure_logging()[source]¶
Assert that the
configure_logging
function successfully creates a log file
test_mast_utils.py¶
Tests for the mast_utils
module.
Authors¶
Joe Filippazzo
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_mast_utils.py
- jwql.tests.test_mast_utils.test_astroquery_mast()[source]¶
Test if the astroquery.mast service can complete a request
- jwql.tests.test_mast_utils.test_caom_instrument_keywords()[source]¶
Test to see that the CAOM keywords are the same for all instruments
- jwql.tests.test_mast_utils.test_filtered_instrument_keywords()[source]¶
Test to see that the instrument specific service keywords are different for all instruments
test_permissions.py¶
Tests for the permissions
module.
Authors¶
Johannes Sahlmann
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output tostdout
):pytest -s test_permissions.py
- jwql.tests.test_permissions.test_directory(test_dir='/home/docs/permission_test')[source]¶
Create a test directory for permission management.
- Parameters:
- test_dirstr
Path to directory used for testing
- Yields:
- test_dirstr
Path to directory used for testing
- jwql.tests.test_permissions.test_directory_permissions(test_directory)[source]¶
Create a directory with the standard permissions
('-rw-r--r--')
.Set the default permissions defined in
permissions.py
. Assert that these were set correctly.- Parameters:
- test_directorystr
Path of directory used for testing
- jwql.tests.test_permissions.test_file(test_dir='/home/docs/permission_test')[source]¶
Create a test file for permission management.
- Parameters:
- test_dirstr
Path to directory used for testing
- Yields:
- filenamestr
Path of file used for testing
- jwql.tests.test_permissions.test_file_group(test_file)[source]¶
Create a file with the standard permissions
('-rw-r--r--')
and default group.Modify the group and set the default permissions defined in
permissions.py
. Assert that both group and permissions were set correctly.- Parameters:
- test_filestr
Path of file used for testing
test_pipeline_tools.py¶
Tests for the pipeline_tools
module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_pipeline_tools.py
- jwql.tests.test_pipeline_tools.test_completed_pipeline_steps()[source]¶
Test that the list of completed pipeline steps for a file is correct
- Parameters:
- filenamestr
File to be checked
- jwql.tests.test_pipeline_tools.test_get_pipeline_steps()[source]¶
Test that the proper pipeline steps are returned for an instrument
- jwql.tests.test_pipeline_tools.test_steps_to_run()[source]¶
Test that the dictionaries for steps required and steps completed are correctly combined to create a dictionary of pipeline steps to be done
- Parameters:
- filenamestr
File to be checked
- requiredOrderedDict
Dict of all pipeline steps to be run on filename
- already_doneOrderedDict
Dict of pipeline steps already run on filename
test_plotting.py¶
Tests for the plotting
module.
Authors¶
Joe Filippazzo
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_plotting.py
test_preview_image.py¶
Tests for the preview_image
module.
Authors¶
Johannes Sahlmann
Lauren Chambers
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output tostdout
):pytest -s test_preview_image.py
- jwql.tests.test_preview_image.get_test_fits_files()[source]¶
Get a list of the FITS files on central storage to make preview images.
- Returns:
- filenameslist
List of filepaths to FITS files
- jwql.tests.test_preview_image.test_crop_to_subarray()[source]¶
Test that the code correctly crops larger arrays down to the requested subarray
- jwql.tests.test_preview_image.test_get_nonsci_map()[source]¶
Test the retrieval of the dq data from an HDUList
- jwql.tests.test_preview_image.test_make_image(tmp_path, filename)[source]¶
Use PreviewImage.make_image to create preview images of a sample JWST exposure.
Assert that the number of JPGs created corresponds to the number of integrations.
- Parameters:
- tmp_pathpathlib.Path
Temporary directory to write to
- filenamestr
Path of FITS image to generate preview of
test_readnoise_monitor.py¶
Tests for the readnoise_monitor
module.
Authors¶
Ben Sunnquist
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output to stdout):pytest -s test_readnoise_monitor.py
- jwql.tests.test_readnoise_monitor.test_determine_pipeline_steps()[source]¶
Test the correct pipeline steps are called
- jwql.tests.test_readnoise_monitor.test_get_metadata()[source]¶
Test retrieval of metadata from input file
- jwql.tests.test_readnoise_monitor.test_identify_tables()[source]¶
Be sure the correct database tables are identified
test_setup.py¶
Tests for the setup.py
module.
Authors¶
Bryan Hilbert
Use¶
These tests can be run via the command line (omit the
-s
to suppress verbose output tostdout
):pytest -s test_setup_info.py
test_utils.py¶
Tests for the utils
module.
Authors¶
Lauren Chambers
Matthew Bourque
Use¶
These tests can be run via the command line (omit the -s to suppress verbose output to stdout):
pytest -s test_utils.py
- jwql.tests.test_utils.test_filename_parser(filename, solution)[source]¶
Generate a dictionary with parameters from a JWST filename. Assert that the dictionary matches what is expected.
- Parameters:
- filenamestr
The filename to test (e.g.
jw00327001001_02101_00002_nrca1_rate.fits
)- solutiondict
A dictionary of the expected result
- jwql.tests.test_utils.test_filename_parser_non_jwst()[source]¶
Attempt to generate a file parameter dictionary from a file that is not formatted in the JWST naming convention. Ensure the appropriate error is raised.
- jwql.tests.test_utils.test_filename_parser_whole_filesystem()[source]¶
Test the filename_parser on all files currently in the filesystem.
- jwql.tests.test_utils.test_filesystem_path()[source]¶
Test that a file’s location in the filesystem is returned