jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Test pywikibot.setAction ......................................................................
[FEAT] Test pywikibot.setAction
Change-Id: I867a6d97c73c76548dce43783a1acec2c9690163 --- M tests/dry_site_tests.py 1 file changed, 24 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/dry_site_tests.py b/tests/dry_site_tests.py index e287962..5b103db 100644 --- a/tests/dry_site_tests.py +++ b/tests/dry_site_tests.py @@ -101,6 +101,30 @@ user_agent(x, format_string='Foo ({script_comments})'))
+class TestSetAction(DeprecationTestCase): + + """Test the deprecated setAction function.""" + + net = False + + def setUp(self): + """Backup the original configuration.""" + super(TestSetAction, self).setUp() + self._old_config = pywikibot.config.default_edit_summary + + def tearDown(self): + """Restore the original configuration.""" + pywikibot.config.default_edit_summary = self._old_config + super(TestSetAction, self).tearDown() + + def test_set_action(self): + """Test deprecated setAction function.""" + pywikibot.setAction('{0}X{0}'.format(self._old_config)) + self.assertOneDeprecation(self.INSTEAD) + self.assertEqual(pywikibot.config.default_edit_summary, + '{0}X{0}'.format(self._old_config)) + + class TestMustBe(DebugOnlyTestCase):
"""Test cases for the must_be decorator."""
pywikibot-commits@lists.wikimedia.org