add unit test for read only file