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.

satpy.tests.test_yaml_reader.GVSYReader()[source]

Get a fixture of the GEOVariableSegmentYAMLReader.

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.

_classSetupFailed = False
_class_cleanups = []
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.

_classSetupFailed = False
_class_cleanups = []
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.

_classSetupFailed = False
_class_cleanups = []
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.

_check_area_for_ch01()[source]
_classSetupFailed = False
_class_cleanups = []
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.

_classSetupFailed = False
_class_cleanups = []
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.

_classSetupFailed = False
_class_cleanups = []
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.

_classSetupFailed = False
_class_cleanups = []
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().

test_segments_sorting(cfh)[source]

Test that segment filehandlers are sorted by segment number.

class satpy.tests.test_yaml_reader.TestGEOVariableSegmentYAMLReader[source]

Bases: object

Test GEOVariableSegmentYAMLReader.

test_get_empty_segment(GVSYReader, fake_mss, fake_xr, fake_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(GVSYReader, fake_adef)[source]

Test _pad_earlier_segments_area() for the variable segment case.

test_pad_later_segments_area(GVSYReader, fake_adef)[source]

Test _pad_later_segments_area() in the variable padding case.

test_pad_later_segments_area_for_multiple_segments_gap(GVSYReader, fake_adef)[source]

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

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.

_classSetupFailed = False
_class_cleanups = []
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._create_mocked_basic_fh()[source]
satpy.tests.test_yaml_reader._create_mocked_fh_and_areadef(aex, ashape, expected_segments, segment, chk_pos_info)[source]
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.fake_adef()[source]

Get a fixture of the patched AreaDefinition.

satpy.tests.test_yaml_reader.fake_geswh()[source]

Get a fixture of the patched _get_empty_segment_with_height.

satpy.tests.test_yaml_reader.fake_mss()[source]

Get a fixture of the patched _find_missing_segments.

satpy.tests.test_yaml_reader.fake_xr()[source]

Get a fixture of the patched xarray.

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

Fake file_type_matches for testing multiple file types.