Skip to content

Instantly share code, notes, and snippets.

@mford22392
Last active March 20, 2020 20:39
Show Gist options
  • Save mford22392/7176fb49cba0b6fcaf573749a62af0c9 to your computer and use it in GitHub Desktop.
Save mford22392/7176fb49cba0b6fcaf573749a62af0c9 to your computer and use it in GitHub Desktop.
# Note: in the following sections, not every single combination of coach_recs, bookmarks and quiz_results is tested
# Essentially, coach recs, bookmarks and quiz results will always obey that order
# If one or more should not show, they just dont show, but the order of the others is unchanged
##############################
# User has no applications #
##############################
# 1. User answers 1-3 on influencer question
# 1a. No coach recs, bookmarks, or quiz results
def test_no_applications_answer_one_a():
influencer_answer = "I want to go back to school, and I know what type of program, degree, or certificate I want to complete"
apps_to_finish = False
completed_apps = False
coach_recs = []
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['quiz', 'contact', 'reimbursement']
# 1b. Coach recs but no bookmarks, or quiz results
def test_no_applications_answer_one_b():
influencer_answer = "I want to go back to school, and I know what type of program, degree, or certificate I want to complete"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'quiz', 'contact', 'reimbursement']
# 1c. Coach recs and bookmarks, but no quiz results
def test_no_applications_answer_one_c():
influencer_answer = "I want to go back to school, and I know what type of program, degree, or certificate I want to complete"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'bookmarks', 'quiz', 'contact', 'reimbursement']
# 1d. Coach recs, bookmarks, and quiz results
def test_no_applications_answer_one_d():
influencer_answer = "I want to go back to school, and I know what type of program, degree, or certificate I want to complete"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = ["foo"]
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'bookmarks', 'quiz_recommendations', 'contact', 'reimbursement']
# 2. User answers 4 on influencer question
# 2a. No coach recs, bookmarks, or quiz results
def test_no_applications_answer_four_a():
influencer_answer = "I'm honestly not sure about going back to school"
apps_to_finish = False
completed_apps = False
coach_recs = []
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['contact', 'quiz', 'reimbursement']
# 2b. Coach recs but no bookmarks, or quiz results
def test_no_applications_answer_four_b():
influencer_answer = "I'm honestly not sure about going back to school"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'contact', 'quiz', 'reimbursement']
# 2c. Coach recs and bookmarks, but no quiz results
def test_no_applications_answer_four_c():
influencer_answer = "I'm honestly not sure about going back to school"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'bookmarks', 'contact', 'quiz', 'reimbursement']
# 2d. Coach recs, bookmarks, and quiz results
def test_no_applications_answer_four_d():
influencer_answer = "I'm honestly not sure about going back to school"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = ["foo"]
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['coach_recommendations', 'bookmarks', 'quiz_recommendations', 'contact', 'reimbursement']
# 3. User answers 5 on influencer question
# 3a. No coach recs, bookmarks, or quiz results
def test_no_applications_answer_five_a():
influencer_answer = "I'd like to submit reimbursement costs for existing programs"
apps_to_finish = False
completed_apps = False
coach_recs = []
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['reimbursement', 'contact']
# 3b. Coach recs but no bookmarks, or quiz results
def test_no_applications_answer_five_b():
influencer_answer = "I'd like to submit reimbursement costs for existing programs"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = []
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['reimbursement', 'contact', 'coach_recommendations']
# 3c. Coach recs and bookmarks, but no quiz results
def test_no_applications_answer_five_c():
influencer_answer = "I'd like to submit reimbursement costs for existing programs"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = []
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['reimbursement', 'contact', 'coach_recommendations', 'bookmarks']
# 3d. Coach recs, bookmarks, and quiz results
def test_no_applications_answer_five_d():
influencer_answer = "I'd like to submit reimbursement costs for existing programs"
apps_to_finish = False
completed_apps = False
coach_recs = ["foo"]
bookmarks = ["foo"]
quiz_results = ["foo"]
data = set_data(influencer_answer, apps_to_finish, completed_apps, coach_recs, bookmarks, quiz_results)
result = WeightingService(data).call()[0]["children"]
assert sort_keys(result) == ['reimbursement', 'contact', 'coach_recommendations', 'bookmarks', 'quiz_recommendations']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment