def test_CONFIG_Template_validation_general(): # No config argument takes a string, float/int or list c = CONFIG_Template() for i in c: with pytest.raises(ValueError): c[i] = "foo" with pytest.raises(ValueError): c[i] = 10.0 with pytest.raises(ValueError): c[i] = [1, 2]
def test_CONFIG_Template_true_false(): # Check arguments that accept True/False as values c = CONFIG_Template() for i in c: if i not in ["material_balance_type", "energy_balance_type", "momentum_balance_type", "property_package", "reaction_package", "property_package_args", "reaction_package_args"]: c[i] = True c[i] = False
def test_CONFIG_Template(): c = CONFIG_Template() assert len(c) == 18 for i in c: if i == "dynamic": assert c[i] == useDefault elif i == "material_balance_type": assert c[i] == MaterialBalanceType.componentPhase elif i == "energy_balance_type": assert c[i] == EnergyBalanceType.enthalpyTotal elif i == "momentum_balance_type": assert c[i] == MomentumBalanceType.pressureTotal elif i == "property_package": assert c[i] == useDefault elif i == "reaction_package": assert c[i] is None elif i in ["property_package_args", "reaction_package_args"]: assert isinstance(c[i], ConfigBlock) assert len(c[i]) == 0 else: assert c[i] is False
def test_CONFIG_Template_momentum_balance_type(): c = CONFIG_Template() for i in MomentumBalanceType: c["momentum_balance_type"] = i
def test_CONFIG_Template_energy_balance_type(): c = CONFIG_Template() for i in EnergyBalanceType: c["energy_balance_type"] = i
def test_CONFIG_Template_material_balance_type(): c = CONFIG_Template() for i in MaterialBalanceType: c["material_balance_type"] = i