def get_book_stream(**keywords): """Get an instance of :class:`Book` from an excel source Where the dictionary should have text as keys and two dimensional array as values. """ source = factory.get_book_source(**keywords) sheets = source.get_data() filename, path = source.get_source_info() return BookStream(sheets, filename=filename, path=path)
def test_load_from_empty_sheets(): bs = BookStream() bs.load_from_sheets(None) assert bs.number_of_sheets() == 0
def test_book_stream(): bs = BookStream() assert bs.number_of_sheets() == 0
def test_key_sorting(): adict = {"cd": [[1, 3]], "ab": [[2, 3]]} bs = BookStream(adict) # bs[0] should be 'ab' : SheetStream([[2,3]]) assert bs[0].payload == [[2, 3]]