def test132():
    class Test132(InfraModel):
        server = Server("dummy", mem="8GB", no_key=5)
    inst = Test132("t132")
    try:
        inst.server.no_key[2]
        assert False, "We were allowed to use a key on a non-collection attribute"
    except __HOLE__, e:
        assert "keyed" in e.message
dataset/ETHPy150Open haxsaw/actuator/src/tests/infra_tests.py/test132