Skip to content

Commit

Permalink
test and example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Jan 2, 2024
1 parent b2e59a1 commit 31ab7e1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/create_dataset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Run this script to copy the template directory to a create a new dataset
"""

from pathlib import Path
from hdxms_datasets import create_dataset


author_name = "Krishnamurthy"
human_readable_tag = "SecB" # optional tag

data_id = create_dataset(Path().resolve() / "datasets", "smit", "testing")
3 changes: 3 additions & 0 deletions tests/test_hdxms_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def test_create_dataset(tmp_path):

assert (dataset_pth / "readme.md").read_text() == f"# {data_id}"

assert (dataset_pth / "hdx_spec.yaml").exists()
assert (dataset_pth / "data" / "data_file.csv").exists()


def test_metadata(dataset: HDXDataSet):
test_metadata = yaml.safe_load((TEST_PTH / "datasets" / DATA_ID / "metadata.yaml").read_text())
Expand Down

0 comments on commit 31ab7e1

Please sign in to comment.