11import pytest
2- from tirith .providers .common import get_path_value_from_dict
2+ from tirith .providers .common import get_path_value_from_input
33
44
55# Test data for simple path access
9191@pytest .mark .parametrize ("data,path,expected" , simple_path_cases )
9292def test_simple_path_access (data , path , expected ):
9393 """Test basic path traversal without wildcards"""
94- result = get_path_value_from_dict (path , data )
94+ result = get_path_value_from_input (path , data )
9595 assert result == expected
9696
9797
9898@pytest .mark .parametrize ("data,path,expected" , wildcard_list_cases )
9999def test_wildcard_with_list (data , path , expected ):
100100 """Test wildcard with list of dictionaries"""
101- result = get_path_value_from_dict (path , data )
101+ result = get_path_value_from_input (path , data )
102102 assert result == expected
103103
104104
105105@pytest .mark .parametrize ("data,path,expected_set" , wildcard_dict_cases )
106106def test_wildcard_with_dict (data , path , expected_set ):
107107 """Test wildcard with dictionary values (order-independent)"""
108- result = get_path_value_from_dict (path , data )
108+ result = get_path_value_from_input (path , data )
109109 assert set (result ) == expected_set
110110
111111
112112@pytest .mark .parametrize ("data,path,expected" , multiple_wildcard_cases )
113113def test_multiple_wildcards (data , path , expected ):
114114 """Test multiple wildcards in the path"""
115- result = get_path_value_from_dict (path , data )
115+ result = get_path_value_from_input (path , data )
116116 if isinstance (expected , set ):
117117 assert set (result ) == expected
118118 else :
@@ -122,28 +122,28 @@ def test_multiple_wildcards(data, path, expected):
122122@pytest .mark .parametrize ("data,path,expected" , path_not_found_cases )
123123def test_path_not_found_default (data , path , expected ):
124124 """Test that non-existent path returns empty list by default"""
125- result = get_path_value_from_dict (path , data )
125+ result = get_path_value_from_input (path , data )
126126 assert result == expected
127127
128128
129129@pytest .mark .parametrize ("data,path,flag,expected" , path_not_found_with_flag_cases )
130130def test_path_not_found_with_flag (data , path , flag , expected ):
131131 """Test that non-existent path returns [None] when flag is True"""
132- result = get_path_value_from_dict (path , data , place_none_if_not_found = flag )
132+ result = get_path_value_from_input (path , data , place_none_if_not_found = flag )
133133 assert result == expected
134134
135135
136136@pytest .mark .parametrize ("data,path,expected" , special_value_cases )
137137def test_special_values (data , path , expected ):
138138 """Test handling of special values like None and empty paths"""
139- result = get_path_value_from_dict (path , data )
139+ result = get_path_value_from_input (path , data )
140140 assert result == expected
141141
142142
143143@pytest .mark .parametrize ("data,path,expected" , complex_structure_cases )
144144def test_complex_nested_structure (data , path , expected ):
145145 """Test complex real-world-like nested structures"""
146- result = get_path_value_from_dict (path , data )
146+ result = get_path_value_from_input (path , data )
147147 assert result == expected
148148
149149
@@ -171,22 +171,22 @@ def test_complex_nested_structure(data, path, expected):
171171@pytest .mark .parametrize ("data,path,expected" , edge_case_wildcard_cases )
172172def test_edge_case_wildcards (data , path , expected ):
173173 """Test edge cases with wildcards like missing intermediate paths and partial matches"""
174- result = get_path_value_from_dict (path , data )
174+ result = get_path_value_from_input (path , data )
175175 assert result == expected
176176
177177
178178@pytest .mark .parametrize ("data,path,flag,expected" , empty_container_cases )
179179def test_empty_containers (data , path , flag , expected ):
180180 """Test empty containers return empty list"""
181- result = get_path_value_from_dict (path , data , place_none_if_not_found = flag )
181+ result = get_path_value_from_input (path , data , place_none_if_not_found = flag )
182182 assert result == expected
183183
184184
185185@pytest .mark .parametrize ("data,path,flag,expected" , empty_container_with_flag_cases )
186186def test_empty_containers_with_flag (data , path , flag , expected ):
187187 """Test empty containers with place_none_if_not_found flag"""
188188 # Empty containers don't trigger the flag since they exist but are empty
189- result = get_path_value_from_dict (path , data , place_none_if_not_found = flag )
189+ result = get_path_value_from_input (path , data , place_none_if_not_found = flag )
190190 assert result == expected
191191
192192
@@ -226,19 +226,19 @@ def test_empty_containers_with_flag(data, path, flag, expected):
226226@pytest .mark .parametrize ("data,path,expected" , wildcard_list_no_remaining_cases )
227227def test_wildcard_list_no_remaining_paths (data , path , expected ):
228228 """Test wildcard at the end of path with list and no remaining paths - covers lines 31-32"""
229- result = get_path_value_from_dict (path , data )
229+ result = get_path_value_from_input (path , data )
230230 assert result == expected
231231
232232
233233@pytest .mark .parametrize ("data,path,expected_set" , wildcard_dict_no_remaining_cases )
234234def test_wildcard_dict_no_remaining_paths (data , path , expected_set ):
235235 """Test wildcard at the end of path with dict and no remaining paths - covers lines 38-39"""
236- result = get_path_value_from_dict (path , data )
236+ result = get_path_value_from_input (path , data )
237237 assert set (result ) == expected_set
238238
239239
240240@pytest .mark .parametrize ("data,path,expected" , wildcard_primitive_cases )
241241def test_wildcard_primitive_no_remaining_paths (data , path , expected ):
242242 """Test wildcard applied to primitive value with no remaining paths - covers lines 42-43"""
243- result = get_path_value_from_dict (path , data )
243+ result = get_path_value_from_input (path , data )
244244 assert result == expected
0 commit comments