jenkins-bot merged this change.
[tests] Skip page_tests.TestPageUserAction if site is readonly
- purge and watch method cannot be done for an site with readonly state.
Skip the tests in that case.
Bug: T216358
Change-Id: I916020c9cf8bdd3a840cb23730aa5b337029dac4
---
M tests/page_tests.py
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 0dbd553..ab7fd24 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -972,6 +972,18 @@
user = True
+ @classmethod
+ def setUpClass(cls):
+ """Set up the test class.
+
+ Check whether the site is write protected and skip the tests then.
+ """
+ super(TestPageUserAction, cls).setUpClass()
+ site = cls.get_site()
+ if site.siteinfo['readonly']:
+ raise unittest.SkipTest('Site {} has readonly state: {}'.format(
+ site, site.siteinfo.get('readonlyreason', '')))
+
def test_purge(self):
"""Test purging the mainpage."""
mainpage = self.get_mainpage()
To view, visit change 491052. To unsubscribe, or for help writing mail filters, visit settings.