Very good test. It would be nice to also test if we properly handle inconsistent metadata files, but it doesn't really belong to this task.