Example #1
0
 def test_simple_split(self):
     self.assertEqual(list(cast.my_split('1,2,3,4')),
                      ['1','2','3','4'])
     self.assertEqual(list(cast.my_split('1,"2,3",4')),
                      ['1','"2,3"','4'])
     self.assertEqual(list(cast.my_split("1,'2,3',4")),
                      ['1',"'2,3'",'4'])
Example #2
0
 def test_complex_split(self):
     long_str = 'PROGRAM-ID=1,BANDWIDTH=602230,CODECS="avc1.66.31, mp4a.40.2",RESOLUTION=320x240'
     exp_res = [
         'PROGRAM-ID=1', 'BANDWIDTH=602230',
         'CODECS="avc1.66.31, mp4a.40.2"', 'RESOLUTION=320x240'
     ]
     self.assertEqual(list(cast.my_split(long_str)), exp_res)
Example #3
0
 def test_single_item(self):
     self.assertEqual(list(cast.my_split('test')), ['test'])
Example #4
0
 def test_trailing_comma(self):
     self.assertEqual(list(cast.my_split('1,2,3,')), ['1', '2', '3'])
Example #5
0
 def test_single_item(self):
     self.assertEqual(list(cast.my_split('test')), ['test'])
Example #6
0
 def test_trailing_comma(self):
     self.assertEqual(list(cast.my_split('1,2,3,')), ['1','2','3'])
Example #7
0
 def test_complex_split(self):
     long_str = 'PROGRAM-ID=1,BANDWIDTH=602230,CODECS="avc1.66.31, mp4a.40.2",RESOLUTION=320x240'
     exp_res = ['PROGRAM-ID=1','BANDWIDTH=602230',
                'CODECS="avc1.66.31, mp4a.40.2"','RESOLUTION=320x240']
     self.assertEqual(list(cast.my_split(long_str)),exp_res)