Bug 947816 - metadata unit test

ok, I'll update things. I'll squash all in one commit.