Пример #1
0
 def test_fail_applicant_two_passing_one_failing_criteria(self):
   self.assertEqual((EvaluationResult.FAIL,
   'Applicant has no criminal record, Applicant has previous employment, Applicant do not have valid working visa'),
     evaluate_applicant(self.applicant, ['Criminal Record Check', 'Employment Check', 'Visa Status Check']))
sys.path.insert(
    0,
    os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
                 'src'))

from applicant.evaluate_applicant import evaluate_applicant, get_criteria
from applicant.applicant import Applicant

if __name__ == '__main__':
    print('\nPlease select the criteria by yes [y] or no [n]')

    selected_criteria = []
    for criterion_name, criterion in get_criteria().items():
        print('\nDo you want to include the criteria "' + criterion_name +
              '"? [y/n]')

        user_input = input()
        while user_input not in ['y', 'n']:
            print('\nPlease provide y or n only!')
            user_input = input()

        if user_input == 'y':
            selected_criteria.append(criterion)

    evaluation_status, evaluation_details = evaluate_applicant(
        Applicant(), selected_criteria)

    print('\nEvaluation Status: ' + evaluation_status.name.title())
    print('Evaluation Details: ' + evaluation_details + '\n')
Пример #3
0
 def test_pass_applicant_two_passing_criteria(self):
   self.assertEqual(
     (EvaluationResult.PASS, 'Applicant has no criminal record, Applicant has previous employment'),
     evaluate_applicant(self.applicant, ['Criminal Record Check', 'Employment Check']))
Пример #4
0
 def test_fail_applicant_two_failing_criteria(self):
   self.assertEqual(
     (EvaluationResult.FAIL, 'Applicant has suspicious credit history, Applicant do not have valid working visa'),
     evaluate_applicant(self.applicant, ['Credit Check', 'Visa Status Check']))
Пример #5
0
 def test_fail_applicant_one_failing_criteria(self):
   self.assertEqual((EvaluationResult.FAIL, 'Applicant has suspicious credit history'),
     evaluate_applicant(self.applicant, ['Credit Check']))
Пример #6
0
 def test_pass_applicant_one_passing_criteria(self):
   self.assertEqual((EvaluationResult.PASS, 'Applicant has no criminal record'),
     evaluate_applicant(self.applicant, ['Criminal Record Check']))
Пример #7
0
 def test_applicant_empty_criteria(self):
   self.assertEqual((EvaluationResult.FAIL, 'No criteria was provided'),
     evaluate_applicant(self.applicant, []))
Пример #8
0
 def test_fail_applicant_invalid_criteria(self):
   self.assertEqual((EvaluationResult.FAIL, 'Invalid record found at least for one criteria'),
     evaluate_applicant(self.applicant, [formal_education_check]))
Пример #9
0
 def test_fail_applicant_two_passing_one_failing_criteria(self):
   self.assertEqual((EvaluationResult.FAIL,
   'Applicant has no criminal record, Applicant has previous employment, Applicant do not have valid working visa'),
     evaluate_applicant(self.applicant, [criminal_record_check, employment_check, visa_status_check]))