add context manager api for MockFile