def detect(context):
    with context.probe_text_file('foobar.txt', 'abcde') as f:
        if (next(f) != '123\n'):
            raise Exception
def detect(context):
    with context.probe_text_file('foobar.txt', 'abcde') as f:
        if (next(f) != '123\n'):
            raise Exception