haystack/test/core/sample_components/test_threshold.py
2025-04-29 18:09:11 +02:00

16 lines
396 B
Python

# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
#
# SPDX-License-Identifier: Apache-2.0
from haystack.testing.sample_components import Threshold
def test_threshold():
component = Threshold()
results = component.run(value=5, threshold=10)
assert results == {"below": 5}
results = component.run(value=15, threshold=10)
assert results == {"above": 15}