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
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