Skip to content

Commit

Permalink
clear test coverage bar
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Jun 27, 2024
1 parent cc9d01a commit c000d03
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion python/reactivedataflow/tests/unit/test_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
GraphBuilder,
Registry,
)
from reactivedataflow.errors import NodeAlreadyDefinedError, OutputNotFoundError
from reactivedataflow.errors import (
NodeAlreadyDefinedError,
NodeNotFoundError,
OutputAlreadyDefinedError,
OutputNotFoundError,
)
from reactivedataflow.model import Edge, Graph, InputNode, Node, Output

from .define_math_ops import define_math_ops
Expand Down Expand Up @@ -40,6 +45,21 @@ def test_input_bind():
assert graph.output_value("i1") == 1


def test_throws_on_redundant_output():
builder = GraphBuilder().add_input("i1").add_output("i1")
with pytest.raises(OutputAlreadyDefinedError):
builder.add_output("i1")


def test_throws_on_add_edge_with_unknown_nodes():
builder = GraphBuilder()
builder.add_node("n1", "add")
with pytest.raises(NodeNotFoundError):
builder.add_edge(from_node="n1", to_node="n2")
with pytest.raises(NodeNotFoundError):
builder.add_edge(from_node="n2", to_node="n1")


def test_simple_graph():
registry = Registry()
define_math_ops(registry)
Expand Down

0 comments on commit c000d03

Please sign in to comment.