-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a mechanism to create folders in the user account (#8)
- Loading branch information
Showing
6 changed files
with
411 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
"""A pytest plugin to build a GEE environment for a test session.""" | ||
from __future__ import annotations | ||
|
||
import uuid | ||
from pathlib import Path | ||
|
||
import ee | ||
import pytest | ||
|
||
from . import utils | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def gee_hash(): | ||
"""Generate a unique hash for the test session.""" | ||
return uuid.uuid4().hex | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def gee_folder_root(): | ||
"""Link to the root folder of the connected account.""" | ||
return Path(ee.data.getAssetRoots()[0]["id"]) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def gee_folder_structure(): | ||
"""The structure of the generated test folder.""" | ||
return {} | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def gee_test_folder(gee_hash, gee_folder_root, gee_folder_structure): | ||
"""Create a test folder for the duration of the test session.""" | ||
folder = utils.init_tree(gee_folder_structure, gee_hash, gee_folder_root) | ||
|
||
yield folder | ||
|
||
utils.delete_assets(folder, False) |
Oops, something went wrong.