def pytest_funcarg__anidb_anime(request): return _handle_response(Response( """<?xml version="1.0" encoding="UTF-8"?> <anime id="0" restricted = "false"> <type>TV Series</type> <episodecount>1</episodecount> <startdate>1990-01-01</startdate> <enddate>1990-01-02</enddate> <ratings> <permanent count="7">1.0</permanent> </ratings> <categories> <category id="1" parentid="2" hentai="true" weight="100"> <name>test</name> <description>test category</description> </category> </categories> <episodes> <episode id="1"> <epno>1</epno> <length>2</length> <airdate>1999-01-01</airdate> <rating votes="12">1.0</rating> <title xml:lang="en">fooep</title> </episode> </episodes> <tags> <tag id="1" approval="20" spoiler="true"> <name>foo</name> <count>10</count> </tag> </tags> </anime> """))
def pytest_funcarg__search_anime(request): response = Response(\ """<?xml version="1.0" encoding="UTF-8"?> <anime aid="0"> <title type="main" lang="x-jat" exact="exact">Title1</title> <title type="syn" lang="x-jat">SynTitle</title> </anime> """) return _handle_response(response)
def test_banned(): xml = Response("<error>Banned</error>") with pytest.raises(anidb.exceptions.BannedException): _handle_response(xml)
def test_codes(): r = Response("", 404) anime = _handle_response(r) assert anime is None