pytest_gee.plugin#
A pytest plugin to build a GEE environment for a test session.
Functions#
|
Fixture to test ee.Dictionary objects. |
|
Fixture to test |
|
Fixture to test |
|
Fixture to test |
Link to the root folder of the connected account. |
|
The structure of the generated test folder. |
|
|
Generate a unique hash for the test session. |
|
Create a test folder for the duration of the test session. |
Module Contents#
- pytest_gee.plugin.ee_dictionary_regression(datadir, original_datadir, request)[source]#
Fixture to test ee.Dictionary objects.
- Parameters:
datadir (pathlib.Path) – The directory where the data files are stored.
original_datadir (pathlib.Path) – The original data directory.
request (pytest.FixtureRequest) – The pytest request object.
- Returns:
The DictionaryFixture object.
- Return type:
Example
def test_dictionary_regression(dictionary_regression): data = ee.Dictionary({"a": 1, "b": 2}) dictionary_regression.check(data)
- pytest_gee.plugin.ee_feature_collection_regression(datadir, original_datadir, request)[source]#
Fixture to test
ee.FeatureCollectionobjects.- Parameters:
datadir (pathlib.Path) – The directory where the data files are stored.
original_datadir (pathlib.Path) – The original data directory.
request (pytest.FixtureRequest) – The pytest request object.
- Returns:
The FeatureCollectionFixture object.
- Return type:
pytest_gee.feature_collection_regression.FeatureCollectionFixture
Example
def test_feature_collection_regression(feature_collection_regression): data = ee.FeatureCollection("FAO/GAUL/2015/level0").filter(ee.Filter.eq("ADM0_NAME", "Holy See")) feature_collection_regression.check(data)
- pytest_gee.plugin.ee_image_regression(datadir, original_datadir, request)[source]#
Fixture to test
ee.Imageobjects.- Parameters:
datadir (pathlib.Path) – The directory where the data files are stored.
original_datadir (pathlib.Path) – The original data directory.
request (pytest.FixtureRequest) – The pytest request object.
- Returns:
The ImageFixture object.
- Return type:
Example
def test_image_regression(image_regression): data = ee.Image("LANDSAT/LC08/C02/T1_L2/LC08_191031_20210514") image_regression.check(data, scale=1000)
- pytest_gee.plugin.ee_list_regression(datadir, original_datadir, request)[source]#
Fixture to test
ee.Listobjects.- Parameters:
datadir (pathlib.Path) – The directory where the data files are stored.
original_datadir (pathlib.Path) – The original data directory.
request (pytest.FixtureRequest) – The pytest request object.
- Returns:
The ListFixture object.
- Return type:
Example
def test_list_regression(list_regression): data = ee.List([1, 2, 3]) list_regression.check(data)