Skip to content

Commit

Permalink
coverage bump
Browse files Browse the repository at this point in the history
  • Loading branch information
darthtrevino committed Jun 27, 2024
1 parent ae0da7c commit cc9d01a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/reactivedataflow/tests/unit/nodes/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright (c) 2024 Microsoft Corporation.
"""Tests for Nodes."""
26 changes: 26 additions & 0 deletions python/reactivedataflow/tests/unit/nodes/test_input_node.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2024 Microsoft Corporation.
"""Tests for the InputNode class."""

import reactivex as rx

from reactivedataflow.nodes import InputNode


def test_input_node_has_id():
node = InputNode("a")
assert node.id == "a"
node.dispose()


def test_input_node_attach():
node = InputNode("a")
first_attach = rx.subject.BehaviorSubject(1)
node.attach(first_attach)
assert node.output_value() == 1

node.attach(rx.just(2))
assert node.output_value() == 2

first_attach.on_next(3)
assert node.output_value() == 2
node.dispose()
5 changes: 5 additions & 0 deletions python/reactivedataflow/tests/unit/test_graph_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ def test_graph_assembler_from_schema():
# Build the graph
input_stream = rx.subject.BehaviorSubject(1)
graph = assembler.build(registry=registry, inputs={"input": input_stream})

with pytest.raises(OutputNotFoundError):
graph.output_value("fail_1")
with pytest.raises(OutputNotFoundError):
graph.output("fail_1")
assert graph.output_value("result") == 32
input_stream.on_next(2)
assert graph.output_value("result") == 40

0 comments on commit cc9d01a

Please sign in to comment.