def test_shade_construction_init(): """Test the initalization of ShadeConstruction objects and basic properties.""" default_constr = ShadeConstruction('Default Shade Construction') light_shelf_out = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.6) str(light_shelf_out) # test the string representation of the construction assert default_constr.is_default assert not light_shelf_out.is_default constr_dup = light_shelf_out.duplicate() assert light_shelf_out.name == constr_dup.name == 'Outdoor Light Shelf' assert light_shelf_out.solar_reflectance == constr_dup.solar_reflectance == 0.5 assert light_shelf_out.visible_reflectance == constr_dup.visible_reflectance == 0.6 assert light_shelf_out.is_specular is constr_dup.is_specular
def test_shade_equivalency(): """Test the equality of a ShadeConstruction to another.""" shade_constr_1 = ShadeConstruction('Outdoor Light Shelf', 0.4, 0.6) shade_constr_2 = shade_constr_1.duplicate() shade_constr_3 = ShadeConstruction('Outdoor Light Shelf', 0.5, 0.6) shade_constr_4 = ShadeConstruction('Indoor Light Shelf', 0.4, 0.6) collection = [shade_constr_1, shade_constr_1, shade_constr_2, shade_constr_3] assert len(set(collection)) == 2 assert shade_constr_1 == shade_constr_2 assert shade_constr_1 != shade_constr_3 assert shade_constr_1 != shade_constr_4 shade_constr_2.identifier = 'Indoor Light Shelf' assert shade_constr_1 != shade_constr_2