def test__load_grid_geojson_old_file(stat_mock, tmp_path): return_timestamp = MagicMock() return_timestamp.st_mtime = (datetime.utcnow() - timedelta(days=2)).timestamp() stat_mock.return_value = return_timestamp tmp_path.joinpath("files.geojson").touch() grids = _load_grid_geojson(target_directory=tmp_path) assert sorted(grids) == ["features", "name", "type"]
def test_sync_download__directory( load_grid_geojson_mock, download_mock, parse_args_mock ): load_grid_geojson_mock.return_value = _load_grid_geojson() main() download_mock.assert_called_with( directory="test_directory", file_url="https://cdn.proj.org/fr_ign_ntf_r93.tif", sha256="0aa738b3e00fd2d64f8e3cd0e76034d4792374624fa0e133922433c9491bbf2a", short_name="fr_ign_ntf_r93.tif", verbose=True, ) load_grid_geojson_mock.assert_called_with(target_directory="test_directory")