satpy.tests.test_utils module

Testing of utils.

class satpy.tests.test_utils.TestCheckSatpy(methodName='runTest')[source]

Bases: TestCase

Test the ‘check_satpy’ 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 = []
test_basic_check_satpy()[source]

Test ‘check_satpy’ basic functionality.

test_specific_check_satpy()[source]

Test ‘check_satpy’ with specific features provided.

class satpy.tests.test_utils.TestGeoUtils[source]

Bases: object

Testing geo-related utility functions.

test_angle2xyz(azizen, xyz)[source]

Test the angle2xyz function.

test_lonlat2xyz(lonlat, xyz)[source]

Test the lonlat2xyz function.

test_proj_units_to_meters(prj, exp_prj)[source]

Test proj units to meters conversion.

test_xyz2angle(xyz, acos, azizen)[source]

Test xyz2angle.

test_xyz2lonlat(xyz, asin, lonlat)[source]

Test xyz2lonlat.

class satpy.tests.test_utils.TestGetSatPos[source]

Bases: object

Tests for ‘get_satpos’.

test_get_satpos(included_prefixes, preference, expected_result)[source]

Test getting the satellite position.

test_get_satpos_fails_with_informative_error(attrs)[source]

Test that get_satpos raises an informative error message.

test_get_satpos_from_satname(caplog)[source]

Test getting satellite position from satellite name only.

satpy.tests.test_utils._data_arrays_from_params(shapes: list[tuple[int, ...]], chunks: list[tuple[int, ...]], dims: list[tuple[int, ...]]) Generator[DataArray, None, None][source]
satpy.tests.test_utils._verify_unchanged_chunks(data_arrays: list[DataArray], orig_arrays: list[DataArray]) None[source]
satpy.tests.test_utils._verify_unified(data_arrays: list[DataArray]) None[source]
satpy.tests.test_utils.test_chunk_size_limit()[source]

Check the chunk size limit computations.

satpy.tests.test_utils.test_chunk_size_limit_from_dask_config()[source]

Check the chunk size limit computations.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_filename_dict()[source]

Test convertion of remote files to fsspec objects.

Case where filenames is a dictionary mapping readers and filenames.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_fsfile()[source]

Test convertion of remote files to fsspec objects.

Case where the some of the files are already FSFile objects.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_local_files()[source]

Test convertion of remote files to fsspec objects.

Case without scheme/protocol, which should default to plain filenames.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_local_pathlib_files()[source]

Test convertion of remote files to fsspec objects.

Case using pathlib objects as filenames.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_mixed_sources()[source]

Test convertion of remote files to fsspec objects.

Case with mixed local and remote files.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_storage_options(open_files)[source]

Test convertion of remote files to fsspec objects.

Case with storage options given.

satpy.tests.test_utils.test_convert_remote_files_to_fsspec_windows_paths()[source]

Test convertion of remote files to fsspec objects.

Case where windows paths are used.

satpy.tests.test_utils.test_debug_on(caplog)[source]

Test that debug_on is working as expected.

satpy.tests.test_utils.test_find_in_ancillary()[source]

Test finding a dataset in ancillary variables.

satpy.tests.test_utils.test_get_legacy_chunk_size()[source]

Test getting the legacy chunk size.

satpy.tests.test_utils.test_import_error_helper()[source]

Test the import error helper.

satpy.tests.test_utils.test_logging_on_and_off(caplog)[source]

Test that switching logging on and off works.

satpy.tests.test_utils.test_make_fake_scene()[source]

Test the make_fake_scene utility.

Although the make_fake_scene utility is for internal testing purposes, it has grown sufficiently complex that it needs its own testing.

satpy.tests.test_utils.test_resolution_chunking(chunks, shape, previous_chunks, lr_mult, chunk_dtype, exp_result)[source]

Test normalize_low_res_chunks helper function.

satpy.tests.test_utils.test_unify_chunks(shapes, chunks, dims, exp_unified)[source]

Test unify_chunks utility function.