2024-10-19 14:56:38 -07:00
|
|
|
from jobspy import scrape_jobs
|
2023-09-28 16:11:28 -07:00
|
|
|
import pandas as pd
|
2023-09-06 16:32:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
def test_all():
|
2024-10-19 16:01:59 -07:00
|
|
|
sites = [
|
|
|
|
"indeed",
|
|
|
|
"glassdoor",
|
|
|
|
] # ziprecruiter/linkedin needs good ip, and temp fix to pass test on ci
|
2023-09-06 16:32:51 -07:00
|
|
|
result = scrape_jobs(
|
2024-10-19 16:01:59 -07:00
|
|
|
site_name=sites,
|
2024-07-19 12:25:25 -07:00
|
|
|
search_term="engineer",
|
2023-09-06 16:32:51 -07:00
|
|
|
results_wanted=5,
|
|
|
|
)
|
2023-09-28 16:11:28 -07:00
|
|
|
|
2023-10-10 09:23:04 -07:00
|
|
|
assert (
|
2024-10-19 16:01:59 -07:00
|
|
|
isinstance(result, pd.DataFrame) and len(result) == len(sites) * 5
|
2023-10-10 09:23:04 -07:00
|
|
|
), "Result should be a non-empty DataFrame"
|