def test_case01(): doujin = NHentai().get_random() assert doujin.get('id') is not None assert doujin.get('title') is not None assert doujin.get('secondary_title') is not None assert doujin.get('tags') is not None assert doujin.get('artists') is not None assert doujin.get('languages') is not None assert doujin.get('categories') is not None assert doujin.get('pages') is not None assert doujin.get('images') is not None
def test_payload_integrity(): pages = NHentai().get_pages() doujins = pages.get('doujins', []) for doujin in doujins: assert doujin.get('id') != None assert doujin.get('title') != None assert doujin.get('lang') != None assert doujin.get('cover') != None assert doujin.get('data-tags') != None
def test_case07(): search = NHentai().search('full color') assert len(search.get('doujins')) > 0
def test_case06(): search = NHentai().search('auhdasudhudasd') assert len(search.get('doujins')) == 0
def test_case03(): search = NHentai().search('naruto') assert len(search.get('doujins')) > 0
def test_case02(): search = NHentai().search('658468468') assert len(search.get('doujins')) == 0
def test_user_payload_integrity(): user = NHentai().get_user_page('3438840', 'kenzinho_boca_de_veludo') assert user.get('uid') != None assert user.get('username') != None assert user.get('since') != None