Exemplo n.º 1
0
    def test_get_constant_value_non_constant(self):
        """get_constant_value return None on non-constant arrays."""
        # Setup
        X = np.array(range(5))
        expected_result = None

        # Run
        result = Univariate._get_constant_value(X)

        # Check
        assert result is expected_result
Exemplo n.º 2
0
    def test_get_constant_value(self):
        """get_constant_value return the unique value of an array if it exists."""
        # Setup
        X = np.array([1, 1, 1, 1])
        expected_result = 1

        # Run
        result = Univariate._get_constant_value(X)

        # Check
        assert result == expected_result