Exemple #1
0
 def test_header_yes_with_noheader(self):
     """
     """
     keys, values = csv2lol('testfiles/csv2lol_header_no.csv', header=True)
     self.assertEquals(keys, ['2011-11-23', '34.01', 'yhoo'])
     self.assertEquals(values[0], ['2011-11-22', '34.64', 'yhoo'])
     self.assertEquals(len(values), 1)
Exemple #2
0
 def test_header_yes(self):
     """
     """
     keys, values = csv2lol('testfiles/csv2lol_header_yes.csv', header=True)
     self.assertEquals(keys, ['Date', 'Open', 'Symbol'])
     self.assertEquals(values[0], ['2011-11-23', '34.01', 'yhoo'])
     self.assertEquals(values[1], ['2011-11-22', '34.64', 'yhoo'])
     self.assertEquals(len(values), 2)
Exemple #3
0
 def test_header_no(self):
     """
     """
     keys, values = csv2lol('testfiles/csv2lol_header_no.csv')
     self.assertEquals(keys, [0, 1, 2])
     self.assertEquals(values[0], ['2011-11-23', '34.01', 'yhoo'])
     self.assertEquals(values[1], ['2011-11-22', '34.64', 'yhoo'])
     self.assertEquals(len(values), 2)
Exemple #4
0
 def test_header_no_with_header(self):
     """
     """
     keys, values = csv2lol('testfiles/csv2lol_header_yes.csv')
     self.assertEquals(keys, [0, 1, 2])
     self.assertEquals(values[0], ['Date', 'Open', 'Symbol'])
     self.assertEquals(values[1], ['2011-11-23', '34.01', 'yhoo'])
     self.assertEquals(values[2], ['2011-11-22', '34.64', 'yhoo'])
     self.assertEquals(len(values), 3)
Exemple #5
0
 def test_empty_file(self):
     """
     """
     keys, values = csv2lol('testfiles/csv2lol_empty.csv')
     self.assertEquals(keys, [])
     self.assertEquals(values, [])