add tests for write_config