-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ClimeTrend/validation-filtering
Add 2-weekly slicing for 2022
- Loading branch information
Showing
4 changed files
with
264 additions
and
97 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import os | ||
|
||
import pytest | ||
from typer.testing import CliRunner | ||
|
||
from cloudcasting.cli import app | ||
|
||
|
||
@pytest.fixture() | ||
def runner(): | ||
return CliRunner() | ||
|
||
|
||
@pytest.fixture() | ||
def temp_output_dir(tmp_path): | ||
return str(tmp_path) | ||
|
||
|
||
def test_download_satellite_data(runner, temp_output_dir): | ||
# Define test parameters | ||
start_date = "2023-01-01 00:00" | ||
end_date = "2023-01-01 00:30" | ||
|
||
# Run the CLI command to download the file | ||
result = runner.invoke( | ||
app, | ||
[ | ||
"download", | ||
start_date, | ||
end_date, | ||
temp_output_dir, | ||
"--download-frequency=15min", | ||
"--lon-min=-16", | ||
"--lon-max=10", | ||
"--lat-min=45", | ||
"--lat-max=70", | ||
], | ||
) | ||
|
||
# Check if the command executed successfully | ||
assert result.exit_code == 0 | ||
|
||
# Check if the output file was created | ||
expected_file = os.path.join(temp_output_dir, "2023_training_nonhrv.zarr") | ||
assert os.path.exists(expected_file) |
Oops, something went wrong.