Download live_probe/test_range_tools.py from Darochin/openskynet: direct link, hf CLI and curl.
- Browser
- Download file 459 Bytes
-
https://huggingface.co/Darochin/openskynet/resolve/main/live_probe/test_range_tools.py
- Command line
-
hf download hf://Darochin/openskynet/live_probe/test_range_tools.py
-
curl -L -o test_range_tools.py https://huggingface.co/Darochin/openskynet/resolve/main/live_probe/test_range_tools.py
459 Bytes
| import pytest | |
| from range_tools import clamp | |
| def test_clamp_below_lower(): | |
| """Test that values below lower bound return 'lower'""" | |
| assert clamp(-5, lower=0, upper=10) == 'lower' | |
| def test_clamp_above_upper(): | |
| """Test that values above upper bound return 'upper'""" | |
| assert clamp(15, lower=0, upper=10) == 'upper' | |
| def test_clamp_within_range(): | |
| """Test that values within range return None""" | |
| assert clamp(5, lower=0, upper=10) is None | |