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)
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)
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)
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)
def test_empty_file(self): """ """ keys, values = csv2lol('testfiles/csv2lol_empty.csv') self.assertEquals(keys, []) self.assertEquals(values, [])