Mock does provide a handy way to simulate opening files without actually involving the filesystem. Not that you should change this since it's already written, but just thought I'd suggest it for next time.