示例#1
0
    def __init__(self):
        super(AlgorithmTestCase, self).__init__()
        self.App = Main.Main()
        self.algorithm_fixtures = AlgorithmFixtures()
        self.project_fixtures = ProjectFixtures()

        pass
示例#2
0
    def __init__(self):
        super(AlgorithmTestCase,self).__init__()
        self.App = Main.Main()
        self.algorithm_fixtures = AlgorithmFixtures()
        self.project_fixtures = ProjectFixtures()

        pass
示例#3
0
    def setUp(self):
        """
        Set Up

        @return: None
        """
        print('Start Up')
        self.Fixtures = Fixtures()
        self.ProjectFixtures = ProjectFixtures()

        self.algorithm_test_case = AlgorithmTestCase()
        self.project_test_case = ProjectTestCase()
        self.email_test_case = EmailTestCase()
        self.requireds_creation_test_case = RequiredsCreationTestCase()
        self.App = Main.Main()
        self.App.Fixity.loadAllProjects()
        pass
示例#4
0
class AlgorithmTestCase(object):


    def __init__(self):
        super(AlgorithmTestCase,self).__init__()
        self.App = Main.Main()
        self.algorithm_fixtures = AlgorithmFixtures()
        self.project_fixtures = ProjectFixtures()

        pass

    def test_confirm_file(self):

        print('Test Confirm File {( Nothing is Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print("---------------------------------------------------------------------\n")
        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_confirm_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_file']]

    def test_confirm_file_is_special_chars(self):

        print('Test Confirm File {( Nothing is Changed )} .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print("---------------------------------------------------------------------\n")
        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_confirm_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_file']]

    def test_confirm_if_inode_changed_of_file(self):

        print('Test Confirm File {( I-Node is Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode(self.algorithm_fixtures.test_file_four)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3:moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_confirm_if_inode_changed_of_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_if_inode_changed_of_file']]

    def test_confirm_if_inode_changed_of_file_is_special_chars(self):

        print('Test Confirm File {( I-Node is Changed )} .........!')
        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode(self.algorithm_fixtures.test_file_four_special)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print("---------------------------------------------------------------------\n")
        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_confirm_if_inode_changed_of_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_if_inode_changed_of_file']]

    def test_delete_file(self):

        print('Test Delete File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.del_file(self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_delete_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_delete_file']]

    def test_delete_file_is_special_chars(self):

        print('Test Delete File .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.del_file(self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_delete_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_delete_file']]

    def test_change_file(self):
        print('Test Change File {( Only Hash Changed )}.........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file(self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_file']]

    def test_change_file_is_special_chars(self):
        print('Test Change File {( Only Hash Changed )}.........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file(self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_file']]

    def test_change_file_changed_hash_and_path(self):
        print('Test Change File  {( Hash and Path Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file_changed_hash_and_path(self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file_changed_hash_and_path'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_file_changed_hash_and_path']]

    def test_change_file_changed_hash_and_path_is_special_chars(self):
        print('Test Change File  {( Hash and Path Changed )} .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file_changed_hash_and_path(self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file_changed_hash_and_path'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_file_changed_hash_and_path']]

    def test_change_inode_and_hash_file(self):
        print('Test Change File  {( I-Node and Hash Changed )} .........!')

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode_and_hash(self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_inode_and_hash_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_inode_and_hash_file']]

    def test_change_inode_and_hash_file_is_special_chars(self):
        print('Test Change File  {( I-Node and Hash Changed )} .........!')
        print('With Special Characters')
        is_special_chars = True
        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode_and_hash(self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_inode_and_hash_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_inode_and_hash_file']]

    def test_new_file(self):
        print('Test New File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.new_file(self.algorithm_fixtures.test_file_one+'_new_file')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_new_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_new_file']]

    def test_new_file_is_special_chars(self):
        print('Test New File .........!')
        print('With Special Characters')
        is_special_chars = True

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.new_file(self.algorithm_fixtures.test_file_one_special+'_new_file')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_new_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_new_file']]

    def test_moved_file(self):
        print('Test Moved File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.rename_file(self.algorithm_fixtures.test_file_one,
                                            self.algorithm_fixtures.test_file_one + '_unit_test')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file']]

    def test_moved_file_to_new_directory(self):
        print('Test Moved File to New Directory .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.move_file_in_a_directory(self.algorithm_fixtures.test_file_three,
                                                         self.algorithm_fixtures.new_directory + '3.docx')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file_to_new_directory'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file_to_new_directory']]

    def test_moved_file_to_new_Directory_change_hash(self):
        print('Test Moved File to New Directory and changed hash .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.move_file_in_directory_and_change_hash(self.algorithm_fixtures.test_file_three,
                                                                       self.algorithm_fixtures.new_directory + '3.docx')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file_to_new_Directory_change_hash'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file_to_new_Directory_change_hash']]

    def test_moved_file_to_new_Directory_change_name_as_old(self):

        print('Test created new file New Directory and changed name as old .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.create_copy_of_a_file_removed_old_change_name_as_old()

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file_to_new_Directory_change_name_as_old'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file_to_new_Directory_change_name_as_old']]

    def test_moved_to_new_directory_change_name_as_old_and_content(self):
        print('Test created new file New Directory and changed name as old changed hash .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.create_copy_of_a_file_removed_old_change_name_as_old_change_content()

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_to_new_Directory_change_name_as_old_and_content'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_to_new_Directory_change_name_as_old_and_content']]

    def test_moved_file_is_special_chars(self):
        """
        Test Moved File Is Special Chars

        @return:
        """
        print('Test Moved File .........!')
        is_special_chars= True
        print('With Special Characters')

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.rename_file(self.algorithm_fixtures.test_file_one_special,
                                            self.algorithm_fixtures.test_file_one_special + '_unit_test')

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file']]

    def test_change_base_path(self):
        print('Test Changed bath Path .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_directory_path()

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        self.algorithm_fixtures.unit_test_folder = self.App.Fixity.Configuration.getUnit_test_folder()
        print("---------------------------------------------------------------------\n")

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_base_path'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_change_base_path']]

    def test_intersection_of_dir(self):

        print('test intersection of File .........!')
        base_path_of_unitest  = self.App.Fixity.Configuration.getBasePath()

        file_path_given_to_be_created1 = base_path_of_unitest+'test3' + os.sep + '1.docx'
        file_path_given_to_be_created2 = base_path_of_unitest+'test3' + os.sep + '2.docx'
        file_path_given_to_be_created3 = base_path_of_unitest+'test3' + os.sep + '3.docx'
        file_path_given_to_be_created4 = base_path_of_unitest+'test3' + os.sep + '4.txt'

        self.algorithm_fixtures.load_verification_algorithm_data()

        base_path = base_path_of_unitest+'test3'

        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(file_path_given_to_be_created1, base_path,
                                                                               '1 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(file_path_given_to_be_created2, base_path,
                                                                               '2 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(file_path_given_to_be_created3, base_path,
                                                                               '3 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(file_path_given_to_be_created4, base_path,
                                                                               '4 document')

        self.project_fixtures.create_new_project(self.algorithm_fixtures.project_name)
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_path_custom(base_path)

        report_info_two = self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test', base_path)

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.unit_test_folder = self.App.Fixity.Configuration.getUnit_test_folder()
        self.algorithm_fixtures.delete_testing_data()

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

        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed},
                ExpectedResults.AlgorithmTestCaseExpectedResult['test_intersection_of_dir'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_intersection_of_dir']]
示例#5
0
 def __init__(self):
     self.App = Main.Main()
     self.project_fixtures = ProjectFixtures()
     pass
示例#6
0
class ProjectTestCase(object):


    def __init__(self):
        self.App = Main.Main()
        self.project_fixtures = ProjectFixtures()
        pass

    def run_project(self, project_name):
        """
        Create New Project
        @param project_name:  project name to be ran
        @return:
        """
        
        print('Test Run Project.........!')
        self.project_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(project_name)

        project_information = self.App.LaunchCLI(project_name, 'test')
        try:
            self.project_fixtures.delete_testing_data()
        except:
            pass

        print("---------------------------------------------------------------------\n")
        return [project_information['created'], ExpectedResults.ProjectTestCaseExpectedResult['run_project'], FailedMessages.ProjectTestCaseFailMessages['run_project']]

    def delete_project(self, project_name):
        """
        Delete Project

        @param project_name: project name to be Deleted
        @return List:
        """
        print('Test Delete Project.........!')

        self.project_fixtures.create_new_project(project_name)
        project_core = self.App.Fixity.ProjectRepo.getSingleProject(project_name)

        deleted_project_id = project_core.getID()
        deleted_project_Title = project_core.getTitle()

        project_core.Delete()

        project_core_deleted = self.App.Fixity.ProjectRepo.getSingleProject(deleted_project_Title)
        flag = True
        try:
            project_core_deleted.getID()

            flag = False
        except:
            pass

        try:
            project_core_deleted.getID()
            project_core_deleted.getTitle()
            flag = False
        except:
            pass

        result_project = self.App.Fixity.Database.getProjectInfo(deleted_project_Title)
        result_project_detail = self.App.Fixity.Database.getVersionDetailsLast(deleted_project_id)
        if len(result_project) > 0:
            flag = False

        if len(result_project_detail) > 0:
            flag = False

        print("---------------------------------------------------------------------\n")
        return [flag, ExpectedResults.ProjectTestCaseExpectedResult['delete_project'], FailedMessages.ProjectTestCaseFailMessages['delete_project']]

    def change_project_name(self, project_name, new_project):
        """
        Change Project Name

        @param project_name: project name to be Changed
        @param new_project: project name to be changed with
        """

        flag = True
        print('Test Change Project Name .........!')
        self.project_fixtures.create_new_project(project_name)

        project_core = self.App.Fixity.ProjectRepo.getSingleProject(project_name)
        project_core.changeProjectName(project_name, new_project)
        project_core_new = self.App.Fixity.ProjectRepo.getSingleProject(new_project)

        try:
            project_core_new.getID()
            project_core_new.getTitle()
        except:
            flag = False

        try:
            self.project_fixtures.delete_testing_data()
        except:
            pass

        print("---------------------------------------------------------------------\n")
        return [flag, ExpectedResults.ProjectTestCaseExpectedResult['change_project_name'], FailedMessages.ProjectTestCaseFailMessages['change_project_name']]

    def save_project(self, project_name):
        """
        Save Project

        @param project_name: project name to be Saved
        """
        print('Test Save Project .........!')
        flag = False

        #try:
        self.project_fixtures.create_new_project(project_name)
        project_core = self.App.Fixity.ProjectRepo.getSingleProject(project_name)
        project_core.Save()
        flag = True
        #except:
        #    print(Exception.message)
        #    flag = False
        print(flag)
        try:
            self.project_fixtures.delete_testing_data()
        except:
            pass

        print("---------------------------------------------------------------------\n")
        return [flag, ExpectedResults.ProjectTestCaseExpectedResult['save_project'], FailedMessages.ProjectTestCaseFailMessages['save_project']]

    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 filters_files(self, selected_project):
        """
        Filters Files

        @param selected_project: project name to be filtered
        """

        print('Test Filters Project .........!')
        self.project_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(selected_project)

        project_core = self.App.Fixity.ProjectRepo.getSingleProject(selected_project)
        project_core.applyFilter('', self.project_fixtures.is_ignore_hidden_files)
        project_core.Run(False, False, False, 'test')

        project_core.applyFilter(self.project_fixtures.filters, self.project_fixtures.is_ignore_hidden_files)
        result_of_run_after_filter = project_core.Run(False, False, False, 'test')

        self.project_fixtures.load_verification_algorithm_data()

        confirmed = result_of_run_after_filter['confirmed']
        missing_file = result_of_run_after_filter['missing_file']
        created = result_of_run_after_filter['created']
        moved = result_of_run_after_filter['moved']
        corrupted_or_changed = result_of_run_after_filter['corrupted_or_changed']

        try:
            self.project_fixtures.delete_testing_data()
        except:
            pass

        print("---------------------------------------------------------------------\n")
        return [{0: confirmed, 1: missing_file, 2: created, 3: moved, 4: corrupted_or_changed}, ExpectedResults.ProjectTestCaseExpectedResult['filters_files'], FailedMessages.ProjectTestCaseFailMessages['filters_files']]

    def import_project(self, project_name):
        """
        Import Project

        @param project_name: project name to be import Project
        """
        print('Test Import Project .........!')
        self.project_fixtures.load_history_file()
        flag = True
        project_core = ProjectCore.ProjectCore()
        response = project_core.ImportProject(self.project_fixtures.test_history_file, project_name, True, False)
        project_core = self.App.Fixity.ProjectRepo.getSingleProject(project_name)

        if not response:
            return False

        try:
            project_core.getID()
            project_core.getTitle()
            flag = True
        except:
            flag = False
            pass

        try:
            self.project_fixtures.delete_testing_data()
        except:
            pass

        print("---------------------------------------------------------------------\n")
        return [flag, ExpectedResults.ProjectTestCaseExpectedResult['import_project'], FailedMessages.ProjectTestCaseFailMessages['run_project']]
示例#7
0
class AlgorithmTestCase(object):
    def __init__(self):
        super(AlgorithmTestCase, self).__init__()
        self.App = Main.Main()
        self.algorithm_fixtures = AlgorithmFixtures()
        self.project_fixtures = ProjectFixtures()

        pass

    def test_confirm_file(self):

        print('Test Confirm File {( Nothing is Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print(
            "---------------------------------------------------------------------\n"
        )
        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.
            AlgorithmTestCaseExpectedResult['test_confirm_file'],
            FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_file']
        ]

    def test_confirm_file_is_special_chars(self):

        print('Test Confirm File {( Nothing is Changed )} .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print(
            "---------------------------------------------------------------------\n"
        )
        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.
            AlgorithmTestCaseExpectedResult['test_confirm_file'],
            FailedMessages.AlgorithmTestCaseFailMessages['test_confirm_file']
        ]

    def test_confirm_if_inode_changed_of_file(self):

        print('Test Confirm File {( I-Node is Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode(
            self.algorithm_fixtures.test_file_four)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_confirm_if_inode_changed_of_file'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_confirm_if_inode_changed_of_file']]

    def test_confirm_if_inode_changed_of_file_is_special_chars(self):

        print('Test Confirm File {( I-Node is Changed )} .........!')
        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode(
            self.algorithm_fixtures.test_file_four_special)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        print(
            "---------------------------------------------------------------------\n"
        )
        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_confirm_if_inode_changed_of_file'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_confirm_if_inode_changed_of_file']]

    def test_delete_file(self):

        print('Test Delete File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.del_file(self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_delete_file'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_delete_file']]

    def test_delete_file_is_special_chars(self):

        print('Test Delete File .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.del_file(
            self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_delete_file'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_delete_file']]

    def test_change_file(self):
        print('Test Change File {( Only Hash Changed )}.........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file(
            self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_change_file']]

    def test_change_file_is_special_chars(self):
        print('Test Change File {( Only Hash Changed )}.........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file(
            self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_change_file'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_change_file']]

    def test_change_file_changed_hash_and_path(self):
        print('Test Change File  {( Hash and Path Changed )} .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file_changed_hash_and_path(
            self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_change_file_changed_hash_and_path'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_change_file_changed_hash_and_path']]

    def test_change_file_changed_hash_and_path_is_special_chars(self):
        print('Test Change File  {( Hash and Path Changed )} .........!')

        print('With Special Characters')
        self.algorithm_fixtures.load_special_verification_algorithm_data()

        is_special_chars = True

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_file_changed_hash_and_path(
            self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_change_file_changed_hash_and_path'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_change_file_changed_hash_and_path']]

    def test_change_inode_and_hash_file(self):
        print('Test Change File  {( I-Node and Hash Changed )} .........!')

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode_and_hash(
            self.algorithm_fixtures.test_file_one)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.
            AlgorithmTestCaseExpectedResult['test_change_inode_and_hash_file'],
            FailedMessages.
            AlgorithmTestCaseFailMessages['test_change_inode_and_hash_file']
        ]

    def test_change_inode_and_hash_file_is_special_chars(self):
        print('Test Change File  {( I-Node and Hash Changed )} .........!')
        print('With Special Characters')
        is_special_chars = True
        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_inode_and_hash(
            self.algorithm_fixtures.test_file_one_special)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.
            AlgorithmTestCaseExpectedResult['test_change_inode_and_hash_file'],
            FailedMessages.
            AlgorithmTestCaseFailMessages['test_change_inode_and_hash_file']
        ]

    def test_new_file(self):
        print('Test New File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.new_file(
            self.algorithm_fixtures.test_file_one + '_new_file')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_new_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_new_file']]

    def test_new_file_is_special_chars(self):
        print('Test New File .........!')
        print('With Special Characters')
        is_special_chars = True

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.new_file(
            self.algorithm_fixtures.test_file_one_special + '_new_file')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_new_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_new_file']]

    def test_moved_file(self):
        print('Test Moved File .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.rename_file(
            self.algorithm_fixtures.test_file_one,
            self.algorithm_fixtures.test_file_one + '_unit_test')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file']
                ]

    def test_moved_file_to_new_directory(self):
        print('Test Moved File to New Directory .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.move_file_in_a_directory(
            self.algorithm_fixtures.test_file_three,
            self.algorithm_fixtures.new_directory + '3.docx')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.AlgorithmTestCaseExpectedResult[
                'test_moved_file_to_new_directory'], FailedMessages.
            AlgorithmTestCaseFailMessages['test_moved_file_to_new_directory']
        ]

    def test_moved_file_to_new_Directory_change_hash(self):
        print('Test Moved File to New Directory and changed hash .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.move_file_in_directory_and_change_hash(
            self.algorithm_fixtures.test_file_three,
            self.algorithm_fixtures.new_directory + '3.docx')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_moved_file_to_new_Directory_change_hash'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_moved_file_to_new_Directory_change_hash']]

    def test_moved_file_to_new_Directory_change_name_as_old(self):

        print(
            'Test created new file New Directory and changed name as old .........!'
        )

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.create_copy_of_a_file_removed_old_change_name_as_old(
        )

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult[
            'test_moved_file_to_new_Directory_change_name_as_old'],
                FailedMessages.AlgorithmTestCaseFailMessages[
                    'test_moved_file_to_new_Directory_change_name_as_old']]

    def test_moved_to_new_directory_change_name_as_old_and_content(self):
        print(
            'Test created new file New Directory and changed name as old changed hash .........!'
        )

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.create_copy_of_a_file_removed_old_change_name_as_old_change_content(
        )

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')
        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [
            {
                0: confirmed,
                1: missing_file,
                2: created,
                3: moved,
                4: corrupted_or_changed
            }, ExpectedResults.AlgorithmTestCaseExpectedResult[
                'test_moved_to_new_Directory_change_name_as_old_and_content'],
            FailedMessages.AlgorithmTestCaseFailMessages[
                'test_moved_to_new_Directory_change_name_as_old_and_content']
        ]

    def test_moved_file_is_special_chars(self):
        """
        Test Moved File Is Special Chars

        @return:
        """
        print('Test Moved File .........!')
        is_special_chars = True
        print('With Special Characters')

        self.algorithm_fixtures.load_special_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name, is_special_chars)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.rename_file(
            self.algorithm_fixtures.test_file_one_special,
            self.algorithm_fixtures.test_file_one_special + '_unit_test')

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data_special()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.AlgorithmTestCaseExpectedResult['test_moved_file'],
                FailedMessages.AlgorithmTestCaseFailMessages['test_moved_file']
                ]

    def test_change_base_path(self):
        print('Test Changed bath Path .........!')

        self.algorithm_fixtures.load_verification_algorithm_data()

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)

        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_directory_path()

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.delete_testing_data()
        self.algorithm_fixtures.unit_test_folder = self.App.Fixity.Configuration.getUnit_test_folder(
        )
        print(
            "---------------------------------------------------------------------\n"
        )

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.
                AlgorithmTestCaseExpectedResult['test_change_base_path'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_change_base_path']]

    def test_intersection_of_dir(self):

        print('test intersection of File .........!')
        base_path_of_unitest = self.App.Fixity.Configuration.getBasePath()

        file_path_given_to_be_created1 = base_path_of_unitest + 'test3' + os.sep + '1.docx'
        file_path_given_to_be_created2 = base_path_of_unitest + 'test3' + os.sep + '2.docx'
        file_path_given_to_be_created3 = base_path_of_unitest + 'test3' + os.sep + '3.docx'
        file_path_given_to_be_created4 = base_path_of_unitest + 'test3' + os.sep + '4.txt'

        self.algorithm_fixtures.load_verification_algorithm_data()

        base_path = base_path_of_unitest + 'test3'

        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(
            file_path_given_to_be_created1, base_path, '1 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(
            file_path_given_to_be_created2, base_path, '2 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(
            file_path_given_to_be_created3, base_path, '3 document')
        self.algorithm_fixtures.load_verification_algorithm_data_for_intersect(
            file_path_given_to_be_created4, base_path, '4 document')

        self.project_fixtures.create_new_project(
            self.algorithm_fixtures.project_name)
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')
        self.App.LaunchCLI(self.algorithm_fixtures.project_name, 'test')

        self.algorithm_fixtures.change_path_custom(base_path)

        report_info_two = self.App.LaunchCLI(
            self.algorithm_fixtures.project_name, 'test', base_path)

        self.algorithm_fixtures.unload_verification_algorithm_data()

        confirmed = report_info_two['confirmed']
        missing_file = report_info_two['missing_file']
        created = report_info_two['created']
        moved = report_info_two['moved']
        corrupted_or_changed = report_info_two['corrupted_or_changed']

        self.algorithm_fixtures.unit_test_folder = self.App.Fixity.Configuration.getUnit_test_folder(
        )
        self.algorithm_fixtures.delete_testing_data()

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

        return [{
            0: confirmed,
            1: missing_file,
            2: created,
            3: moved,
            4: corrupted_or_changed
        }, ExpectedResults.
                AlgorithmTestCaseExpectedResult['test_intersection_of_dir'],
                FailedMessages.
                AlgorithmTestCaseFailMessages['test_intersection_of_dir']]