1
# -*- coding: utf-8 -*-
3
# Copyright 2012-2015 Facundo Batista
1
# Copyright 2012-2017 Facundo Batista
5
3
# This program is free software: you can redistribute it and/or modify it
6
4
# under the terms of the GNU General Public License version 3, as published
201
199
"""Tests for the scrapers."""
203
201
def test_example_list_1(self):
204
html = open("tests/ej-bacua-list_1.html").read()
202
html = open("tests/ej-bacua-list_1.html", 'rb').read()
205
203
res = get_bacua_episodes.scrap_list_page(html)
206
204
self.assertEqual(res, _RES_LIST_1)
208
206
def test_example_page_1(self):
209
html = open("tests/ej-bacua-page_1.html").read()
207
html = open("tests/ej-bacua-page_1.html", 'rb').read()
210
208
res = get_bacua_episodes.scrap_page(html)
211
209
self.assertEqual(res, _RES_PAGE_1)
213
211
def test_example_page_2(self):
214
html = open("tests/ej-bacua-page_2.html").read()
212
html = open("tests/ej-bacua-page_2.html", 'rb').read()
215
213
res = get_bacua_episodes.scrap_page(html)
216
214
self.assertEqual(res, _RES_PAGE_2)
218
216
def test_example_page_3(self):
219
html = open("tests/ej-bacua-page_3.html").read()
217
html = open("tests/ej-bacua-page_3.html", 'rb').read()
220
218
res = get_bacua_episodes.scrap_page(html)
221
219
self.assertEqual(res, _RES_PAGE_3)
223
221
def test_example_page_4(self):
224
html = open("tests/ej-bacua-page_4.html").read()
222
html = open("tests/ej-bacua-page_4.html", 'rb').read()
225
223
res = get_bacua_episodes.scrap_page(html)
226
224
self.assertEqual(res, _RES_PAGE_4)
228
226
def test_example_page_5(self):
229
html = open("tests/ej-bacua-page_5.html").read()
227
html = open("tests/ej-bacua-page_5.html", 'rb').read()
230
228
res = get_bacua_episodes.scrap_page(html)
231
229
# print("\n=== res", [sorted(x.items()) for x in res])
232
230
# print("=== RES", [sorted(x.items()) for x in _RES_PAGE_5])