mirror of https://github.com/stijndcl/didier
Test sporza html scraper
parent
49aaa76aff
commit
02ea90ec6a
|
@ -1,7 +1,6 @@
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import re
|
import re
|
||||||
from requests import get
|
from requests import get
|
||||||
from urllib.parse import urlencode
|
|
||||||
|
|
||||||
|
|
||||||
def getMatchweek():
|
def getMatchweek():
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
from functions.scrapers import sporza
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
|
class TestSporzaScraper(unittest.TestCase):
|
||||||
|
def test_find_matchweek(self):
|
||||||
|
"""
|
||||||
|
This tests if the structure of the HTML is still what we expect it to be,
|
||||||
|
as Sporza changes it from time to time.
|
||||||
|
"""
|
||||||
|
# This will throw an error if the argument was not a proper integer
|
||||||
|
week = int(sporza.getMatchweek())
|
||||||
|
self.assertGreater(week, 0)
|
Loading…
Reference in New Issue