-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e31a30
commit 8e9a503
Showing
6 changed files
with
87 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ members = [ | |
] | ||
|
||
[workspace.package] | ||
version = "0.7.2" | ||
version = "0.7.3" | ||
authors = [ | ||
"Jesse Rubin <[email protected]>", | ||
"Dan Costello <[email protected]>", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""Utiles rust cli rimraf tests""" | ||
|
||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
from utiles.dev.testing import run_cli as _run_cli | ||
|
||
|
||
def _osm_standard_z0z4_mbtiles(test_data: Path) -> Path: | ||
return test_data / "mbtiles" / "osm-standard.z0z4.mbtiles" | ||
|
||
|
||
def _all_filepaths(dirpath: Path) -> list[str]: | ||
return [str(f) for f in dirpath.rglob("*") if f.is_file()] | ||
|
||
|
||
class TestRimraf: | ||
def test_mbtiles2pyramid(self, tmp_path: Path, test_data_root: Path) -> None: | ||
_mbtiles_filepath = _osm_standard_z0z4_mbtiles(test_data_root) | ||
out_path = tmp_path / "osm-pyramid" | ||
# copy mbtiles to tile pyramid | ||
result = _run_cli(["cp", str(_mbtiles_filepath), str(out_path)]) | ||
assert result.returncode == 0 | ||
assert out_path.exists() | ||
assert out_path.is_dir() | ||
assert len(_all_filepaths(out_path)) > 0 | ||
all_paths = _all_filepaths(out_path) | ||
png_paths = [p for p in all_paths if p.endswith(".png")] | ||
assert len(png_paths) > 0 | ||
assert len(png_paths) == 341 | ||
|
||
# nuke the dir with rimrafer | ||
result = _run_cli(["rimraf", str(out_path)]) | ||
|
||
assert result.returncode == 0 | ||
|
||
assert not out_path.exists() |