@@ -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 )
1824class 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