def test_material_wrong(): wrong_name = copy(in_material_internalsource) wrong_name['name'] = '' with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_name) wrong_thickness = copy(in_material_internalsource) wrong_thickness['thickness'] = 5 with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_thickness) wrong_specificheat = copy(in_material_internalsource) wrong_specificheat['specific_heat'] = 0 with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_specificheat)
def test_material_wrong(): file_path = os.path.join(target_folder, 'material_gypsum.json') with open(file_path) as json_file: material_gypsum = json.load(json_file) wrong_name = copy(material_gypsum) wrong_name['name'] = '' with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_name) wrong_thickness = copy(material_gypsum) wrong_thickness['thickness'] = 5 with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_thickness) wrong_specificheat = copy(material_gypsum) wrong_specificheat['specific_heat'] = 0 with pytest.raises(ValidationError): EnergyMaterial.parse_obj(wrong_specificheat)
def test_energymaterial_metaldecking(): EnergyMaterial.parse_obj(in_material_metal_decking)
def test_energymaterial_roofinsulation(): EnergyMaterial.parse_obj(in_material_roof_insulation)
def test_energymaterial_stucco(): EnergyMaterial.parse_obj(in_material_stucco)
def test_energymaterial_gypsum(): EnergyMaterial.parse_obj(in_material_gypsum)
def test_energymaterial_metaldecking(): file_path = os.path.join(target_folder, 'material_metal_decking.json') EnergyMaterial.parse_file(file_path)
def test_energymaterial_roofinsulation(): file_path = os.path.join(target_folder, 'material_roof_insulation.json') EnergyMaterial.parse_file(file_path)
def test_energymaterial_stucco(): file_path = os.path.join(target_folder, 'material_stucco.json') EnergyMaterial.parse_file(file_path)