Skip to content

Commit

Permalink
move test to integration dir
Browse files Browse the repository at this point in the history
  • Loading branch information
GiaJordan committed Aug 27, 2024
1 parent 2711064 commit c2b832d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 22 deletions.
42 changes: 42 additions & 0 deletions tests/integration/test_metadata_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import logging
from contextlib import contextmanager
from unittest.mock import patch

from schematic.models.metadata import MetadataModel

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)


@contextmanager
def does_not_raise():
yield


def metadata_model(helpers, data_model_labels):
metadata_model = MetadataModel(
inputMModelLocation=helpers.get_data_path("example.model.jsonld"),
data_model_labels=data_model_labels,
inputMModelLocationType="local",
)

return metadata_model


class TestMetadataModel:
def test_submit_filebased_manifest(self, helpers):
meta_data_model = metadata_model(helpers, "class_label")

manifest_path = helpers.get_data_path(
"mock_manifests/filepath_submission_test_manifest.csv"
)

with does_not_raise():
manifest_id = meta_data_model.submit_metadata_manifest(
manifest_path=manifest_path,
dataset_id="syn62276880",
manifest_record_type="file_only",
restrict_rules=False,
file_annotations_upload=True,
)
assert manifest_id == "syn62280543"
22 changes: 0 additions & 22 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
logger = logging.getLogger(__name__)


@contextmanager
def does_not_raise():
yield


def metadata_model(helpers, data_model_labels):
metadata_model = MetadataModel(
inputMModelLocation=helpers.get_data_path("example.model.jsonld"),
Expand Down Expand Up @@ -149,20 +144,3 @@ def test_submit_metadata_manifest(
hide_blanks=hide_blanks,
)
assert mock_manifest_id == "mock manifest id"

def test_submit_filebased_manifest(self, helpers):
meta_data_model = metadata_model(helpers, "class_label")

manifest_path = helpers.get_data_path(
"mock_manifests/filepath_submission_test_manifest.csv"
)

with does_not_raise():
manifest_id = meta_data_model.submit_metadata_manifest(
manifest_path=manifest_path,
dataset_id="syn62276880",
manifest_record_type="file_only",
restrict_rules=False,
file_annotations_upload=True,
)
assert manifest_id == "syn62280543"

0 comments on commit c2b832d

Please sign in to comment.