Skip to content

Commit

Permalink
Added unittests for Prolific integration
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-paul committed Aug 9, 2023
1 parent 238f832 commit ff8460b
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 ff8460b

Please sign in to comment.