

def test_cannot_declare_enum_later():
    ffi = FFI()
    e = py.test.raises(NotImplementedError, ffi.cdef, 'typedef enum foo_e foo_t; enum foo_e { AA, BB };')
    assert (str(e.value) == "enum foo_e: the '{}' declaration should appear on the first time the enum is mentioned, not later")

dataset/ETHPy150Open johncsnyder/SwiftKitten/cffi/testing/cffi0/test_parsing.py test_cannot_declare_enum_later/original