Exemple #1
0
    def tests_reset_counters(self):
        """
        This method will test if the counter is reseted.
        """

        Core.reset_counters()

        for string in self.types:
            expected = 0
            actual = PyFunceble.CONFIGURATION["counter"]["number"][string]
            self.assertEqual(expected, actual)
Exemple #2
0
    def tests_reset_counters(self):
        """
        Test if the counter is reseted.
        """

        Core.reset_counters()

        for string in self.types:
            expected = 0
            actual = PyFunceble.INTERN["counter"]["number"][string]

            self.assertEqual(expected, actual)
Exemple #3
0
    def __init__(self, list_to_test, clean_all=False):
        if list_to_test:
            # The list to test is not empty.

            try:
                # We try to see if we have to reset counters and clean the output directory.

                # We get the number of tested.
                number_of_tested = PyFunceble.CONFIGURATION["counter"]["number"][
                    "tested"
                ]

                if (
                    number_of_tested == 0
                    or list_to_test[number_of_tested - 1] == list_to_test[-1]
                    or number_of_tested >= len(list_to_test)
                ):
                    # * If the number of tested is null,
                    # or
                    # * the last tested element is the same as the last element in the
                    #   sequence,
                    # or
                    # * The number of tested is equal to the number of elements in the
                    #   sequence,

                    # We reset the counters.
                    Core.reset_counters()

                    # We clean the output directory.
                    self.almost_everything(clean_all)
            except IndexError:
                # But if at any time in the conditionnal an Index Error occurs,

                # We reset the counters.
                Core.reset_counters()

                # We clean the output directory.
                self.almost_everything(clean_all)
        else:
            # The list to test is empty.

            # We clean the output directory.
            self.almost_everything(clean_all)