Add test to write file
clean after test