Added tests for the new functionality in _open_file().