tests.diff_tests module#
Test diff module.
- class tests.diff_tests.TestCherryPick(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test cherry_pick method.
- abstract_class = False#
- diff_by_letter_message = '<<lightred>>- o\n<<default>><<lightred>>- l\n<<default>><<lightred>>- d\n<<default>><<lightgreen>>+ n\n<<default>><<lightgreen>>+ e\n<<default>><<lightgreen>>+ w\n<<default>>'#
- diff_message = '<<lightred>>- old\n<<default>><<lightgreen>>+ new\n<<default>>'#
- header_base = '\n<<lightpurple>>{0:*^50}<<default>>\n'#
- headers = [' ALL CHANGES ', ' REVIEW CHANGES ', ' APPROVED CHANGES ']#
- newtext = 'new'#
- none_message = '<<lightpurple>> None. <<default>>'#
- oldtext = 'old'#
- test_by_letter_accept(input, mock)[source]#
Check cherry_pick output.
If by_letter diff is enabled and changes accepted.
- class tests.diff_tests.TestDryHTMLComparator(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test html_comparator method with given strings as test cases.
- abstract_class = False#
- class tests.diff_tests.TestHTMLComparator(*args, **kwargs)[source]#
Bases:
CheckHostnameMixin
,TestCase
Test html_comparator using api.php in en:wiki.
- abstract_class = False#
- code = 'en'#
- family = 'wikipedia'#
- net = True#
- site = True#
- sites = {'wikipedia:en': {'code': 'en', 'family': 'wikipedia'}}#
- class tests.diff_tests.TestNoBeautifulSoup(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test functions when BeautifulSoup is not installed.
- abstract_class = False#
- class tests.diff_tests.TestPatchManager(*args, **kwargs)[source]#
Bases:
DisableSiteMixin
,TestCase
Test PatchManager class with given strings as test cases.
- abstract_class = False#
- cases = [(' test', '_test', {0: '@@ -1 +1 @@\n\n- test\n? ^\n+ _test\n? ^\n'}), ('The quick brown fox jumps over the lazy dog.', 'quick brown dog jumps quickly over the lazy fox.', {0: '@@ -1 +1 @@\n\n- The quick brown fox jumps over the lazy dog.\n? ---- ^ ^ ^ ^\n+ quick brown dog jumps quickly over the lazy fox.\n? ^ ^ ++++++++ ^ ^\n'}), ('spam', 'eggs', {0: '@@ -1 +1 @@\n\n- spam\n+ eggs\n'}), ('Lorem\nipsum\ndolor', 'Quorem\nipsum\ndolom', {0: '@@ -1 +1 @@\n\n- Lorem\n? ^\n+ Quorem\n? ^^\n', 1: '@@ -3 +3 @@\n\n- dolor\n? ^\n+ dolom\n? ^\n'}), ('.foola.Pywikipediabot', '.foo.Pywikipediabot.foo.', {0: '@@ -1 +1 @@\n\n- .foola.Pywikipediabot\n? --\n+ .foo.Pywikipediabot.foo.\n? +++++\n'}), ('{foola}Pywikipediabot', '{foo}Pywikipediabot{foo}', {0: '@@ -1 +1 @@\n\n- {foola}Pywikipediabot\n? --\n+ {foo}Pywikipediabot{foo}\n? +++++\n'}), ('{default}Foo bar Pywikipediabot foo bar', '{default}Foo bar Pywikipediabot foo bar', {0: '@@ -1 +1 @@\n\n- {default}Foo bar Pywikipediabot foo bar\n+ {default}Foo bar Pywikipediabot foo bar\n? + + + +\n'}), ('Pywikipediabot foo', 'Pywikipediabot foo', {0: '@@ -1 +1 @@\n\n- Pywikipediabot foo\n+ Pywikipediabot foo\n? +\n'}), (' Pywikipediabot ', ' Pywikipediabot ', {0: '@@ -1 +1 @@\n\n- Pywikipediabot \n? -\n+ Pywikipediabot \n? +\n'})]#