-
Notifications
You must be signed in to change notification settings - Fork 3
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
Flesh out transformation tests #1
Conversation
Amending examples to include other relationship types Regenerate agent model
@@ -119,7 +119,6 @@ classes: | |||
ProcedureConcept: | |||
is_a: Concept | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my IDE trims whitespace
from linkml_runtime.linkml_model import ( | ||
ClassDefinition, | ||
SlotDefinition, | ||
SchemaDefinition, | ||
) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pull out common tests
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) |
There was a problem hiding this comment.
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
self.assertEqual( | ||
target_obj["mappings"][0], | ||
{ | ||
"subject_id": "X:1", | ||
"subject_name": "x1", | ||
"object_id": "Y:1", | ||
"object_name": "y1", | ||
"predicate_id": "P:1", | ||
}, | ||
) |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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
looks like something is up with flake8 independent of this PR, I'll go ahead and merge for now |
Adding more checks to test_transformer_examples
Amending examples to include other relationship types
Regenerating agent model