jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] site tests: Separate deprecation classes ......................................................................
[IMPROV] site tests: Separate deprecation classes
Separate the tests which require just a live wiki but no user from the test that also requires a logged in user.
Change-Id: I75e5986277cf628dfde86ad7435fec0440442fd5 --- M tests/site_tests.py 1 file changed, 23 insertions(+), 16 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/site_tests.py b/tests/site_tests.py index 1781052..0d1f3a1 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -41,26 +41,12 @@ unicode = str
-class TestSiteObjectDeprecatedFunctions(DefaultSiteTestCase, DeprecationTestCase): +class TestSiteUserDeprecatedFunctions(DefaultSiteTestCase, DeprecationTestCase):
- """Test cases for Site deprecated methods on a live wiki.""" + """Test cases for Site deprecated methods requiring a live wiki and user."""
cached = True user = True - - def test_live_version(self): - """Test live_version.""" - mysite = self.get_site() - ver = mysite.live_version() - self.assertIsInstance(ver, tuple) - self.assertTrue(all(isinstance(ver[i], int) for i in (0, 1))) - self.assertIsInstance(ver[2], basestring) - self.assertDeprecation() - - def test_getcurrenttime(self): - """Test live_version.""" - self.assertEqual(self.site.getcurrenttime(), self.site.server_time()) - self.assertDeprecation()
def test_token(self): """Test ability to get page tokens.""" @@ -81,6 +67,27 @@ self.assertDeprecation("pywikibot.site.APISite.token is deprecated" ", use the 'tokens' property instead.")
+ +class TestSiteObjectDeprecatedFunctions(DefaultSiteTestCase, DeprecationTestCase): + + """Test cases for Site deprecated methods on a live wiki.""" + + cached = True + + def test_live_version(self): + """Test live_version.""" + mysite = self.get_site() + ver = mysite.live_version() + self.assertIsInstance(ver, tuple) + self.assertTrue(all(isinstance(ver[i], int) for i in (0, 1))) + self.assertIsInstance(ver[2], basestring) + self.assertDeprecation() + + def test_getcurrenttime(self): + """Test live_version.""" + self.assertEqual(self.site.getcurrenttime(), self.site.server_time()) + self.assertDeprecation() + def test_siteinfo_normal_call(self): """Test calling the Siteinfo without setting dump.""" old = self.site.siteinfo('general')
pywikibot-commits@lists.wikimedia.org