def test_get_reserved_books_no_table(self): with patch( "mmlibrary.html_parser.HtmlParser._get_books_table") as method: method.return_value = None books = HtmlParser.get_reserved_books(None) assert isinstance(books, ReservedBooks) assert books.len == 0
def _get_reserved_books( self, user: User, type: str = BookFilter.TYPE_RESERVED_NORMAL) -> ReservedBooks: html = self._html_page.fetch_login_page(Library.LIBRALY_HOME_URL, user) all_books = HtmlParser.get_reserved_books(html) filtered_books = BookFilter.do(all_books, type=type) return filtered_books