Beispiel #1
0
 def test_smart_list_list(self):
     self.assertEqual(smart_list([1, 2, 3]), [1, 2, 3])
Beispiel #2
0
 def test_smart_list_int(self):
     self.assertEqual(smart_list(1), [1])
Beispiel #3
0
 def test_smart_list_tuple(self):
     self.assertEqual(smart_list((1, 2, 3)), [1, 2, 3])
Beispiel #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])
Beispiel #5
0
 def test_smart_list_csv_delimeter(self):
     self.assertEqual(smart_list('1;2;3', delimiter=';'), ['1', '2', '3'])
Beispiel #6
0
 def test_smart_list_csv(self):
     self.assertEqual(smart_list('1,2,3'), ['1', '2', '3'])
Beispiel #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), [])