def test_fit(self): """Test the ``Constraint.fit`` method. The base ``Constraint.fit`` method is expected to: - Call ``_fit`` method. Input: - Table data (pandas.DataFrame) """ # Setup table_data = pd.DataFrame({'a': [1, 2, 3]}) instance = Constraint(handling_strategy='transform', fit_columns_model=False) instance._fit = Mock() # Run instance.fit(table_data) # Assert instance._fit.assert_called_once_with(table_data)
def test_fit(self): """Test the ``Constraint.fit`` method. The base ``Constraint.fit`` method is expected to: - Call ``_fit`` method. Input: - Table data (pandas.DataFrame) """ # Setup table_data = pd.DataFrame({'a': [1, 2, 3]}) instance = Constraint() instance._fit = Mock() instance._validate_data_meets_constraint = Mock() # Run instance.fit(table_data) # Assert instance._fit.assert_called_once_with(table_data) instance._validate_data_meets_constraint.assert_called_once_with( table_data)