Exemplo n.º 1
0
def test_blind_dict_methods():
    """Test the to/from dict methods."""
    shade_mat = EnergyWindowMaterialBlind('Plastic Blind', 'Vertical', 0.025,
                                          0.01875, 0.003, 90, 0.2, 0.05, 0.4,
                                          0.05, 0.45, 0, 0.95, 0.1, 1)
    material_dict = shade_mat.to_dict()
    new_material = EnergyWindowMaterialBlind.from_dict(material_dict)
    assert material_dict == new_material.to_dict()
Exemplo n.º 2
0
def material_window_blind(directory):
    blinds = EnergyWindowMaterialBlind('Generic Aluminium Blinds')
    dest_file = os.path.join(directory, 'material_window_blind.json')
    with open(dest_file, 'w') as fp:
        json.dump(blinds.to_dict(), fp, indent=4)
Exemplo n.º 3
0
def test_dict_to_object_material():
    """Test the dict_to_object method with EnergyWindowMaterialBlind objects."""
    material_obj = EnergyWindowMaterialBlind('Test Blind')
    material_dict = material_obj.to_dict()
    new_material = dict_to_object(material_dict)
    assert isinstance(new_material, EnergyWindowMaterialBlind)