satpy.tests.test_readers module
Test classes and functions in the readers/__init__.py module.
- class satpy.tests.test_readers.TestDatasetDict(methodName='runTest')[source]
Bases:
TestCase
Test DatasetDict and its methods.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- _classSetupFailed = False
- _class_cleanups = []
- class satpy.tests.test_readers.TestFSFile[source]
Bases:
object
Test the FSFile class.
- test_equality(local_filename, local_filename2, local_zip_file)[source]
Test that FSFile compares equal when it should.
- test_fsfile_with_fs_open_file_abides_pathlike(local_file, random_string)[source]
Test that FSFile abides PathLike for fsspec OpenFile instances.
- test_fsfile_with_regular_filename_abides_pathlike(random_string)[source]
Test that FSFile abides PathLike for regular filenames.
- test_fsfile_with_regular_filename_and_fs_spec_abides_pathlike(random_string)[source]
Test that FSFile abides PathLike for filename+fs instances.
- test_hash(local_filename, local_filename2, local_zip_file)[source]
Test that FSFile hashing behaves sanely.
- test_open_zip_fs_regular_filename(local_filename2, local_zip_file)[source]
Test opening a zipfs with a regular filename provided.
- class satpy.tests.test_readers.TestFindFilesAndReaders[source]
Bases:
object
Test the find_files_and_readers utility function.
- test_no_parameters_both_atms_and_viirs(viirs_file, atms_file)[source]
Test with no limiting parameters when there area both atms and viirs files in the same directory.
- test_pending_old_reader_name_mapping()[source]
Test that requesting pending old reader names raises a warning.
- test_reader_name_matched_end_time(viirs_file)[source]
Test with end matching the filename.
End time in the middle of the file time should still match the file.
- test_reader_name_matched_start_end_time(viirs_file)[source]
Test with start and end time matching the filename.
- test_reader_name_matched_start_time(viirs_file)[source]
Test with start matching the filename.
Start time in the middle of the file time should still match the file.
- test_reader_name_unmatched_start_end_time(viirs_file)[source]
Test with start and end time matching the filename.
- class satpy.tests.test_readers.TestGroupFiles(methodName='runTest')[source]
Bases:
TestCase
Test the ‘group_files’ utility function.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- _classSetupFailed = False
- _class_cleanups = []
- _filenames_abi_glm = ['OR_ABI-L1b-RadF-M6C14_G16_s19000010000000_e19000010005000_c20403662359590.nc', 'OR_ABI-L1b-RadF-M6C14_G16_s19000010010000_e19000010015000_c20403662359590.nc', 'OR_ABI-L1b-RadF-M6C14_G16_s19000010020000_e19000010025000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010000000_e19000010001000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010001000_e19000010002000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010002000_e19000010003000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010003000_e19000010004000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010004000_e19000010005000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010005000_e19000010006000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010006000_e19000010007000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010007000_e19000010008000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010008000_e19000010009000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010009000_e19000010010000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010010000_e19000010011000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010011000_e19000010012000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010012000_e19000010013000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010013000_e19000010014000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010014000_e19000010015000_c20403662359590.nc', 'OR_GLM-L2-GLMF-M3_G16_s19000010015000_e19000010016000_c20403662359590.nc']
- test_large_time_threshold()[source]
Test what happens when the time threshold holds multiple files.
- test_multi_readers_empty_groups_missing_skip()[source]
Verify empty groups are skipped.
Verify that all groups lacking ABI are skipped, resulting in only three groups that are all non-empty for both instruments.
- test_multi_readers_empty_groups_passed()[source]
Verify that all groups are there, resulting in some that are empty.
- test_multi_readers_empty_groups_raises_filenotfounderror()[source]
Test behaviour on empty groups passing multiple readers.
Make sure it raises an exception, for there will be groups containing GLM but not ABI.
- test_multi_readers_invalid_parameter()[source]
Verify that invalid missing parameter raises ValueError.
- test_non_datetime_group_key()[source]
Test what happens when the start_time isn’t used for grouping.
- test_two_instruments_files()[source]
Test the behavior when two instruments files are provided.
This is undesired from a user point of view since we don’t want G16 and G17 files in the same Scene. Readers (like abi_l1b) are or can be configured to have specific group keys for handling these situations. Due to that this test forces the fallback group keys of (‘start_time’,).
- class satpy.tests.test_readers.TestReaderLoader(methodName='runTest')[source]
Bases:
TestCase
Test the load_readers function.
Assumes that the VIIRS SDR reader exists and works.
Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.
- _classSetupFailed = False
- _class_cleanups = []
- test_empty_filenames_as_dict()[source]
Test passing filenames as a dictionary with an empty list of filenames.
- test_filenames_as_dict_bad_reader()[source]
Test loading with filenames dict but one of the readers is bad.
- test_filenames_as_dict_with_reader()[source]
Test loading from a filenames dict with a single reader specified.
This can happen in the deprecated Scene behavior of passing a reader and a base_dir.
- class satpy.tests.test_readers.TestYAMLFiles[source]
Bases:
object
Test and analyze the reader configuration files.
- satpy.tests.test_readers.local_filename(tmp_path_factory, random_string)[source]
Create simple on-disk file.
- satpy.tests.test_readers.local_hdf5_fsspec(local_hdf5_filename)[source]
Get fsspec OpenFile pointing to local HDF5 file.
- satpy.tests.test_readers.local_hdf5_path(local_hdf5_filename)[source]
Get Path object pointing to local HDF5 file.
- satpy.tests.test_readers.local_netcdf_filename(tmp_path_factory)[source]
Create a simple local NetCDF file.
- satpy.tests.test_readers.local_netcdf_fsfile(local_netcdf_fsspec)[source]
Get FSFile object wrapping an fsspec OpenFile pointing to local netcdf file.
- satpy.tests.test_readers.local_netcdf_fsspec(local_netcdf_filename)[source]
Get fsspec OpenFile object pointing to local netcdf file.
- satpy.tests.test_readers.local_netcdf_path(local_netcdf_filename)[source]
Get Path object pointing to local netcdf file.
- satpy.tests.test_readers.local_zip_file(local_filename2)[source]
Create local zip file containing one local file.