Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
def test_energymaterial_metaldecking():
    EnergyMaterial.parse_obj(in_material_metal_decking)
Ejemplo n.º 4
0
def test_energymaterial_roofinsulation():
    EnergyMaterial.parse_obj(in_material_roof_insulation)
Ejemplo n.º 5
0
def test_energymaterial_stucco():
    EnergyMaterial.parse_obj(in_material_stucco)
Ejemplo n.º 6
0
def test_energymaterial_gypsum():
    EnergyMaterial.parse_obj(in_material_gypsum)
Ejemplo n.º 7
0
def test_energymaterial_metaldecking():
    file_path = os.path.join(target_folder, 'material_metal_decking.json')
    EnergyMaterial.parse_file(file_path)
Ejemplo n.º 8
0
def test_energymaterial_roofinsulation():
    file_path = os.path.join(target_folder, 'material_roof_insulation.json')
    EnergyMaterial.parse_file(file_path)
Ejemplo n.º 9
0
def test_energymaterial_stucco():
    file_path = os.path.join(target_folder, 'material_stucco.json')
    EnergyMaterial.parse_file(file_path)