Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Minor update of datamodel API tests #3636

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions tests/test_datamodel_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def cb(val):

@pytest.mark.fluent_version(">=25.2")
def test_datamodel_api_on_command_attribute_changed(
datamodel_api_version_all, new_solver_session
datamodel_api_version_all, request, new_solver_session
):
solver = new_solver_session
app_name = "test"
Expand All @@ -292,14 +292,16 @@ def cb(val):
service.set_state(app_name, "/A/X", "xyz")
timeout_loop(lambda: called == 2, timeout=5)
assert called == 2
# TODO: value is still "cde" in both old and new API
# assert value == "xyz"
test_name = request.node.name
# TODO: the value is not modiefied in the old API - issue
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
if test_name.endswith("[new]"):
assert value == "xyz"
subscription.unsubscribe()
service.set_state(app_name, "/A/X", "abc")
time.sleep(5)
assert called == 2
# Commented out because of the issue above
# assert value == "xyz"
if test_name.endswith("[new]"):
assert value == "xyz"


@pytest.mark.fluent_version(">=25.2")
Expand All @@ -322,7 +324,6 @@ def cb(cmd, args):
arguments = args
executed += 1

# TODO: In C++ API, we don't need to pass the command name
mkundu1 marked this conversation as resolved.
Show resolved Hide resolved
subscription = service.add_on_command_executed(app_name, "/", cb)
assert executed == 0
assert command is None
Expand Down
Loading