Here are some test examples using pytest for the normalize_dict_floats_values function:
python
import sys
from your_module import normalize_dict_floats_values
import pytest
def test_normalize_dict_floats_values():
# Test with positive values
input_dict1 = { 'a': 5.0, 'b': 3.0, 'c': 7.0 }
expected1 = { 'a': 1.0, 'b': 0.42857142857142855, 'c': 1.7142857142857142 }
assert normalize_dict_floats_values(input_dict1) == expected1
# Test with negative values
input_dict2 = { 'a': -5.0, 'b': -3.0, 'c': -7.0 }
expected2 = { 'a': -1.0, 'b': -0.6, 'c': -1.0 }
assert normalize_dict_floats_values(input_dict2) == expected2
# Test with zero value
input_dict3 = { 'a': 0.0, 'b': 3.0, 'c': 7.0 }
expected3 = { 'a': 0.0, 'b': 0.42857142857142855, 'c': 1.0 }
assert normalize_dict_floats_values(input_dict3) == expected3
# Test with mixed values
input_dict4 = { 'a': -5.0, 'b': 0.0, 'c': 7.0 }
expected4 = { 'a': -1.0, 'b': 0.0, 'c': 1.0 }
assert normalize_dict_floats_values(input_dict4) == expected4
# Test with empty dictionary
input_dict5 = {}
expected5 = {}
assert normalize_dict_floats_values(input_dict5) == expected5
# Test with exception for negative min value
input_dict6 = { 'a': -5.0, 'b': -3.0, 'c': -7.0, 'd': -0.1 }
with pytest.raises(Exception) as exc_info:
normalize_dict_floats_values(input_dict6)
assert str(exc_info.value) == "Unexpected below zero value found."
Note: Make sure to replace your_module with the actual name of the module where the normalize_dict_floats_values function is defined. The above test examples test the function with different inputs like positive values, negative values, zero value, mixed values, empty dictionary, and with an exception for negative min value.