def change_algorithm(self, project_name): """ Change Algorithm @param project_name: project name to be Changed Algorithm """ print('Test Change Project Algorithm .........!') algo_value_selected = 'md5' flag = True self.project_fixtures.load_verification_algorithm_data() self.project_fixtures.create_new_project(project_name) project_core = self.App.Fixity.ProjectRepo.getSingleProject(project_name) result_of_all_file_confirmed = project_core.Run(True) if bool(result_of_all_file_confirmed['file_changed_found']): email_fixtures = EmailFixtures() self.App.Fixity.Configuration.setEmailConfiguration(email_fixtures.EmailInformation()) flag = False update_project_algo = {} update_project_algo['selectedAlgo'] = algo_value_selected self.App.Fixity.Database.update(self.App.Fixity.Database._tableProject, update_project_algo, "id='" + str(project_core.getID()) + "'") project_core.setAlgorithm(algo_value_selected) result_of_all_file_confirmed_second = project_core.Run(True, False, True) try: self.project_fixtures.delete_testing_data() except: pass if bool(result_of_all_file_confirmed_second['file_changed_found']): flag = False print("---------------------------------------------------------------------\n") return [flag, ExpectedResults.ProjectTestCaseExpectedResult['change_algorithm'], FailedMessages.ProjectTestCaseFailMessages['change_algorithm']]
def __init__(self): self.App = Main.Main() self.email_fixtures = EmailFixtures() self.email_notification = EmailNotification.EmailNotification() pass