Page MenuHomePhabricator

update TestGetCommonsCatTemplates to mock _load_wikipedia_commonscat_templates()
Closed, ResolvedPublic

Description

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

Event Timeline

Change 313760 had a related patch set uploaded (by Lokal Profil):
Re-factor test of getCommonscatTemplates

https://gerrit.wikimedia.org/r/313760

Change 313760 merged by jenkins-bot:
Re-factor test of getCommonscatTemplates

https://gerrit.wikimedia.org/r/313760

Lokal_Profil claimed this task.