Skip to content

Commit

Permalink
Stub testcase_node_found() unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardBruskiewich committed May 30, 2024
1 parent 7eae56b commit 88ff1b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion reasoner_validator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def testcase_node_category_found(
) -> Optional[str]:
"""
Retrieve the most specific Biolink Model category match of knowledge graph node to testcase.
:param target: the concept node type of interest: the 'subject' or the 'object'
:param node_id: str, identifier of node in "nodes" catalog whose category is to be matched against the testcase
:param testcase: Dict, full test testcase against which the input node is being matched
Expand Down
38 changes: 19 additions & 19 deletions tests/test_response_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,25 +1264,6 @@ def test_category_matched(
) == category_matched


# assert target in ["subject", "object"]
# for node_id in nodes.keys():
# node_details = nodes[node_id]
# category: Optional[str]
# if node_id in target_id_aliases:
# # Found the target node identifier, but is the expected category present?
# category: Optional[str] = self.testcase_node_category_found(target, node_id, testcase, node_details)
# if category:
# return node_id, category, None # no 'query_id' is given since the node is directly matched.
#
# def testcase_node_category_found(
# self,
# target,
# node_id,
# testcase,
# node_details
# ) -> Optional[str]:


@pytest.mark.parametrize(
"sample_node_id,subject_category,node_details,output_category,code",
[
Expand Down Expand Up @@ -1362,6 +1343,25 @@ def test_testcase_node_category_found(
check_messages(validator, code)


def test_testcase_node_found():
validator = TRAPIResponseValidator(
trapi_version=LATEST_TRAPI_RELEASE,
biolink_version=LATEST_BIOLINK_MODEL_VERSION
)
# def testcase_node_found(
# self,
# target: str,
# target_id_aliases: List[str],
# testcase: Dict,
# nodes: Dict
# ) -> Optional[Tuple[str, str, Optional[str]]]:
target: str = ""
target_id_aliases: List[str] = []
testcase: Dict = {}
nodes: Dict = {}
validator.testcase_node_found(target, target_id_aliases, testcase, nodes)


@pytest.mark.parametrize(
"testcase,response",
[
Expand Down

0 comments on commit 88ff1b9

Please sign in to comment.