jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/576866 )
Change subject: [bugfix] Remove tests whether fake_useragents are always different ......................................................................
[bugfix] Remove tests whether fake_useragents are always different
- fake_useragent gives a random ua but it is nur sure whether they are always different. But this doesn't care and tests are done by the project itself already. Remove these test parts.
Bug: T246538 Change-Id: I51983771831b352106989359d1bb67dccc0a90d8 --- M tests/http_tests.py 1 file changed, 0 insertions(+), 28 deletions(-)
Approvals: Dvorapa: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/http_tests.py b/tests/http_tests.py index d456024..4e7f56d 100644 --- a/tests/http_tests.py +++ b/tests/http_tests.py @@ -306,27 +306,6 @@ self.assertIn('Python/' + str(PYTHON_VERSION[0]), http.user_agent())
-class DryFakeUserAgentTestCase(TestCase): - - """Test the generation of fake user agents. - - If the method cannot import fake_useragent, the default user agent - will be returned, causing tests to fail. Therefore tests will skip - if fake_useragent is missing. - """ - - net = False - - def _test_fake_user_agent_randomness(self): - """Test if user agent returns are randomized.""" - self.assertNotEqual(http.fake_user_agent(), http.fake_user_agent()) - - @require_modules('fake_useragent') - def test_with_fake_useragent(self): - """Test fake user agent generation with fake_useragent module.""" - self._test_fake_user_agent_randomness() - - class LiveFakeUserAgentTestCase(HttpbinTestCase):
"""Test the usage of fake user agent.""" @@ -392,12 +371,6 @@ config.fake_user_agent = self.orig_fake_user_agent super(GetFakeUserAgentTestCase, self).tearDown()
- def _test_fake_user_agent_randomness(self): - """Test if user agent returns are randomized.""" - config.fake_user_agent = True - self.assertNotEqual(http.get_fake_user_agent(), - http.get_fake_user_agent()) - def _test_config_settings(self): """Test if method honours configuration toggle.""" # ON: True and None in config are considered turned on. @@ -415,7 +388,6 @@ @require_modules('fake_useragent') def test_with_fake_useragent(self): """Test method with fake_useragent module.""" - self._test_fake_user_agent_randomness() self._test_config_settings()
pywikibot-commits@lists.wikimedia.org