KennethEnevoldsen commited on
Commit
52178ed
·
unverified ·
1 Parent(s): c81d415

added outlines for more tests

Browse files
Files changed (2) hide show
  1. tests/test_dataset_schema.py +31 -1
  2. tests/test_load.py +0 -1
tests/test_dataset_schema.py CHANGED
@@ -1,5 +1,6 @@
1
  # from datetime import date
2
  # from typing import Any
 
3
 
4
  # from pydantic import BaseModel
5
 
@@ -15,7 +16,7 @@
15
  # # }
16
 
17
 
18
- # class Dataset(BaseModel):
19
  # text: str
20
  # source: str
21
  # id: str
@@ -27,3 +28,32 @@
27
 
28
  # def metadata_validator(cls):
29
  # assert "source-pretty" in cls.metadata
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # from datetime import date
2
  # from typing import Any
3
+ from pathlib import Path
4
 
5
  # from pydantic import BaseModel
6
 
 
16
  # # }
17
 
18
 
19
+ # class SampleSchema(BaseModel):
20
  # text: str
21
  # source: str
22
  # id: str
 
28
 
29
  # def metadata_validator(cls):
30
  # assert "source-pretty" in cls.metadata
31
+
32
+ # def test_sample_schema():
33
+ # """Ensure that the dataset samples follow the correct schema"""
34
+ # pass
35
+
36
+ # def test_dataset_schema():
37
+ # """tests that the dataset frontmatter and markdown follows the correct format."""
38
+ # # test correct yaml
39
+ # # test it has place for descriptive stats
40
+ # # test license is specified in text in "other" is used.
41
+ # pass
42
+
43
+
44
+ def test_dataset_folder_structure(repo_path: Path):
45
+ """tests that the dataset folder structure is as follows.
46
+
47
+ dataset_name
48
+ |- dataset_name.md
49
+ |- dataset_name.parquet
50
+
51
+ If there is a python file, there should at least be one called `create.py`, but there can be additional.
52
+ """
53
+ datasets = (repo_path / "data").glob("*")
54
+ for path in datasets:
55
+ assert (path / f"{path.name}.parquet").exists()
56
+ assert (path / f"{path.name}.md").exists()
57
+
58
+ if any(p.name.endswith(".py") for p in path.glob("*")):
59
+ assert (path / "create.py").exists()
tests/test_load.py CHANGED
@@ -20,4 +20,3 @@ def test_dataset_loads():
20
 
21
  # for dataset in datasets:
22
  # assert dataset in configs
23
-
 
20
 
21
  # for dataset in datasets:
22
  # assert dataset in configs