Simpler file write in tests