'isbn': '9780312621360' }, }, [ title_test('Flame: A Sky Chasers Novel', exact=True), authors_test(['Amy Kathleen Ryan']) ]), # Multiple authors and two part title and no general description ({ 'identifiers': { 'edelweiss': '0321180607' } }, [ title_test( "XQuery from the Experts: A Guide to the W3C XML Query Language", exact=True), authors_test([ 'Howard Katz', 'Don Chamberlin', 'Denise Draper', 'Mary Fernandez', 'Michael Kay', 'Jonathan Robie', 'Michael Rys', 'Jerome Simeon', 'Jim Tivy', 'Philip Wadler' ]), pubdate_test(2003, 8, 22), comments_test('Jérôme Siméon'), lambda mi: bool( mi.comments and 'No title summary' not in mi.comments) ]), ] start, stop = 0, len(tests) tests = tests[start:stop] test_identify_plugin(Edelweiss.name, tests)
from calibre.ebooks.metadata.sources.test import ( test_identify_plugin, title_test, authors_test, comments_test, pubdate_test) tests = [ ( # A title and author search {'title': 'The Husband\'s Secret', 'authors':['Liane Moriarty']}, [title_test('The Husband\'s Secret', exact=True), authors_test(['Liane Moriarty'])] ), ( # An isbn present in edelweiss {'identifiers':{'isbn': '9780312621360'}, }, [title_test('Flame: A Sky Chasers Novel', exact=True), authors_test(['Amy Kathleen Ryan'])] ), # Multiple authors and two part title and no general description ({'identifiers':{'edelweiss':'0321180607'}}, [title_test( "XQuery From the Experts: A Guide to the W3C XML Query Language" , exact=True), authors_test([ 'Howard Katz', 'Don Chamberlin', 'Denise Draper', 'Mary Fernandez', 'Michael Kay', 'Jonathan Robie', 'Michael Rys', 'Jerome Simeon', 'Jim Tivy', 'Philip Wadler']), pubdate_test(2003, 8, 22), comments_test('Jérôme Siméon'), lambda mi: bool(mi.comments and 'No title summary' not in mi.comments) ]), ] start, stop = 0, len(tests) tests = tests[start:stop] test_identify_plugin(Edelweiss.name, tests)
title_test("XQuery from the Experts: A Guide to the W3C XML Query Language", exact=True), authors_test( [ "Howard Katz", "Don Chamberlin", "Denise Draper", "Mary Fernandez", "Michael Kay", "Jonathan Robie", "Michael Rys", "Jerome Simeon", "Jim Tivy", "Philip Wadler", ] ), pubdate_test(2003, 8, 22), comments_test("Jérôme Siméon"), lambda mi: bool(mi.comments and "No title summary" not in mi.comments), ], ), ( # An isbn not present in edelweiss {"identifiers": {"isbn": "9780316044981"}, "title": "The Heroes", "authors": ["Joe Abercrombie"]}, [title_test("The Heroes", exact=True), authors_test(["Joe Abercrombie"])], ), ( # Pubdate {"title": "The Great Gatsby", "authors": ["F. Scott Fitzgerald"]}, [ title_test("The great gatsby", exact=True), authors_test(["F. Scott Fitzgerald"]), pubdate_test(2004, 9, 29), ],
tests = [ # Multiple authors and two part title and no general description ({ 'identifiers': { 'edelweiss': '0321180607' } }, [ title_test( "XQuery from the Experts: A Guide to the W3C XML Query Language", exact=True), authors_test([ 'Howard Katz', 'Don Chamberlin', 'Denise Draper', 'Mary Fernandez', 'Michael Kay', 'Jonathan Robie', 'Michael Rys', 'Jerome Simeon', 'Jim Tivy', 'Philip Wadler' ]), pubdate_test(2003, 8, 22), comments_test('Jérôme Siméon'), lambda mi: bool( mi.comments and 'No title summary' not in mi.comments) ]), ( # An isbn not present in edelweiss { 'identifiers': { 'isbn': '9780316044981' }, 'title': 'The Heroes', 'authors': ['Joe Abercrombie'] }, [ title_test('The Heroes', exact=True), authors_test(['Joe Abercrombie']) ]), ( # Pubdate
except: log.exception('Failed to download cover from:', cached_url) # }}} if __name__ == '__main__': from calibre.ebooks.metadata.sources.test import ( test_identify_plugin, title_test, authors_test, comments_test, pubdate_test) tests = [ # Multiple authors and two part title and no general description ({'identifiers':{'edelweiss':'0321180607'}}, [title_test( "XQuery from the Experts: A Guide to the W3C XML Query Language" , exact=True), authors_test([ 'Howard Katz', 'Don Chamberlin', 'Denise Draper', 'Mary Fernandez', 'Michael Kay', 'Jonathan Robie', 'Michael Rys', 'Jerome Simeon', 'Jim Tivy', 'Philip Wadler']), pubdate_test(2003, 8, 22), comments_test('Jérôme Siméon'), lambda mi: bool(mi.comments and 'No title summary' not in mi.comments) ]), ( # An isbn not present in edelweiss {'identifiers':{'isbn': '9780316044981'}, 'title':'The Heroes', 'authors':['Joe Abercrombie']}, [title_test('The Heroes', exact=True), authors_test(['Joe Abercrombie'])] ), ( # Pubdate {'title':'The Great Gatsby', 'authors':['F. Scott Fitzgerald']}, [title_test('The great gatsby', exact=True), authors_test(['F. Scott Fitzgerald']), pubdate_test(2004, 9, 29)]