Beispiel #1
0
def test_reader_files():
    radiance_folder = r'./tests/assets/project_folder'
    rad_folder = Folder(radiance_folder)
    assert rad_folder.has_aperture_group
    assert not rad_folder.has_dynamic_scene
    assert rad_folder.aperture_files() == [
        'model/aperture/aperture.mat', 'model/aperture/aperture.rad'
    ]
    assert rad_folder.aperture_files(black_out=True) == [
        'model/aperture/aperture.blk', 'model/aperture/aperture.rad'
    ]

    s_files = rad_folder.scene_files()
    e_files = [
        'model/scene/context.mat', 'model/scene/context.rad',
        'model/scene/partition.mat', 'model/scene/partition.rad',
        'model/scene/partition_glass.mat', 'model/scene/partition_glass.rad',
        'model/scene/room_envelope.mat', 'model/scene/room_envelope.rad'
    ]
    assert s_files.index(e_files[1]) - s_files.index(e_files[0]) == 1
    assert s_files.index(e_files[3]) - s_files.index(e_files[2]) == 1
    assert s_files.index(e_files[5]) - s_files.index(e_files[4]) == 1
    assert s_files.index(e_files[7]) - s_files.index(e_files[6]) == 1

    s_files = rad_folder.scene_files(black_out=True)
    e_files = [
        'model/scene/context.blk', 'model/scene/context.rad',
        'model/scene/partition.blk', 'model/scene/partition.rad',
        'model/scene/partition_glass.blk', 'model/scene/partition_glass.rad',
        'model/scene/room_envelope.blk', 'model/scene/room_envelope.rad'
    ]
    assert s_files.index(e_files[1]) - s_files.index(e_files[0]) == 1
    assert s_files.index(e_files[3]) - s_files.index(e_files[2]) == 1
    assert s_files.index(e_files[5]) - s_files.index(e_files[4]) == 1
    assert s_files.index(e_files[7]) - s_files.index(e_files[6]) == 1
Beispiel #2
0
def test_static_aperture():
    radiance_folder = r'./tests/assets/project_folder'
    folder = Folder(radiance_folder)
    files = folder.aperture_files(black_out=False, rel_path=True)
    assert 'model/aperture/aperture.mat' in files
    assert 'model/aperture/aperture.rad' in files