Skip to content

Commit

Permalink
Merge pull request #1046 from facebookresearch/add-prolific-unittests
Browse files Browse the repository at this point in the history
Add unittests for Prolific integration
  • Loading branch information
JackUrb authored Aug 10, 2023
2 parents 24905d7 + ff8460b commit 3b49915
Show file tree
Hide file tree
Showing 2 changed files with 726 additions and 29 deletions.
6 changes: 4 additions & 2 deletions mephisto/abstractions/providers/prolific/prolific_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ def compose_completion_codes(code_suffix: str) -> List[dict]:
external_study_url = _get_external_study_url(task_run_config)
prolific_id_option = task_run_config.provider.prolific_id_option

eligibility_requirements = eligibility_requirements or []
prolific_eligibility_requirements = _convert_eligibility_requirements(eligibility_requirements)

# Initially provide a random completion code during study
Expand Down Expand Up @@ -451,7 +452,7 @@ def compose_completion_codes(code_suffix: str) -> List[dict]:
return study


def increase_total_available_places_for_study(client: ProlificClient, study_id: str) -> str:
def increase_total_available_places_for_study(client: ProlificClient, study_id: str) -> Study:
study: Study = get_study(client, study_id)

try:
Expand All @@ -462,7 +463,8 @@ def increase_total_available_places_for_study(client: ProlificClient, study_id:
except (ProlificException, ValidationError):
logger.exception(f'Could not increase `total_available_places` for a Study "{study_id}"')
raise
return study_id

return study


def get_study(client: ProlificClient, study_id: str) -> Study:
Expand Down
Loading

0 comments on commit 3b49915

Please sign in to comment.