Exemplo n.º 1
0
 def test_smart_list_list(self):
     self.assertEqual(smart_list([1, 2, 3]), [1, 2, 3])
Exemplo n.º 2
0
 def test_smart_list_int(self):
     self.assertEqual(smart_list(1), [1])
Exemplo n.º 3
0
 def test_smart_list_tuple(self):
     self.assertEqual(smart_list((1, 2, 3)), [1, 2, 3])
Exemplo n.º 4
0
 def test_smart_list_csv_to_int(self):
     self.assertEqual(smart_list('1,2,3', func=lambda x: int(x)), [1, 2, 3])
Exemplo n.º 5
0
 def test_smart_list_csv_delimeter(self):
     self.assertEqual(smart_list('1;2;3', delimiter=';'), ['1', '2', '3'])
Exemplo n.º 6
0
 def test_smart_list_csv(self):
     self.assertEqual(smart_list('1,2,3'), ['1', '2', '3'])
Exemplo n.º 7
0
 def test_smart_list_empty(self):
     self.assertEqual(smart_list(''), [])
     self.assertEqual(smart_list([]), [])
     self.assertEqual(smart_list('[]'), [])
     self.assertEqual(smart_list(None), [])