Skip to content
Snippets Groups Projects
Commit 741b65ad authored by ranchodeluxe's avatar ranchodeluxe
Browse files

update remove static sources

parent d737b7d5
Branches gc/pytest
No related tags found
2 merge requests!70Make it easier to use filepaths as inputs to pipelines,!61Additions: primary keys, speed ups (preprocessing and postprocessing), tests, scalene, reorg entire fireatlas
......@@ -16,22 +16,27 @@ import pytest
],
)
def test_maybe_remove_static_sources(
monkeypatch,
static_source_dir_fake,
original_region: Region,
should_remove_static_sources_bool: bool,
):
# arrange
if not should_remove_static_sources_bool:
FireConsts.remove_static_sources_bool = False
if should_remove_static_sources_bool:
monkeypatch.setattr(FireConsts, 'remove_static_sources_bool', True)
else:
FireConsts.remove_static_sources_bool = True
monkeypatch.setattr(FireConsts, 'remove_static_sources_bool', False)
# act
result_region = maybe_remove_static_sources(original_region, static_source_dir_fake)
# assert
if not should_remove_static_sources_bool:
assert result_region == original_region
assert result_region != original_region
name, geom = result_region
assert isinstance(geom, Polygon)
# make sure there are no interior rings to returned geometry
assert len(geom.interiors) == 0
else:
assert result_region != original_region
name, geom = result_region
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment