satpy.tests.test_yaml_reader module

Testing the yaml_reader module.

class satpy.tests.test_yaml_reader.DummyReader(filename, filename_info, filetype_info)[source]

Bases: BaseFileHandler

Dummy reader instance.

Initialize the dummy reader.

property end_time

Return end time.

property start_time

Return start time.

class satpy.tests.test_yaml_reader.FakeFH(start_time, end_time)[source]

Bases: BaseFileHandler

Fake file handler class.

Initialize fake file handler.

property end_time

Return end time.

property start_time

Return start time.

class satpy.tests.test_yaml_reader.TestFileFileYAMLReader(methodName='runTest')[source]

Bases: TestCase

Test units from FileYAMLReader.

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.

setUp()[source]

Prepare a reader instance with a fake config.

test_all_data_ids()[source]

Check that all datasets ids are returned.

test_all_dataset_names()[source]

Get all dataset names.

test_available_dataset_ids()[source]

Get ids of the available datasets.

test_available_dataset_names()[source]

Get ids of the available datasets.

test_deprecated_passing_config_files()[source]

Test that we get an exception when config files are passed to inti.

test_file_covers_area(bnd, adb, gad)[source]

Test that area coverage is checked properly.

test_filter_fh_by_time()[source]

Check filtering filehandlers by time.

test_get_coordinates_for_dataset_key()[source]

Test getting coordinates for a key.

test_get_coordinates_for_dataset_key_without()[source]

Test getting coordinates for a key without coordinates.

test_get_coordinates_for_dataset_keys()[source]

Test getting coordinates for keys.

test_get_file_handlers()[source]

Test getting filehandler to load a dataset.

test_load_area_def(sad)[source]

Test loading the area def for the reader.

test_load_entire_dataset(xarray)[source]

Check loading an entire dataset.

test_preferred_filetype()[source]

Test finding the preferred filetype.

test_select_from_directory()[source]

Check select_files_from_directory.

test_select_from_pathnames()[source]

Check select_files_from_pathnames.

test_start_end_time()[source]

Check start and end time behaviours.

test_supports_sensor()[source]

Check supports_sensor.

class satpy.tests.test_yaml_reader.TestFileFileYAMLReaderMultipleFileTypes(methodName='runTest')[source]

Bases: TestCase

Test units from FileYAMLReader with multiple file types.

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.

setUp()[source]

Prepare a reader instance with a fake config.

test_update_ds_ids_from_file_handlers()[source]

Test updating existing dataset IDs with information from the file.

class satpy.tests.test_yaml_reader.TestFileFileYAMLReaderMultiplePatterns(methodName='runTest')[source]

Bases: TestCase

Test units from FileYAMLReader with multiple readers.

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.

setUp()[source]

Prepare a reader instance with a fake config.

test_create_filehandlers()[source]

Check create_filehandlers.

test_fn_items_for_ft()[source]

Check filename_items_for_filetype.

test_select_from_pathnames()[source]

Check select_files_from_pathnames.

test_serializable()[source]

Check that a reader is serializable by dask.

This ensures users are able to serialize a Scene object that contains readers.

class satpy.tests.test_yaml_reader.TestFileYAMLReaderLoading(methodName='runTest')[source]

Bases: TestCase

Tests for FileYAMLReader.load.

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.

setUp()[source]

Prepare a reader instance with a fake config.

test_load_dataset_with_builtin_coords()[source]

Test loading a dataset with builtin coordinates.

test_load_dataset_with_builtin_coords_in_wrong_order()[source]

Test loading a dataset with builtin coordinates in the wrong order.

class satpy.tests.test_yaml_reader.TestFileYAMLReaderWithCustomIDKey(methodName='runTest')[source]

Bases: TestCase

Test units from FileYAMLReader with custom id_keys.

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.

setUp()[source]

Set up the test case.

test_custom_type_with_dict_contents_gets_parsed_correctly()[source]

Test custom type with dictionary contents gets parsed correctly.

class satpy.tests.test_yaml_reader.TestGEOFlippableFileYAMLReader(methodName='runTest')[source]

Bases: TestCase

Test GEOFlippableFileYAMLReader.

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.

test_load_dataset_with_area_for_data_without_area(ldwa)[source]

Test _load_dataset_with_area() for data wihtout area information.

test_load_dataset_with_area_for_single_areas(ldwa)[source]

Test _load_dataset_with_area() for single area definitions.

test_load_dataset_with_area_for_stacked_areas(ldwa)[source]

Test _load_dataset_with_area() for stacked area definitions.

test_load_dataset_with_area_for_swath_def_data(ldwa)[source]

Test _load_dataset_with_area() for swath definition data.

class satpy.tests.test_yaml_reader.TestGEOSegmentYAMLReader(methodName='runTest')[source]

Bases: TestCase

Test GEOSegmentYAMLReader.

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.

test_find_missing_segments()[source]

Test _find_missing_segments().

test_get_expected_segments(cfh)[source]

Test that expected segments can come from the filename.

test_load_area_def(pesa, plsa, sad, parent_load_area_def)[source]

Test _load_area_def().

test_load_dataset(mss, xr, parent_load_dataset)[source]

Test _load_dataset().

test_pad_earlier_segments_area(AreaDefinition)[source]

Test _pad_earlier_segments_area().

test_pad_later_segments_area(AreaDefinition)[source]

Test _pad_later_segments_area().

class satpy.tests.test_yaml_reader.TestGEOVariableSegmentYAMLReader(methodName='runTest')[source]

Bases: TestCase

Test GEOVariableSegmentYAMLReader.

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.

test_get_empty_segment(mss, xr, geswh)[source]

Test execution of (overridden) get_empty_segment inside _load_dataset.

test_get_empty_segment_with_height()[source]

Test _get_empty_segment_with_height().

test_pad_earlier_segments_area(AreaDefinition)[source]

Test _pad_earlier_segments_area() for the variable segment case.

test_pad_later_segments_area(AreaDefinition)[source]

Test _pad_later_segments_area() in the variable padding case.

test_pad_later_segments_area_for_multiple_chunks_gap(AreaDefinition)[source]

Test _pad_later_segments_area() in the variable padding case for multiple gaps with multiple chunks.

class satpy.tests.test_yaml_reader.TestUtils(methodName='runTest')[source]

Bases: TestCase

Test the utility functions.

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.

test_get_filebase()[source]

Check the get_filebase function.

test_listify_string()[source]

Check listify_string.

test_match_filenames()[source]

Check that matching filenames works.

test_match_filenames_windows_forward_slash()[source]

Check that matching filenames works on Windows with forward slashes.

This is common from Qt5 which internally uses forward slashes everywhere.

satpy.tests.test_yaml_reader.available_datasets(self, configured_datasets=None)[source]

Fake available_datasets for testing multiple file types.

satpy.tests.test_yaml_reader.file_type_matches(self, ds_ftype)[source]

Fake file_type_matches for testing multiple file types.