Beispiel #1
0
class EmailTestCase(object):


    def __init__(self):
        self.App = Main.Main()
        self.email_fixtures = EmailFixtures()
        self.email_notification = EmailNotification.EmailNotification()
        pass

    def test_testing_email(self):
        """
        Testing Email

        @return: None
        """
        print('Testing Email..........!')
        response = self.email_notification.TestingEmail(self.email_fixtures.recipients, 'Testing the Email', self.email_fixtures.EmailInformation())

        print("---------------------------------------------------------------------\n")

        return [response, ExpectedResults.EmailTestCaseExpectedResult['testing'], FailedMessages.EmailTestCaseFailMessages['testing']]
        pass

    def test_attachment_email(self):
        """
        Test Attachment Email

        @return: None
        """
        print('Attachment Email..........!')
        self.email_fixtures.load_attachment()
        response = self.email_notification.ReportEmail(self.email_fixtures.recipients, self.email_fixtures.attachment ,'Testing the Email' ,self.email_fixtures.EmailInformation(), self.email_fixtures.project_name)
        self.email_fixtures.unload_attachment()

        print("---------------------------------------------------------------------\n")

        return [response, ExpectedResults.EmailTestCaseExpectedResult['attachment'], FailedMessages.EmailTestCaseFailMessages['attachment']]

    def test_Error_email(self):
        """
        Test Error Email

        @return: None
        """
        print('Error Email..........!')
        self.email_fixtures.load_attachment()
        response = self.email_notification.ErrorEmail(self.email_fixtures.recipients, self.email_fixtures.attachment ,'Testing the Email' ,self.email_fixtures.EmailInformation(), self.email_fixtures.project_name)
        self.email_fixtures.unload_attachment()

        print("---------------------------------------------------------------------\n")

        return [response, ExpectedResults.EmailTestCaseExpectedResult['error'], FailedMessages.EmailTestCaseFailMessages['error']]
Beispiel #2
0
    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']]
Beispiel #3
0
 def __init__(self):
     self.App = Main.Main()
     self.email_fixtures = EmailFixtures()
     self.email_notification = EmailNotification.EmailNotification()
     pass
Beispiel #4
0
class EmailTestCase(object):
    def __init__(self):
        self.App = Main.Main()
        self.email_fixtures = EmailFixtures()
        self.email_notification = EmailNotification.EmailNotification()
        pass

    def test_testing_email(self):
        """
        Testing Email

        @return: None
        """
        print('Testing Email..........!')
        response = self.email_notification.TestingEmail(
            self.email_fixtures.recipients, 'Testing the Email',
            self.email_fixtures.EmailInformation())

        print(
            "---------------------------------------------------------------------\n"
        )

        return [
            response, ExpectedResults.EmailTestCaseExpectedResult['testing'],
            FailedMessages.EmailTestCaseFailMessages['testing']
        ]
        pass

    def test_attachment_email(self):
        """
        Test Attachment Email

        @return: None
        """
        print('Attachment Email..........!')
        self.email_fixtures.load_attachment()
        response = self.email_notification.ReportEmail(
            self.email_fixtures.recipients, self.email_fixtures.attachment,
            'Testing the Email', self.email_fixtures.EmailInformation(),
            self.email_fixtures.project_name)
        self.email_fixtures.unload_attachment()

        print(
            "---------------------------------------------------------------------\n"
        )

        return [
            response,
            ExpectedResults.EmailTestCaseExpectedResult['attachment'],
            FailedMessages.EmailTestCaseFailMessages['attachment']
        ]

    def test_Error_email(self):
        """
        Test Error Email

        @return: None
        """
        print('Error Email..........!')
        self.email_fixtures.load_attachment()
        response = self.email_notification.ErrorEmail(
            self.email_fixtures.recipients, self.email_fixtures.attachment,
            'Testing the Email', self.email_fixtures.EmailInformation(),
            self.email_fixtures.project_name)
        self.email_fixtures.unload_attachment()

        print(
            "---------------------------------------------------------------------\n"
        )

        return [
            response, ExpectedResults.EmailTestCaseExpectedResult['error'],
            FailedMessages.EmailTestCaseFailMessages['error']
        ]
Beispiel #5
0
 def __init__(self):
     self.App = Main.Main()
     self.email_fixtures = EmailFixtures()
     self.email_notification = EmailNotification.EmailNotification()
     pass