def test_agency_evaluate_gets_passed_1_criteria_and_fails(self): class Test_criteria_1: def validate(self, ss_num): return (False, 'This is a Test.') exspected_response = {'valid': False, 'reasons': ['This is a Test.']} response = evaluate(Test_criteria_1, ss_num='Fake Social') self.assertEquals(response, exspected_response)
def test_agency_evaluate_with_criteria_returns_true_for_valid_candidate( self): exspected_response = {'valid': True} response = evaluate(Credit, Employment, Criminal, Citizenship, ss_num='555-55-5555') self.assertEquals(response, exspected_response)
def test_agency_evaluate_with_criteria_returns_false_and_1_reason_for_invalid_candidate( self): exspected_response = {'valid': False, 'reasons': ['Poor Credit.']} response = evaluate(Credit, Employment, Criminal, Citizenship, ss_num='155-55-5555') self.assertEquals(response, exspected_response)
def test_agency_evaluate_gets_passed_multiple_criteria_and_passes(self): class Test_criteria_1: def validate(self, ss_num): return True class Test_criteria_2: def validate(self, ss_num): return True exspected_response = {'valid': True} response = evaluate(Test_criteria_1, Test_criteria_2, ss_num='Fake Social') self.assertEquals(response, exspected_response)