def test_convert_to_list_non_iterable(self): for item in (True, False, 1, 1.2, object()): self.assertEqual(attributes.convert_to_list(item), [item])
def test_convert_to_list_string(self): for item in ('', 'foo'): self.assertEqual(attributes.convert_to_list(item), [item])
def test_convert_to_list_iterable(self): for item in ([None], [1, 2, 3], (1, 2, 3), set([1, 2, 3]), ['foo']): self.assertEqual(attributes.convert_to_list(item), list(item))
def test_convert_to_empty_list(self): for item in (None, [], (), {}): self.assertEqual(attributes.convert_to_list(item), [])