Fix conversion to item_type on __call__ in List type

Change-Id: I365eec5785023135ce6aaceaec425e23fe4301f0
Closes-Bug: #1640962
This commit is contained in:
Gevorg Davoian 2016-11-16 14:55:37 +02:00
parent 38246b6f4f
commit 42af1ad069
2 changed files with 6 additions and 1 deletions

View File

@ -531,6 +531,11 @@ class ListTypeTests(TypeTestHelper, unittest.TestCase):
self.assertConvertedValue('1,2,3,5',
[1, 2, 3, 5])
def test_tuple_of_custom_type(self):
self.type_instance = types.List(types.Integer())
self.assertConvertedValue(('1', '2', '3', '5'),
[1, 2, 3, 5])
def test_bounds_parsing(self):
self.type_instance = types.List(types.Integer(), bounds=True)
self.assertConvertedValue('[1,2,3]', [1, 2, 3])

View File

@ -441,7 +441,7 @@ class List(ConfigType):
def __call__(self, value):
if isinstance(value, (list, tuple)):
return list(value)
return list(six.moves.map(self.item_type, value))
s = value.strip()
if self.bounds: