-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae0da7c
commit cc9d01a
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright (c) 2024 Microsoft Corporation. | ||
"""Tests for Nodes.""" |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
python/reactivedataflow/tests/unit/nodes/test_input_node.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters