Skip to content

Commit bd31f1c

Browse files
committed
-TODO: Have more strict tests for job id and link
-TODO:Revise code before pushing -TODO:Make sure to update readme for Docker docs -TODO:Update readme on new GlassDoor scrapers
1 parent 9310236 commit bd31f1c

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'region': {'province': '', 'city': 'new york', 'domain': 'com', 'radius': 25}}]
1414

1515

16-
@ pytest.fixture()
16+
@pytest.fixture()
1717
def configure_options():
1818
def setup(options: list):
1919
"""Assigns the options to argv(as if JobFunnel were called from the command line with those options)
@@ -26,7 +26,7 @@ def setup(options: list):
2626
return setup
2727

2828

29-
@ pytest.fixture()
29+
@pytest.fixture()
3030
def job_listings():
3131
def setup(attr_list: list):
3232
"""
@@ -48,7 +48,7 @@ def setup(attr_list: list):
4848
return setup
4949

5050

51-
@ pytest.fixture()
51+
@pytest.fixture()
5252
def per_id_job_listings(job_listings):
5353
def setup(attr_list: list, first_job_id: int = 0):
5454
"""

tests/test_indeed.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ 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 1
14+
return
15+
1516

17+
#test the correctness of search_tems since our tests depend on it
1618

19+
def test_search_terms(init_scraper):
20+
indeed = init_scraper('indeed')
21+
22+
1723
@pytest.mark.parametrize('search_terms_config', search_term_configs)
1824
class TestClass():
25+
26+
27+
1928
def test_convert_radius(self, init_scraper, search_terms_config):
2029
provider = init_scraper('indeed')
2130
provider.search_terms = search_terms_config
@@ -144,6 +153,8 @@ def test_get_date(self, setup_scraper, search_terms_config):
144153
return
145154
assert False
146155

156+
#TODO: Have more strict tests for job id and link
157+
147158
def test_get_id(self, setup_scraper, search_terms_config):
148159
scraper = setup_scraper('indeed')
149160
job_soup_list = scraper['job_list']
@@ -154,9 +165,9 @@ def test_get_id(self, setup_scraper, search_terms_config):
154165
try:
155166
job['id'] = provider.get_id(soup)
156167
except:
157-
pass
158-
#Temporary fix
159-
assert True
168+
job['id'] = ''
169+
assert False
170+
assert True
160171

161172
# test the process of fetching the link to a job
162173

@@ -172,7 +183,7 @@ def test_get_link(self, setup_scraper, search_terms_config):
172183
job['link'] = provider.get_link(job['id'])
173184
except AttributeError:
174185
continue
175-
# TODO:Maybe the testing for links could be made for realiable
186+
# TODO:Maybe the testing for links could be made more realiable
176187
# by having statistics on them such as '8/10 links passed' given that the link is probably the
177188
# most essential piece of data for users
178189
if(0 < len(job['link'])):

0 commit comments

Comments
 (0)