Skip to content

Commit e95d856

Browse files
committed
revert #979
1 parent 20d5508 commit e95d856

File tree

3 files changed

+7
-68
lines changed

3 files changed

+7
-68
lines changed

tests/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,6 @@ def get_python_version(self):
7272

7373
return base_version
7474

75-
@staticmethod
76-
def clean_up_file(self, file_name):
77-
try:
78-
os.remove(self.get_data_path(file_name))
79-
except FileNotFoundError:
80-
pass
81-
8275
@pytest.fixture
8376
def helpers():
8477
yield Helpers

tests/test_cli.py

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# from schematic import init
88
from schematic.schemas.commands import schema
99
from schematic.utils.google_api_utils import download_creds_file
10-
from schematic.manifest.commands import manifest
10+
1111

1212
@pytest.fixture
1313
def runner() -> CliRunner:
@@ -16,75 +16,21 @@ def runner() -> CliRunner:
1616
return CliRunner()
1717

1818

19-
@pytest.fixture
20-
def data_model_jsonld(helpers):
21-
data_model_jsonld =helpers.get_data_path("example.model.jsonld")
22-
yield data_model_jsonld
23-
24-
2519
class TestSchemaCli:
26-
def test_schema_convert_cli(self, runner, helpers, data_model_jsonld):
20+
def test_schema_convert_cli(self, runner, config_path, helpers):
2721

2822
data_model_csv_path = helpers.get_data_path("example.model.csv")
2923

24+
output_path = helpers.get_data_path("example.model.jsonld")
25+
3026
result = runner.invoke(
31-
schema, ["convert", data_model_csv_path, "--output_jsonld", data_model_jsonld]
27+
schema, ["convert", data_model_csv_path, "--output_jsonld", output_path]
3228
)
3329

3430
assert result.exit_code == 0
3531

3632
expected_substr = (
37-
"The Data Model was created and saved to " f"'{data_model_jsonld}' location."
33+
"The Data Model was created and saved to " f"'{output_path}' location."
3834
)
3935

4036
assert expected_substr in result.output
41-
42-
# get manifest by default
43-
@pytest.mark.google_credentials_needed
44-
def test_get_manifest_cli(self, runner, helpers, config, data_model_jsonld):
45-
output_path = helpers.get_data_path("example.Patient.manifest.csv")
46-
47-
result = runner.invoke(
48-
manifest, ["--config", config.CONFIG_PATH, "get", "--data_type", "Patient", "--jsonld", data_model_jsonld]
49-
)
50-
51-
52-
assert result.exit_code == 0
53-
54-
expected_substr_one = "Find the manifest template using this CSV file path:"
55-
56-
assert expected_substr_one in result.output
57-
assert output_path in result.output
58-
59-
# clean up
60-
helpers.clean_up_file(helpers, file_name=output_path)
61-
62-
# get manifest as a csv
63-
# use google drive to export
64-
@pytest.mark.google_credentials_needed
65-
def test_get_manifest_csv(self, runner, helpers, config, data_model_jsonld):
66-
output_path = helpers.get_data_path("test.csv")
67-
68-
result = runner.invoke(
69-
manifest, ["--config", config.CONFIG_PATH, "get", "--data_type", "Patient", "--jsonld", data_model_jsonld, "--output_csv", output_path]
70-
)
71-
assert result.exit_code == 0
72-
assert output_path in result.output
73-
74-
# clean up
75-
helpers.clean_up_file(helpers, file_name=output_path)
76-
77-
# get manifest as an excel spreadsheet
78-
@pytest.mark.google_credentials_needed
79-
def test_get_manifest_excel(self, runner, helpers, config, data_model_jsonld):
80-
output_path = helpers.get_data_path("test.xlsx")
81-
82-
result = runner.invoke(
83-
manifest, ["--config", config.CONFIG_PATH, "get", "--data_type", "Patient", "--jsonld", data_model_jsonld, "--output_xlsx", output_path]
84-
)
85-
86-
assert result.exit_code == 0
87-
assert output_path in result.output
88-
89-
# clean up
90-
helpers.clean_up_file(helpers, file_name=output_path)

tests/test_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ def test_get_component_requirements(self, metadata_model, as_graph):
3838
else:
3939
assert "Biospecimen" in output
4040
assert "Patient" in output
41-
assert "BulkRNA-seqAssay" in output
41+
assert "BulkRNA-seqAssay" in output

0 commit comments

Comments
 (0)