Skip to content

Commit

Permalink
fix(ecmwf-s3): Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc committed Oct 22, 2024
1 parent 657f0a9 commit 964c4d0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/nwp_consumer/internal/inputs/ecmwf/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ def tearDownClass(cls) -> None:

def test_listFilesForInitTime(self) -> None:
files = [
"A1D01010000010100001",
"A1D01010000010101001",
"A1D01010000010102011",
"A1D01010000010103001",
"A1D01011200010112001", # Different init time
"A1D02191200010112001", # Leap year on 2024-02-29
"A2D01010000010100001",
"A2D01010000010101001",
"A2D01010000010102011",
"A2D01010000010103001",
"A2D01011200010112001", # Different init time
"A2D02191200010112001", # Leap year on 2024-02-29
]
for file in files:
# Create files in the mock bucket
Expand All @@ -97,12 +97,12 @@ def test_downloadRawFile(self) -> None:
# Create a file in the mock bucket
self.testS3.put_object(
Bucket=BUCKET,
Key=(RAW / "A1D01010000010100001").as_posix(),
Key=(RAW / "A2D01010000010100001").as_posix(),
Body=b"test",
)

# Test the downloadRawFile method
out = self.client.downloadToCache(fi=ECMWFLiveFileInfo(fname="A1D01010000010100001"))
out = self.client.downloadToCache(fi=ECMWFLiveFileInfo(fname="A2D01010000010100001"))
self.assertEqual(out.read_bytes(), b"test")

out.unlink()
Expand Down

0 comments on commit 964c4d0

Please sign in to comment.