Tests of writing files