Skip to content

Commit

Permalink
Add mock nodes and relation in mock processor testing
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaris committed Feb 1, 2024
1 parent ae3c083 commit 49a5404
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import click
from click.testing import CliRunner

from indra_cogex.representation import Node, Relation
from indra_cogex.sources.cli import main
from indra_cogex.sources.processor import Processor

Expand All @@ -32,12 +33,14 @@ def __init__(self, key: Optional[str] = None):
click.echo(self.key)

def get_nodes(self):
"""Return an empty sequence of nodes for testing."""
return []
"""Return mock nodes for testing."""
return [Node(db_ns="HGNC", db_id="123", labels=["BioEntity"]),
Node(db_ns="HGNC", db_id="456", labels=["BioEntity"])]

def get_relations(self):
"""Return an empty sequence of relations for testing."""
return []
"""Return a mock relation for testing."""
return [Relation(source_ns="HGNC", source_id="123", target_ns="HGNC",
target_id="456", rel_type="mock_relation"), ]


def _new_iter() -> Iterable[Type[Processor]]:
Expand Down

0 comments on commit 49a5404

Please sign in to comment.