remove tests.util.write_file duplicated implementation.