test_threshold.py
1 # SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai> 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 5 from haystack.testing.sample_components import Threshold 6 7 8 def test_threshold(): 9 component = Threshold() 10 11 results = component.run(value=5, threshold=10) 12 assert results == {"below": 5} 13 14 results = component.run(value=15, threshold=10) 15 assert results == {"above": 15}