JobSpy/tests/test_all.py

19 lines
452 B
Python
Raw Permalink Normal View History

2024-10-19 14:56:38 -07:00
from jobspy import scrape_jobs
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,
)
assert (
2024-10-19 16:01:59 -07:00
isinstance(result, pd.DataFrame) and len(result) == len(sites) * 5
), "Result should be a non-empty DataFrame"