Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out transformation tests #1

Merged
merged 1 commit into from
Apr 23, 2023
Merged

Flesh out transformation tests #1

merged 1 commit into from
Apr 23, 2023

Conversation

ialarmedalien
Copy link
Collaborator

Adding more checks to test_transformer_examples
Amending examples to include other relationship types
Regenerating agent model

Amending examples to include other relationship types
Regenerate agent model
@@ -119,7 +119,6 @@ classes:
ProcedureConcept:
is_a: Concept


Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my IDE trims whitespace

Comment on lines +7 to +11
from linkml_runtime.linkml_model import (
ClassDefinition,
SlotDefinition,
SchemaDefinition,
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran black over the file after saving so the formatting would be consistent, hence there are some layout diffs

print(yaml.dump(target_obj))
self.assertEqual(AGE_STRING, target_obj["age"])

def check_familial_relationships(self, obj, data_model, expected):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pull out common tests

Comment on lines +178 to +181
self.assertEqual("U:1", mset.mappings[0].subject)
self.assertEqual("Y:1", mset.mappings[0].object.id)
self.assertEqual("y1", mset.mappings[0].object.name)
self.assertEqual("P:1", mset.mappings[0].predicate)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace print statements with tests

Comment on lines +233 to +242
self.assertEqual(
target_obj["mappings"][0],
{
"subject_id": "X:1",
"subject_name": "x1",
"object_id": "Y:1",
"object_name": "y1",
"predicate_id": "P:1",
},
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flesh out tests again

@@ -7,7 +7,8 @@
from tests import EXAMPLE_DIR

EXAMPLES = [
("measurements", "quantity_value", "qv-to-scalar", "PersonQuantityValue-001", None),
("measurements", "quantity_value", "qv-to-scalar", "PersonQuantityValue-001", 172.0),
("measurements", "quantity_value", "qv-to-scalar", "PersonQuantityValue-002", None),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an extra file to test both conditions of the transform

@cmungall
Copy link
Member

looks like something is up with flake8 independent of this PR, I'll go ahead and merge for now

@cmungall cmungall merged commit 3c101eb into linkml:main Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants