pull/174/head
Cullen Watson 2024-07-19 14:17:21 -05:00
parent 0ed051c26b
commit e730bc7486
5 changed files with 10 additions and 14 deletions

View File

@ -5,10 +5,10 @@ import pandas as pd
def test_all(): def test_all():
result = scrape_jobs( result = scrape_jobs(
site_name=["linkedin", "indeed", "zip_recruiter", "glassdoor"], site_name=["linkedin", "indeed", "zip_recruiter", "glassdoor"],
search_term="software engineer", search_term="engineer",
results_wanted=5, results_wanted=5,
) )
assert ( assert (
isinstance(result, pd.DataFrame) and not result.empty isinstance(result, pd.DataFrame) and len(result) == 5
), "Result should be a non-empty DataFrame" ), "Result should be a non-empty DataFrame"

View File

@ -2,13 +2,12 @@ from ..jobspy import scrape_jobs
import pandas as pd import pandas as pd
def test_indeed(): def test_glasdoor():
result = scrape_jobs( result = scrape_jobs(
site_name="glassdoor", site_name="glassdoor",
search_term="software engineer", search_term="engineer",
country_indeed="USA",
results_wanted=5, results_wanted=5,
) )
assert ( assert (
isinstance(result, pd.DataFrame) and not result.empty isinstance(result, pd.DataFrame) and len(result) == 5
), "Result should be a non-empty DataFrame" ), "Result should be a non-empty DataFrame"

View File

@ -5,10 +5,9 @@ import pandas as pd
def test_indeed(): def test_indeed():
result = scrape_jobs( result = scrape_jobs(
site_name="indeed", site_name="indeed",
search_term="software engineer", search_term="engineer",
country_indeed="usa",
results_wanted=5, results_wanted=5,
) )
assert ( assert (
isinstance(result, pd.DataFrame) and not result.empty isinstance(result, pd.DataFrame) and len(result) == 5
), "Result should be a non-empty DataFrame" ), "Result should be a non-empty DataFrame"

View File

@ -3,9 +3,7 @@ import pandas as pd
def test_linkedin(): def test_linkedin():
result = scrape_jobs( result = scrape_jobs(site_name="linkedin", search_term="engineer", results_wanted=5)
site_name="linkedin", search_term="software engineer", results_wanted=5
)
assert ( assert (
isinstance(result, pd.DataFrame) and not result.empty isinstance(result, pd.DataFrame) and len(result) == 5
), "Result should be a non-empty DataFrame" ), "Result should be a non-empty DataFrame"

View File

@ -8,5 +8,5 @@ def test_ziprecruiter():
) )
assert ( assert (
isinstance(result, pd.DataFrame) and not result.empty isinstance(result, pd.DataFrame) and len(result) == 5
), "Result should be a non-empty DataFrame" ), "Result should be a non-empty DataFrame"