satpy.tests.test_demo module

Tests for the satpy.demo module.

class satpy.tests.test_demo.TestAHIDemoDownload[source]

Bases: object

Test the AHI demo data download.

test_ahi_full_download()[source]

Test that the himawari download works as expected.

test_ahi_partial_download()[source]

Test that the himawari download works as expected.

class satpy.tests.test_demo.TestDemo(methodName='runTest')[source]

Bases: TestCase

Test demo data download 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 = []
setUp()[source]

Create temporary directory to save files to.

tearDown()[source]

Remove the temporary directory created for a test.

test_get_hurricane_florence_abi(gcsfs_mod)[source]

Test data download function.

test_get_us_midlatitude_cyclone_abi(gcsfs_mod)[source]

Test data download function.

class satpy.tests.test_demo.TestGCPUtils(methodName='runTest')[source]

Bases: TestCase

Test Google Cloud Platform utilities.

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_bucket_files(gcsfs_mod)[source]

Test get_bucket_files basic cases.

test_is_gcp_instance(uo)[source]

Test is_google_cloud_instance.

test_no_gcsfs()[source]

Test that ‘gcsfs’ is required.

class satpy.tests.test_demo.TestSEVIRIHRITDemoDownload(methodName='runTest')[source]

Bases: TestCase

Test case for downloading an hrit tarball.

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.

tearDown()[source]

Tear down the test case.

test_do_not_download_same_file_twice()[source]

Test that files are not downloaded twice.

test_download_a_subset_of_files()[source]

Test downloading a subset of files.

test_download_from_zenodo()[source]

Test downloading SEVIRI HRIT data from zenodo.

test_download_gets_files_with_contents()[source]

Test downloading SEVIRI HRIT data with content.

test_download_to_output_directory()[source]

Test downloading to an output directory.

class satpy.tests.test_demo.TestVIIRSSDRDemoDownload[source]

Bases: object

Test VIIRS SDR downloading.

ALL_BAND_PREFIXES = ('SVI01', 'SVI02', 'SVI03', 'SVI04', 'SVI05', 'SVM01', 'SVM02', 'SVM03', 'SVM04', 'SVM05', 'SVM06', 'SVM07', 'SVM08', 'SVM09', 'SVM10', 'SVM11', 'SVM12', 'SVM13', 'SVM14', 'SVM15', 'SVM16', 'SVDNB')
ALL_GEO_PREFIXES = ('GITCO', 'GMTCO', 'GDNBO')
static _assert_bands_in_filenames(band_prefixes, filenames, num_files_per_band)[source]
_assert_bands_in_filenames_and_contents(band_prefixes, filenames, num_files_per_band)[source]
static _assert_file_contents(filenames)[source]
test_do_not_download_the_files_twice(requests, tmpdir)[source]

Test re-downloading VIIRS SDR data.

test_download(requests, tmpdir)[source]

Test downloading VIIRS SDR data.

test_download_channels_num_granules_dnb(requests, tmpdir)[source]

Test downloading and re-downloading VIIRS SDR DNB data with select granules.

test_download_channels_num_granules_im(requests, tmpdir)[source]

Test downloading VIIRS SDR I/M data with select granules.

test_download_channels_num_granules_im_twice(requests, tmpdir)[source]

Test re-downloading VIIRS SDR I/M data with select granules.

class satpy.tests.test_demo._FakeRequest(url, stream=None, timeout=None)[source]

Bases: object

Fake object to act like a requests return value when downloading a file.

_get_fake_bytesio()[source]
iter_content(chunk_size)[source]

Return generator of ‘chunk_size’ at a time.

raise_for_status()[source]
requests_log: list[str] = []
class satpy.tests.test_demo._GlobHelper(num_results)[source]

Bases: object

Create side effect function for mocking gcsfs glob method.

Initialize side_effect function for mocking gcsfs glob method.

Parameters:

num_results (int or list) – Number of results for each glob call to return. If a list then number of results per call. The last number is used for any additional calls.

satpy.tests.test_demo._create_and_populate_dummy_tarfile(fn)[source]

Populate a dummy tarfile with dummy files.

satpy.tests.test_demo.mock_filesystem()[source]

Create a mock filesystem, patching open and os.path.isfile.

satpy.tests.test_demo.test_fci_download(tmp_path, monkeypatch)[source]

Test download of FCI test data.

satpy.tests.test_demo.test_fs()[source]

Test the mock filesystem.