Skip to content

Commit

Permalink
Issue #604/#644 test coverage for resuming: also parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Oct 11, 2024
1 parent 5b1e8fa commit fd9fdb8
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/extra/test_job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,15 @@ def test_with_job_manager_remote_geometry(self, tmp_path, requests_mock, dummy_b
},
}

def test_with_job_manager_remote_geometry_with_csv_persistence(
self, tmp_path, requests_mock, dummy_backend, job_manager, sleep_mock
@pytest.mark.parametrize(
["db_class"],
[
(CsvJobDatabase,),
(ParquetJobDatabase,),
],
)
def test_with_job_manager_remote_geometry_after_resume(
self, tmp_path, requests_mock, dummy_backend, job_manager, sleep_mock, db_class
):
"""Test if geometry handling works properly after resuming from CSV serialized job db."""
job_starter = UDPJobFactory(
Expand Down Expand Up @@ -1426,13 +1433,13 @@ def test_with_job_manager_remote_geometry_with_csv_persistence(
}
)

# Persist the GeoDataFrame to CSV
job_db_path = tmp_path / "jobs.csv"
_ = CsvJobDatabase(job_db_path).initialize_from_df(df)
# Persist the job db to CSV/Parquet/...
job_db_path = tmp_path / "jobs.db"
_ = db_class(job_db_path).initialize_from_df(df)
assert job_db_path.exists()

# Resume from persisted CSV
job_db = CsvJobDatabase(job_db_path)
# Resume from persisted job db
job_db = db_class(job_db_path)

stats = job_manager.run_jobs(job_db=job_db, start_job=job_starter)
assert stats == dirty_equals.IsPartialDict(
Expand Down

0 comments on commit fd9fdb8

Please sign in to comment.