Skip to content

Commit

Permalink
Fix tests: remove useless folders created during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GratienDSX committed Jan 9, 2025
1 parent 6f314ae commit 5d8b440
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/test_forecasts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import unittest
from pathlib import Path
from unittest.mock import MagicMock, patch
Expand Down Expand Up @@ -169,20 +170,20 @@ def test_get_coverage_file(self, mock_get_request, mock_get_capabilities):
)

coverage_id = "coverage_1"
forecast._get_coverage_file(
path = forecast._get_coverage_file(
coverage_id=coverage_id,
height=2,
forecast_horizon_in_seconds=0,
lat=(37.5, 55.4),
long=(-12, 16),
)

import os

expected_path = Path(os.getcwd()) / coverage_id / "2m_0Z_37.5-55.4_-12-16.grib"
self.assertTrue(expected_path.exists())
self.assertTrue(expected_path == path)

expected_path.unlink()
# remove the folder created in _get_coverage_file
forecast._remove_coverage_files(path)

@patch("meteole._arome.AromeForecast.get_capabilities")
@patch("meteole._arome.AromeForecast._transform_grib_to_df")
Expand Down

0 comments on commit 5d8b440

Please sign in to comment.