Skip to content

Commit 38b5bdb

Browse files
committed
Add test to check that FileNotFoundError is raised when file is missing
1 parent 7684657 commit 38b5bdb

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

python/tests/test_cog.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import async_tiff
22
from time import time
3+
4+
import pytest
5+
36
from async_tiff import TIFF
4-
from async_tiff.store import S3Store
7+
from async_tiff.store import LocalStore, S3Store
58

69
store = S3Store("sentinel-cogs", region="us-west-2", skip_signature=True)
710
path = "sentinel-s2-l2a-cogs/12/S/UF/2022/6/S2B_12SUF_20220609_0_L2A/B04.tif"
@@ -25,3 +28,12 @@
2528
gkd.citation
2629

2730
dir(gkd)
31+
32+
33+
async def test_cog_missing_file():
34+
"""
35+
Ensure that a FileNotFoundError is raised when passing in a missing file.
36+
"""
37+
store = LocalStore()
38+
with pytest.raises(FileNotFoundError):
39+
await TIFF.open(path="imaginary_file.tif", store=store)

0 commit comments

Comments
 (0)