Skip to content

Commit

Permalink
fix(integration): Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Dec 16, 2024
1 parent 1f23dd8 commit 823803f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/test_integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@

import xarray as xr
from returns.pipeline import is_successful
from returns.result import ResultE

Check failure on line 6 in src/test_integration/test_integration.py

View workflow job for this annotation

GitHub Actions / lint-typecheck

Ruff (TCH002)

src/test_integration/test_integration.py:6:28: TCH002 Move third-party import `returns.result.ResultE` into a type-checking block

from nwp_consumer.internal import handlers, repositories, services
from nwp_consumer.internal import repositories, services


class TestIntegration(unittest.TestCase):
def test_ceda_metoffice_global_model(self) -> None:
c = handlers.CLIHandler(
consumer_usecase=services.ConsumerService(
model_repository=repositories.model_repositories.CEDAFTPModelRepository,
notification_repository=repositories.notification_repositories.StdoutNotificationRepository,
),
archiver_usecase=services.ArchiverService(
model_repository=repositories.model_repositories.CEDAFTPModelRepository,
notification_repository=repositories.notification_repositories.StdoutNotificationRepository,
),
test_it =dt.datetime(2021, 1, 1, tzinfo=dt.UTC)
service_result = services.ConsumerService.from_adaptors(
model_adaptor=repositories.model_repositories.CEDAFTPModelRepository,
notification_adaptor=repositories.notification_repositories.StdoutNotificationRepository,
)
result: ResultE[str] = service_result.do(
consume_result
for service in service_result
for consume_result in service.consume(period=test_it)
)
result = c._consumer_usecase.consume(it=dt.datetime(2021, 1, 1, tzinfo=dt.UTC))

self.assertTrue(is_successful(result), msg=f"{result}")

da = xr.open_dataarray(result.unwrap(), engine="zarr")

self.assertTrue(da.sizes["init_time"] > 0)

0 comments on commit 823803f

Please sign in to comment.