def test_getitem():
    app = App()
    while len(app):
        app.flush()

    e = test(1, 2, 3, foo="bar")

    assert e[0] == 1
    assert e["foo"] == "bar"

    def f(e, k):
        return e[k]

    py.test.raises(TypeError, f, e, None)
dataset/ETHPy150Open circuits/circuits/tests/core/test_event.py/test_getitem/original