Skip to content

Commit 9c09f2c

Browse files
committed
move data models to their own folder
1 parent 19c4e45 commit 9c09f2c

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

tests/unit/synapseclient/extensions/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def helpers():
6161
@pytest.fixture(name="dmge", scope="function")
6262
def DMGE(helpers: Helpers) -> DataModelGraphExplorer:
6363
"""Fixture to instantiate a DataModelGraphExplorer object using the data model with column types"""
64-
dmge = helpers.get_data_model_graph_explorer(path="example.model.csv")
64+
dmge = helpers.get_data_model_graph_explorer(path="data_models/example.model.csv")
6565
return dmge
6666

6767

@@ -74,15 +74,15 @@ def fixture_dmr():
7474
@pytest.fixture(name="dmp")
7575
def fixture_dmp(helpers: Helpers) -> DataModelParser:
7676
"Returns a DataModelParser using the csv data model"
77-
data_model_path = helpers.get_schema_file_path("example.model.csv")
77+
data_model_path = helpers.get_schema_file_path("data_models/example.model.csv")
7878
dmp = DataModelParser(data_model_path, logger=Mock())
7979
return dmp
8080

8181

8282
@pytest.fixture(name="dmp_jsonld")
8383
def fixture_dmp_json_ld(helpers: Helpers) -> DataModelParser:
8484
"Returns a DataModelParser using the jsonld data model"
85-
data_model_path = helpers.get_schema_file_path("example.model.jsonld")
85+
data_model_path = helpers.get_schema_file_path("data_models/example.model.jsonld")
8686
dmp = DataModelParser(data_model_path, logger=Mock())
8787
return dmp
8888

tests/unit/synapseclient/extensions/schema_files/example.model.csv renamed to tests/unit/synapseclient/extensions/schema_files/data_models/example.model.csv

File renamed without changes.

tests/unit/synapseclient/extensions/schema_files/example.model.jsonld renamed to tests/unit/synapseclient/extensions/schema_files/data_models/example.model.jsonld

File renamed without changes.

tests/unit/synapseclient/extensions/unit_test_curator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ def setUp(self):
17311731
self.test_schema_path = os.path.join(
17321732
os.path.dirname(__file__),
17331733
"schema_files",
1734-
"example.model.csv",
1734+
"data_models/example.model.csv",
17351735
)
17361736

17371737
def test_generate_jsonld_with_default_output_path(self):
@@ -1945,7 +1945,7 @@ def setUp(self):
19451945
self.test_schema_path = os.path.join(
19461946
os.path.dirname(__file__),
19471947
"schema_files",
1948-
"example.model.csv",
1948+
"data_models/example.model.csv",
19491949
)
19501950

19511951
def test_generate_jsonschema_from_csv(self):

tests/unit/synapseclient/extensions/unit_test_data_model_graph_explorer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
AtomicColumnType,
77
ColumnType,
88
DataModelGraphExplorer,
9-
Format,
9+
JSONSchemaFormat,
1010
ListColumnType,
1111
)
1212

@@ -71,9 +71,9 @@ def test_get_node_column_type(
7171

7272
@pytest.mark.parametrize(
7373
"node_label, column_type",
74-
[("String", None), ("Date", Format.DATE), ("URL", Format.URI)],
74+
[("String", None), ("Date", JSONSchemaFormat.DATE), ("URL", JSONSchemaFormat.URI)],
7575
)
7676
def test_get_node_format(
77-
dmge: DataModelGraphExplorer, node_label: str, column_type: Format
77+
dmge: DataModelGraphExplorer, node_label: str, column_type: JSONSchemaFormat
7878
) -> None:
7979
assert dmge.get_node_format(node_label) == column_type

tests/unit/synapseclient/extensions/unit_test_data_model_parser.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ def test_gather_csv_attributes_relationships(
3838
self, helpers, csv_dmp: DataModelCSVParser
3939
):
4040
"""The output of the function is a attributes relationship dictionary, check that it is formatted properly."""
41-
path_to_data_model = helpers.get_schema_file_path("example.model.csv")
41+
path_to_data_model = helpers.get_schema_file_path(
42+
"data_models/example.model.csv"
43+
)
4244
model_df = load_df(path_to_data_model, data_model=True)
4345

4446
attr_rel_dict = csv_dmp.gather_csv_attributes_relationships(model_df=model_df)
@@ -52,7 +54,9 @@ def test_gather_csv_attributes_relationships(
5254

5355
def test_parse_csv_model(self, helpers, csv_dmp: DataModelCSVParser):
5456
"""The output of the function is a attributes relationship dictionary, check that it is formatted properly."""
55-
path_to_data_model = helpers.get_schema_file_path("example.model.csv")
57+
path_to_data_model = helpers.get_schema_file_path(
58+
"data_models/example.model.csv"
59+
)
5660

5761
attr_rel_dictionary = csv_dmp.parse_csv_model(
5862
path_to_data_model=path_to_data_model
@@ -91,7 +95,9 @@ def test_gather_jsonld_attributes_relationships(
9195
jsonld_dmp: DataModelJSONLDParser,
9296
):
9397
"""The output of the function is a attributes relationship dictionary, check that it is formatted properly."""
94-
path_to_data_model = helpers.get_schema_file_path("example.model.jsonld")
98+
path_to_data_model = helpers.get_schema_file_path(
99+
"data_models/example.model.jsonld"
100+
)
95101
model_jsonld = load_json(path_to_data_model)
96102
attr_rel_dict = jsonld_dmp.gather_jsonld_attributes_relationships(
97103
model_jsonld=model_jsonld["@graph"],
@@ -110,7 +116,9 @@ def test_parse_jsonld_model(
110116
jsonld_dmp: DataModelJSONLDParser,
111117
):
112118
"""The output of the function is a attributes relationship dictionary, check that it is formatted properly."""
113-
path_to_data_model = helpers.get_schema_file_path("example.model.jsonld")
119+
path_to_data_model = helpers.get_schema_file_path(
120+
"data_models/example.model.jsonld"
121+
)
114122
attr_rel_dictionary = jsonld_dmp.parse_jsonld_model(
115123
path_to_data_model=path_to_data_model,
116124
)

0 commit comments

Comments
 (0)