Beispiel #1
0
def test_material_lockability():
    """Test the lockability of Plastic."""
    pl = Plastic('test_plastic', 0.6, 0.7, 0.8, 0, 0)
    pl.r_reflectance = 0.5
    pl.lock()
    with pytest.raises(AttributeError):
        pl.r_reflectance = 0.7
    pl.unlock()
    pl.r_reflectance = 0.7
Beispiel #2
0
def test_update_values():
    pl = Plastic('test_plastic', 0.6, 0.7, 0.8, 0.1, 0.02)
    pl.r_reflectance = 0.5
    pl.g_reflectance = 0.4
    pl.b_reflectance = 0.3
    pl.specularity = 0.1
    pl.roughness = 0.02
    assert pl.r_reflectance == 0.5
    assert pl.g_reflectance == 0.4
    assert pl.b_reflectance == 0.3
    assert pl.specularity == 0.1
    assert pl.roughness == 0.02
    assert pl.to_radiance(minimal=True) == \
        'void plastic test_plastic 0 0 5 0.5 0.4 0.3 0.1 0.02'