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
 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"]
 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"]
 def test_multiple_sheet(self):
     b = CSVBook("csv_multiple.csv")
     sheets = b.sheets()
     assert sheets == self.sheets
 def test_book_reader(self):
     b = CSVBook(self.test_file)
     sheets = b.sheets()
     assert sheets[self.test_file] == self.data
def test_empty_arguments_to_csvbook():
    book = CSVBook(None)
    assert book.sheets() == {"csv":[]}