Skip to content

Commit 2698738

Browse files
committed
-More strict test for job id
-TODO:Revise code before pushing -TODO:Make sure to update readme for Docker docs -TODO:Make sure to update readme for Docker docs -TODO:Update readme on new GlassDoor scrapers
1 parent bd31f1c commit 2698738

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/test_indeed.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ def get_number_of_pages_mock(mock_soup, mock_max):
1111
"""
1212
mock get_number_of_pages to ensure we only scrape no more than 1 page.
1313
"""
14-
return
14+
return 1
1515

1616

1717
#test the correctness of search_tems since our tests depend on it
1818

1919
def test_search_terms(init_scraper):
2020
indeed = init_scraper('indeed')
21-
21+
assert indeed.search_terms == { 'region': {'province':'ON',
22+
'city':'waterloo', 'domain':'ca', 'radius':25}, 'keywords':['Python']}
2223

2324
@pytest.mark.parametrize('search_terms_config', search_term_configs)
2425
class TestClass():
@@ -165,7 +166,6 @@ def test_get_id(self, setup_scraper, search_terms_config):
165166
try:
166167
job['id'] = provider.get_id(soup)
167168
except:
168-
job['id'] = ''
169169
assert False
170170
assert True
171171

@@ -183,9 +183,6 @@ def test_get_link(self, setup_scraper, search_terms_config):
183183
job['link'] = provider.get_link(job['id'])
184184
except AttributeError:
185185
continue
186-
# TODO:Maybe the testing for links could be made more realiable
187-
# by having statistics on them such as '8/10 links passed' given that the link is probably the
188-
# most essential piece of data for users
189186
if(0 < len(job['link'])):
190187
assert True
191188
return

0 commit comments

Comments
 (0)