def test_surface_to_dict():
    ap_adj_names = ('AdjacentAperture', 'AdjacentFace', 'AdjacentRoom')
    face_adj_names = ('AdjacentFace', 'AdjacentRoom')
    ap_bc = Surface(ap_adj_names, True)
    face_bc = Surface(face_adj_names, False)
    ap_bc_dict = ap_bc.to_dict()
    assert ap_bc_dict['type'] == 'Surface'
    assert ap_bc_dict['boundary_condition_objects'] == ap_adj_names
    face_bc_dict = face_bc.to_dict()
    assert face_bc_dict['type'] == 'Surface'
    assert face_bc_dict['boundary_condition_objects'] == face_adj_names
예제 #2
0
def test_dict_to_object_bc():
    """Test the dict_to_object method with boundary conditions."""
    srf = Surface(['AdjacenyFace', 'AdjacentRoom'])
    out = Outdoors()
    bc_dict = srf.to_dict()

    assert isinstance(dict_to_object(bc_dict), Surface)