make write_all test actually test something
s/key/template/ in write_all