def test_comicvine_volume_id_match(self): test_identify_plugin(Comicvine.name, [( { 'title': 'Preacher', 'identifiers': { 'comicvine-volume': '18059'}, }, [ title_test( 'Preacher Special: The Story of You-Know-Who #1: ' 'The Story of You-Know-Who', exact=True ), authors_test( ['Garth Ennis', 'Richard Case', 'Matt Hollingsworth', 'Clem Robins', 'Glenn Fabry', 'Julie Rottenberg']), series_test( 'Preacher Special: The Story of You-Know-Who', 1.0), comicvine_id_test('105747'), comicvine_volume_id_test('18059'), ] )])
def test_comicvine_volume_id_match(self): test_identify_plugin(Comicvine.name, [({ 'title': 'Preacher', 'identifiers': { 'comicvine-volume': '18059' }, }, [ title_test( 'Preacher Special: The Story of You-Know-Who #1: ' 'The Story of You-Know-Who', exact=True), authors_test([ 'Garth Ennis', 'Richard Case', 'Matt Hollingsworth', 'Clem Robins', 'Glenn Fabry', 'Julie Rottenberg' ]), series_test('Preacher Special: The Story of You-Know-Who', 1.0), comicvine_id_test('105747'), comicvine_volume_id_test('18059'), ])])
test_identify_plugin( Kyobobook.name, [ # 원제 꼭지가 붙어 있다. # 장 코르미에 (지은이) | 김미선 (옮긴이) | 실천문학사 | 2005-05-25 | 원제 Che Guevara (2002년) ( # A book with an ISBN { 'identifiers': { 'isbn': '9788939205109' }, 'title': '체 게바라', 'authors': ['장 코르미에'] }, [ title_test('체 게바라 평전', exact=True), authors_test(['장 코르미에', '김미선']), series_test('역사인물찾기', 10.0) ]), ( # A book with an kyobobook id { 'identifiers': { 'kyobobook': '9788932008486' } }, [ title_test('광장/구운몽', exact=True), authors_test(['최인훈']), ]), ( # A book with title and author { 'identifiers': { 'isbn': '9788936470111' }
if __name__ == '__main__': # tests # To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin(Aladin_co_kr.name, [ # 원제 꼭지가 붙어 있다. # 장 코르미에 (지은이) | 김미선 (옮긴이) | 실천문학사 | 2005-05-25 | 원제 Che Guevara (2002년) (# A book with an ISBN {'identifiers':{'isbn': '9788939205109'}, 'title':'체 게바라', 'authors':['장 코르미에']}, [title_test('체 게바라 평전', exact=True), authors_test(['장 코르미에','김미선']), series_test('역사 인물 찾기', 10.0)] ), (# A book with an aladin id {'identifiers':{'aladin.co.kr': '8932008485'}}, [title_test('광장', exact=False), authors_test(['최인훈']), ] ), (# A book with title and author {'title':'나의 문화유산답사기 1', 'authors':['유홍준']}, [title_test('나의 문화유산답사기 1', exact=False), authors_test(['유홍준'])] ),
if mc == cover_url: return True prints("Cover test failed. Expected: '%s' found: " % cover_url, mc) return False return test test_identify_plugin( YES24.name, [ ( # A book with an ISBN {"identifiers": {"isbn": "9788983920683"}, "title": "해리포터와 마법사의 돌", "authors": ["조앤.K.롤링"]}, [ title_test("해리포터와 마법사의 돌 1", exact=True), authors_test(["조앤.K.롤링"]), series_test("해리포터", 1.0), cover_test("http://image.yes24.com/goods/72289/L"), ], ), ( # A book with no ISBN specified {"title": "아투안의 무덤", "authors": ["어슐러 르 귄"]}, [ title_test("아투안의 무덤", exact=True), authors_test(["어슐러 르 귄"]), series_test("어스시 전집", 2.0), cover_test("http://image.yes24.com/goods/2128248/L"), ], ), ( # A book with a YES24 id {"identifiers": {"yes24": "6185205"}, "title": "칼의 노래", "authors": ["김훈"]}, [
if mc == cover_url: return True prints('Cover test failed. Expected: \'%s\' found: ' % cover_url, mc) return False return test test_identify_plugin(Aladin.name, [ (# A book with an ISBN {'identifiers':{'isbn': '9788983920683'}, 'title':u'해리포터와 마법사의 돌', 'authors':[u'조앤.K.롤링']}, [title_test(u'해리포터와 마법사의 돌 1', exact=True), authors_test([u'조앤.K.롤링']), series_test(u'해리포터', 1.0), cover_test('http://image.aladin.co.kr/product/21/6/letslook/8983920688_f.jpg')] ), (# A book with no ISBN specified {'title':u"아투안의 무덤", 'authors':[u'어슐러 르 귄']}, [title_test(u"아투안의 무덤", exact=True), authors_test([u'어슐러 르 귄']), series_test(u'어스시 전집', 2.0), cover_test('http://image.aladin.co.kr/product/67/36/letslook/8982731911_f.jpg')] ), """ (# A book with an NA cover {'identifiers':{'isbn':'9780451063953'}, 'title':'The Girl Hunters', 'authors':['Mickey Spillane']},
title_test, authors_test, series_test) test_identify_plugin( noosfere.name, [ ( # A book with ISBN specified not in noosfere { 'identifiers': { 'isbn': '9782265070769' }, 'title': 'Le chenal noir', 'authors': ['G.-J. Arnaud'] }, [ title_test("Le Chenal noir", exact=True), authors_test(['G.-J. Arnaud']), series_test('La Compagnie des glaces - Nouvelle époque', 2) ]), ( # A book with ISBN specified { 'identifiers': { 'isbn': '2-266-03441-3' }, 'title': 'Futurs sans escale', 'authors': ['ANTHOLOGIE'] }, [ title_test("Futurs sans escale", exact=True), authors_test(['ANTHOLOGIE']), series_test('Isaac Asimov présente', 1) ]), ( # A book with ISBN specified {
if __name__ == '__main__': # tests # To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin(Shelfari.name, [ (# A book with an ISBN {'identifiers':{'isbn': '9780385340588'}, 'title':'61 Hours', 'authors':['Lee Child']}, [title_test('61 Hours', exact=True), authors_test(['Lee Child']), series_test('Jack Reacher', 14.0)] ), (# A book throwing an index error {'title':'The Girl Hunters', 'authors':['Mickey Spillane']}, [title_test('The Girl Hunters', exact=True), authors_test(['Mickey Spillane']), series_test('Mike Hammer', 7.0)] ), (# A book with no ISBN specified {'title':"Playing with Fire", 'authors':['Derek Landy']}, [title_test("Playing with Fire", exact=True), authors_test(['Derek Landy']), series_test('Skulduggery Pleasant', 2.0)] ),
'authors':[u'구보 유키야'] }, [ title_test(u'세상에서 가장 쉬운 회계학', exact=True), authors_test([u'구보 유키야', u'안혜은(역자)']) ] ), (# 테메레르 6권 { 'title':u"테메레르 큰바다뱀", }, [ title_test(u"테메레르 6권 - 큰바다뱀들의 땅", exact=True), authors_test([u'나오미 노빅', u'공보경(역자)']), series_test(u'테메레르', 6.0) ] ), (# 나홀로 여행 컨설팅북 { 'title':u"나홀로 여행 컨설팅북", }, [ title_test(u"나홀로 여행 컨설팅북", exact=True), authors_test([u'이주영']), ] ) ], fail_missing_meta=False)
{'title':'11/22/63'}, [title_test('11/22/63: A Novel', exact=True), authors_test(['Stephen King']),] ), ( # + in title and uses id="main-image" for cover {'title':'C++ Concurrency in Action'}, [title_test('C++ Concurrency in Action: Practical Multithreading', exact=True), ] ), ( # Series {'identifiers':{'amazon':'0756407117'}}, [title_test( "Throne of the Crescent Moon", exact=True), series_test('Crescent Moon Kingdoms', 1), comments_test('Makhslood'), ] ), ( # Different comments markup, using Book Description section {'identifiers':{'amazon':'0982514506'}}, [title_test( "Griffin's Destiny: Book Three: The Griffin's Daughter Trilogy", exact=True), comments_test('Jelena'), comments_test('Leslie'), ] ), ( # # in title {'title':'Expert C# 2008 Business Objects',
( # + in title and uses id="main-image" for cover { 'title': 'C++ Concurrency in Action' }, [ title_test( 'C++ Concurrency in Action: Practical Multithreading', exact=True), ]), ( # Series { 'identifiers': { 'amazon': '0756407117' } }, [ title_test("Throne of the Crescent Moon", exact=True), series_test('Crescent Moon Kingdoms', 1), comments_test('Makhslood'), ]), ( # Different comments markup, using Book Description section { 'identifiers': { 'amazon': '0982514506' } }, [ title_test( "Griffin's Destiny: Book Three: The Griffin's Daughter Trilogy", exact=True), comments_test('Jelena'), comments_test('Leslie'), ]), ( # # in title
# To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin( CBDB.name, [ ( # A book throwing an index error { 'title': 'The Girl Hunters', 'authors': ['Mickey Spillane'] }, [ title_test('The Girl Hunters', exact=True), authors_test(['Mickey Spillane']), series_test('Mike Hammer', 7.0) ]), ( # A book with no ISBN specified { 'title': "Harry Potter and the Sorcerer's Stone", 'authors': ['J.K. Rowling'] }, [ title_test("Harry Potter and the Sorcerer's Stone", exact=True), authors_test(['J. K. Rowling']), series_test('Harry Potter', 1.0) ]), ( # A book with an ISBN { 'identifiers': { 'isbn': '9780385340588'
except: log.exception('Failed to download cover from:', cached_url) if __name__ == '__main__': # tests # To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin(Goodreads.name, [ ( # A book throwing an index error {'title':'The Girl Hunters', 'authors':['Mickey Spillane']}, [title_test('The Girl Hunters', exact=True), authors_test(['Mickey Spillane']), series_test('Mike Hammer', 7.0)] ), ( # A book with no ISBN specified {'title':"Harry Potter and the Sorcerer's Stone", 'authors':['J.K. Rowling']}, [title_test("Harry Potter and the Sorcerer's Stone", exact=True), authors_test(['J. K. Rowling']), series_test('Harry Potter', 1.0)] ), ( # A book with an ISBN {'identifiers':{'isbn': '9780385340588'}, 'title':'61 Hours', 'authors':['Lee Child']}, [title_test('61 Hours', exact=True), authors_test(['Lee Child']),
from calibre.ebooks.metadata.sources.test import test_identify_plugin, title_test, authors_test, series_test test_identify_plugin( BeamEbooks.name, [ ( # A Perry Rhodan book with a beam ebooks id, old naming convention { "identifiers": {"beam-ebooks": "12748"}, "title": "Invasion aus dem All", "authors": ["Clark Darlton"], }, [ title_test("PR0007 - Invasion aus dem All", exact=True), authors_test(["Clark Darlton"]), series_test("Perry Rhodan, Die dritte Macht", 7.0), ], ), ( # A Perry Rhodan book with a beam ebooks id, new naming convention { "identifiers": {"beam-ebooks": "19938"}, "title": "PERRY RHODAN-Heftroman 2601: Galaxis in Aufruhr", "authors": ["Leo Lukas"], }, [ title_test("PR2601 - Galaxis in Aufruhr", exact=True), authors_test(["Leo Lukas"]), series_test("Perry Rhodan, Neuroversum", 2601.0), ], ),
} }, [ title_test(u'정의란 무엇인가', exact=True), authors_test([u'마이클 샌델', u'김명철(역자)']) ]), ( # 세상에서 제일 쉬운 회계학 { 'title': u'회계학', 'authors': [u'구보 유키야'] }, [ title_test(u'세상에서 가장 쉬운 회계학', exact=True), authors_test([u'구보 유키야', u'안혜은(역자)']) ]), ( # 테메레르 6권 { 'title': u"테메레르 큰바다뱀", }, [ title_test(u"테메레르 6권 - 큰바다뱀들의 땅", exact=True), authors_test([u'나오미 노빅', u'공보경(역자)']), series_test('테메레르', 6.0) ]), ( # 나홀로 여행 컨설팅북 { 'title': u"나홀로 여행 컨설팅북", }, [ title_test(u"나홀로 여행 컨설팅북", exact=True), authors_test([u'이주영']), ]) ], fail_missing_meta=False)
series_test) test_identify_plugin( Shelfari.name, [ ( # A book with an ISBN { 'identifiers': { 'isbn': '9780385340588' }, 'title': '61 Hours', 'authors': ['Lee Child'] }, [ title_test('61 Hours', exact=True), authors_test(['Lee Child']), series_test('Jack Reacher', 14.0) ]), ( # A book throwing an index error { 'title': 'The Girl Hunters', 'authors': ['Mickey Spillane'] }, [ title_test('The Girl Hunters', exact=True), authors_test(['Mickey Spillane']), series_test('Mike Hammer', 7.0) ]), ( # A book with no ISBN specified { 'title': "Playing with Fire", 'authors': ['Derek Landy'] }, [
except: log.exception('Failed to download cover from:', cached_url) # }}} if __name__ == '__main__': # tests {{{ # To run these test use: calibre-debug -e # src/calibre/ebooks/metadata/sources/amazon.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, isbn_test, title_test, authors_test, comments_test, series_test) com_tests = [ # {{{ ( # Series {'identifiers':{'amazon':'0756407117'}}, [title_test( "Throne of the Crescent Moon" , exact=True), series_test('Crescent Moon Kingdoms', 1), comments_test('Makhslood'), ] ), ( # Different comments markup, using Book Description section {'identifiers':{'amazon':'0982514506'}}, [title_test( "Griffin's Destiny: Book Three: The Griffin's Daughter Trilogy" , exact=True), comments_test('Jelena'), comments_test('Leslie'), ] ), ( # # in title {'title':'Expert C# 2008 Business Objects',
if __name__ == '__main__': # tests # To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin(Kyobobook.name, [ # 원제 꼭지가 붙어 있다. # 장 코르미에 (지은이) | 김미선 (옮긴이) | 실천문학사 | 2005-05-25 | 원제 Che Guevara (2002년) (# A book with an ISBN {'identifiers':{'isbn': '9788939205109'}, 'title':'체 게바라', 'authors':['장 코르미에']}, [title_test('체 게바라 평전', exact=True), authors_test(['장 코르미에','김미선']), series_test('역사인물찾기', 10.0)] ), (# A book with an kyobobook id {'identifiers':{'kyobobook': '9788932008486'}}, [title_test('광장/구운몽', exact=True), authors_test(['최인훈']), ] ), (# A book with title and author {'identifiers':{'isbn': '9788936470111'}}, [title_test('나의 문화유산답사기 1', exact=False), authors_test(['유홍준'])] ), # 9788936470111
from calibre.ebooks.metadata.sources.test import (test_identify_plugin, isbn_test, title_test, authors_test, comments_test, series_test) com_tests = [ # {{{ ( # Paperback with series { 'identifiers': { 'amazon': '1423146786' } }, [ title_test( 'The Heroes of Olympus, Book Five The Blood of Olympus', exact=True), series_test('Heroes of Olympus', 5) ]), ( # Kindle edition with series { 'identifiers': { 'amazon': 'B0085UEQDO' } }, [ title_test('Three Parts Dead', exact=True), series_test('Craft Sequence', 1) ]), ( # A kindle edition that does not appear in the search results when searching by ASIN { 'identifiers': { 'amazon': 'B004JHY6OG' }
'authors':[u'구보 유키야'] }, [ title_test(u'세상에서 가장 쉬운 회계학', exact=True), authors_test([u'구보 유키야', u'안혜은(역자)']) ] ), (# 테메레르 6권 { 'title':u"테메레르 큰바다뱀", }, [ title_test(u"테메레르 6권 - 큰바다뱀들의 땅", exact=True), authors_test([u'나오미 노빅', u'공보경(역자)']), series_test('테메레르', 6.0) ] ), (# 나홀로 여행 컨설팅북 { 'title':u"나홀로 여행 컨설팅북", }, [ title_test(u"나홀로 여행 컨설팅북", exact=True), authors_test([u'이주영']), ] ) ], fail_missing_meta=False)
log.exception('Failed to download cover from:', cached_url) if __name__ == '__main__': # tests # To run these test use: # calibre-debug -e __init__.py from calibre.ebooks.metadata.sources.test import (test_identify_plugin, title_test, authors_test, series_test) test_identify_plugin(Legie.name, [ ( # A book with no id specified {'title':"Poslední obyvatel z planety Zwor", 'authors':['Jean-pierre Garen']}, [title_test("Poslední obyvatel z planety Zwor", exact=True), authors_test(['Jean-pierre Garen']), series_test('Mark Stone - Kapitán Služby pro dohled nad primitivními planetami', 1.0)] ), ( # Multiple answers {'title':'Čaroprávnost'}, [title_test('Čaroprávnost', exact=True), authors_test(['Terry Pratchett']), series_test('Úžasná Zeměplocha', 3.0)] ), ( # Book with given id and edition year {'identifiers':{'legie': '103#1996'},'title':'Čaroprávnost'}, [title_test('Čaroprávnost', exact=True), authors_test(['Terry Pratchett']),