Create some tests for pywikibot.diff.PatchManager
The function pywikibot.showDiff
is an important part of the pywikibot UI, allowing users to quickly review proposed changes to be made. It uses color to maximise the amount of information that can be shown to the user on a text interface to help them make their decision.
The logic behind this function was migrated to pywikibot.diff.PatchManager
and radically improved , and the switch to using PatchManager
occurred in ce6e10ba.
However the module pywikibot.diff
does not
have complete test coverage.
More test cases should be added to tests.diff_tests.TestPatchManager.cases
.
There are a lot of interesting test scenarios on https://test.wikipedia.org/wiki/User:John_Vandenberg/diff_test ; see https://phabricator.wikimedia.org/T130572.
Also additional test modules are needed to exercise the harder to reach parts of the PatchManager.
For this task, add coverage for between 5-10 lines of the module.
See test documentation in tests/README.rst
.
Pywikibot is a Python-based framework to write bots for MediaWiki. See https://www.mediawiki.org/wiki/Manual:Pywikibot for more information, and https://www.mediawiki.org/wiki/Manual:Pywikibot/PAWS for a short online interactive tutorial. Patches can be submitted via Gerrit (you need a MediaWiki.org account). See more documentation on Gerrit. Please do use the task in Phabricator for communication instead of this site. General development questions can be asked on the Pywikibot mailing list and the #pywikibot IRC channel.