@@ -148,14 +148,6 @@ def test_with_attribute(self):
148148 field = fields .Raw (attribute = 'bar' )
149149 assert field .output ('foo' , {'bar' : 42 }) == 42
150150
151- def test_with_attribute_list (self ):
152- field = fields .Raw (attribute = 'bar.0' )
153- assert field .output ('foo' , {'bar' : [42 ]}) == 42
154-
155- def test_with_attribute_dict_list (self ):
156- field = fields .Raw (attribute = 'bar.0.val' )
157- assert field .output ('foo' , {'bar' : [{'val' : 42 }]}) == 42
158-
159151 def test_with_lambda_attribute (self , mocker ):
160152 obj = mocker .Mock ()
161153 obj .value = 42
@@ -1387,3 +1379,15 @@ def __getitem__(self, n):
13871379
13881380 obj = Test ('hi' )
13891381 assert fields .get_value ('value' , obj ) == 'hi'
1382+
1383+ def test_get_value_int_indexable_list (self ):
1384+ assert fields .get_value ('bar.0' , {'bar' : [42 ]}) == 42
1385+
1386+ def test_get_value_int_indexable_nested_list (self ):
1387+ assert fields .get_value ('bar.0.val' , {'bar' : [{'val' : 42 }]}) == 42
1388+
1389+ def test_get_value_int_indexable_tuple (self ):
1390+ assert fields .get_value ('bar.0' , {'bar' : (42 , 43 )}) == 42
1391+
1392+ def test_get_value_int_indexable_nested_tuple (self ):
1393+ assert fields .get_value ('bar.0.val' , {'bar' : [{'val' : 42 }]}) == 42
0 commit comments