Skip to content

Commit

Permalink
Test with a real empty directory
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart committed Sep 29, 2023
1 parent 66f2f02 commit 8ec2e93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/datasets/test_agb_live_woody_density.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def test_getitem(self, dataset: AbovegroundLiveWoodyBiomassDensity) -> None:
assert isinstance(x["crs"], CRS)
assert isinstance(x["mask"], torch.Tensor)

def test_no_dataset(self) -> None:
with pytest.raises(RuntimeError, match="Dataset not found in."):
AbovegroundLiveWoodyBiomassDensity("/test")
def test_no_dataset(self, tmp_path: Path) -> None:
with pytest.raises(RuntimeError, match="Dataset not found"):
AbovegroundLiveWoodyBiomassDensity(str(tmp_path))

def test_already_downloaded(
self, dataset: AbovegroundLiveWoodyBiomassDensity
Expand Down
6 changes: 3 additions & 3 deletions tests/datasets/test_cms_mangrove_canopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def test_getitem(self, dataset: CMSGlobalMangroveCanopy) -> None:
assert isinstance(x["crs"], CRS)
assert isinstance(x["mask"], torch.Tensor)

def test_no_dataset(self) -> None:
with pytest.raises(RuntimeError, match="Dataset not found in."):
CMSGlobalMangroveCanopy("/test")
def test_no_dataset(self, tmp_path: Path) -> None:
with pytest.raises(RuntimeError, match="Dataset not found"):
CMSGlobalMangroveCanopy(str(tmp_path))

def test_already_downloaded(self, tmp_path: Path) -> None:
pathname = os.path.join(
Expand Down

0 comments on commit 8ec2e93

Please sign in to comment.