Skip to content

Commit

Permalink
Update test_struct.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 20, 2024
1 parent b461081 commit 14234ae
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions tests/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,26 @@ def assert_lines(self, text: str, lines: Iterable[str]) -> None:
def test_term(self):
"""Test emitting properties."""
term = Term(
reference=Reference(prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"),
reference=Reference(
prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"
),
)
self.assert_lines(
"""\
[Term]
id: GO:0050069
name: lysine dehydrogenase activity
""",
term.iterate_obo_lines(ontology="GO", typedefs={})
term.iterate_obo_lines(ontology="GO", typedefs={}),
)

term = Term(
reference=Reference(prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"),
reference=Reference(
prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"
),
properties={
"key": ["value"],
}
},
)
self.assert_lines(
"""\
Expand All @@ -100,17 +104,17 @@ def test_term(self):
name: lysine dehydrogenase activity
property_value: key "value" xsd:string
""",
term.iterate_obo_lines(ontology="GO", typedefs={})
term.iterate_obo_lines(ontology="GO", typedefs={}),
)

typedef = TypeDef(
reference=Reference.from_curie("RO:1234567")
)
typedef = TypeDef(reference=Reference.from_curie("RO:1234567"))
term = Term(
reference=Reference(prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"),
reference=Reference(
prefix="GO", identifier="0050069", name="lysine dehydrogenase activity"
),
relationships={
typedef: [Reference.from_curie("EC:1.1.1.1")],
}
},
)
self.assert_lines(
"""\
Expand All @@ -119,5 +123,5 @@ def test_term(self):
name: lysine dehydrogenase activity
relationship: RO:1234567 eccode:1.1.1.1
""",
term.iterate_obo_lines(ontology="GO", typedefs={typedef.pair: typedef})
term.iterate_obo_lines(ontology="GO", typedefs={typedef.pair: typedef}),
)

0 comments on commit 14234ae

Please sign in to comment.