Esempio n. 1
0
 def test_book_reader_from_memory_source(self):
     io = get_io(self.file_type)
     with open(self.test_file, 'r') as f:
         io.write(f.read())
     io.seek(0)
     b = CSVBook(None, io)
     sheets = b.sheets()
     assert sheets['csv'] == self.data
Esempio n. 2
0
 def test_read_one_from_many_by_index(self):
     b = CSVBook("csv_multiple.csv", load_sheet_at_index=1)
     sheets = b.sheets()
     assert sheets["sheet2"] == self.sheets["sheet2"]
Esempio n. 3
0
 def test_read_one_from_many_by_name(self):
     b = CSVBook("csv_multiple.csv", load_sheet_with_name="sheet1")
     sheets = b.sheets()
     assert sheets["sheet1"] == self.sheets["sheet1"]
Esempio n. 4
0
 def test_multiple_sheet(self):
     b = CSVBook("csv_multiple.csv")
     sheets = b.sheets()
     assert sheets == self.sheets
Esempio n. 5
0
 def test_book_reader(self):
     b = CSVBook(self.test_file)
     sheets = b.sheets()
     assert sheets[self.test_file] == self.data
Esempio n. 6
0
def test_empty_arguments_to_csvbook():
    book = CSVBook(None)
    assert book.sheets() == {"csv":[]}