As per the comments in https://gerrit.wikimedia.org/r/#/c/309841/ we can build a more stable version of the test if we mock the response from _load_wikipedia_commonscat_templates() (or whatever that function end up being called).
A patch for that would have to be built on top of https://gerrit.wikimedia.org/r/#/c/309842/ where that function is introduced.
From the comments in https://gerrit.wikimedia.org/r/#/c/309841/:
We need
- A setup which provide a small dict,
- A test of the load function which ensures that
- The file is there
- That the file contains at least the _default key