def test_is_physical_parameter_block_fails(): # Test that is_physical_parameter_block returns ConfigurationError with # wrong input m = ConcreteModel() with pytest.raises(ConfigurationError): is_physical_parameter_block(m) # Non Parameter Block Pyomo object with pytest.raises(ConfigurationError): is_physical_parameter_block("foo") # str with pytest.raises(ConfigurationError): is_physical_parameter_block(1) # int
def test_is_physical_parameter_block_useDefault(): assert useDefault == is_physical_parameter_block(useDefault)
def test_is_physical_parameter_block_passes(): # Make an instance of a Parameter Block p = ParameterBlock() # Check that is_physical_parameter_block returns the ParameterBlock assert p == is_physical_parameter_block(p)