Ejemplo n.º 1
0
    def __init__(self, series):
        """
        Tests to see if there are any null values
        :param series: the column to test
        :type series: pandas series
        """
        self.td = "Null Values"

        col_setUp.__init__(self, series)
        test_fail.__init__(self, tm="Contains null values")

        self._test()
Ejemplo n.º 2
0
    def __init__(self, series):
        """
        Initiates the test class to test the uniqueness of a column
        :param series: the column to test
        :type series: pandas series
        """
        self.td = "Unique Values"

        col_setUp.__init__(self, series)
        test_fail.__init__(self, tm="Not Unique")

        self._test()
Ejemplo n.º 3
0
    def __init__(self, series):
        """
        Initiates the test class for test all true
        :param series: the column to test
        :type series: pandas series
        """
        self.td = "All true"

        col_setUp.__init__(self, series)
        test_fail.__init__(self, tm="Not all True")

        self._test()
Ejemplo n.º 4
0
 def __init__(self, series, lower, upper):
     """
     :param series: the column to test
     :type series: pandas series
     :param lower: numeric lower bound
     :type lower: float
     :param upper: numeric upper bound
     :type upper: float
     """
     col_setUp.__init__(self, series)
     lower_bound.__init__(self, lower)
     upper_bound.__init__(self, upper)
     test_fail.__init__(self, tm="Values outside of range")
Ejemplo n.º 5
0
    def __init__(self, series, lower):
        """
        Initiates the test class for the greater than value class.
        Tests that X > lower is True
        :param series: the column to test
        :type series: pandas series
        :param lower: numeric lower bound
        :type lower: float or int
        """
        self.td = "Greater than value (>)"

        col_setUp.__init__(self, series)
        lower_bound.__init__(self, lower)
        test_fail.__init__(self, tm="Values outside of lower bound")

        self._test()
Ejemplo n.º 6
0
    def __init__(self, series, upper):
        """
        Initiates the test class for the less than value class.
        Tests that X < upper is True
        :param series: the column to test
        :type series: pandas series
        :param upper: numeric upper bound
        :type upper: float or int
        """
        self.td = "Less than value (<=)"

        col_setUp.__init__(self, series)
        upper_bound.__init__(self, upper)
        test_fail.__init__(self, tm="Values outside of upper bound")

        self._test()
Ejemplo n.º 7
0
    def __init__(self, series, expc_type):
        """
        Initiates test type class. Classes tests if the column meets the expected type condition.
        :param series: the column to test
        :type series: pandas series
        :param expc_type: the expected type of the column
        :type expc_type: string
        """
        col_setUp.__init__(self, series)

        self.td = "Test column type"
        self.expc_type = self.get_type(expc_type)

        test_fail.__init__(self, tm=self._test_message())

        self._test()
Ejemplo n.º 8
0
    def __init__(self, series, expc_values):
        """
        Initiates the test class to test the values of a column
        :param series: the column to test
        :type series: pandas series
        :param expc_values: the expected values
        :type expc_values: list
        """
        self.td = "Expected Values"
        self.expc_values = expc_values
        col_setUp.__init__(self, series)

        self.add_values = set(self.uni_values) - set(self.expc_values)

        test_fail.__init__(self, tm=self._test_message())

        self._test()
Ejemplo n.º 9
0
    def __init__(self, df, expc_cols):
        """
        Initiates the test class for the expected cols function
        :param df: the dataframe to test
        :type df: a pandas dataframe
        :param expc_cols: the names of the expected columns
        :type expc_cols: list
        """

        self.td = "Expected cols"
        self.expc_cols = pd.Series(expc_cols)

        df_setUp.__init__(self, df)

        self.missing_cols = self.expc_cols[(
            self.expc_cols.isin(self.df.columns)) == False]
        test_fail.__init__(self, tm=self._test_message())

        self._test()