Beispiel #1
0
    def test_numerical_map_attribute_created(self, data):
        """Tests that the numerical_map attribute is created for the Masker object"""

        test_masker = Masker()
        test_masker.get_numerical_map(X=data)

        assert hasattr(test_masker, "numerical_map")
Beispiel #2
0
    def test_X_type(self):
        """Test error is thrown if X is not a pd.DataFrame."""

        test_masker = Masker()

        with pytest.raises(TypeError):
            test_masker.get_numerical_map(X=123)
Beispiel #3
0
    def test_numerical_map_values(self, data):
        """Test map values for MinMaxScaler."""

        test_masker = Masker()
        test_masker.get_numerical_map(X=data)

        assert list(test_masker.numerical_map.keys()) == ["col2"]
        assert isinstance(test_masker.numerical_map["col2"], MinMaxScaler)