jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/567468 )
Change subject: [IMPR] use a list for tests in test_valid
......................................................................
[IMPR] use a list for tests in test_valid
- use extended_title_tests list for all remaining tests
- use subTest for every test in this list
Change-Id: I75399c0b0e6d95b4a7cafd23d07cdbf3f959e763
---
M tests/link_tests.py
1 file changed, 23 insertions(+), 16 deletions(-)
Approvals:
Mpaa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/link_tests.py b/tests/link_tests.py
index 1307ac8..548ef0c 100644
--- a/tests/link_tests.py
+++ b/tests/link_tests.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Test Link functionality."""
#
-# (C) Pywikibot team, 2014-2019
+# (C) Pywikibot team, 2014-2020
#
# Distributed under the terms of the MIT license.
#
@@ -71,27 +71,34 @@
def test_valid(self):
"""Test that valid titles are correctly normalized."""
- site = self.get_site()
title_tests = ['Sandbox', 'A "B"', "A 'B'", '.com', '~', '"', "'",
'Foo/.../Sandbox', 'Sandbox/...', 'A~~', 'X' * 252]
+
+ extended_title_tests = [
+ ('Talk:Sandbox', 'Sandbox'),
+ ('Talk:Foo:Sandbox', 'Foo:Sandbox'),
+ ('File:Example.svg', 'Example.svg'),
+ ('File_talk:Example.svg', 'Example.svg'),
+ (':A', 'A'),
+ # Length is 256 total, but only title part matters
+ ('Category:' + 'X' * 248, 'X' * 248),
+ ('A%20B', 'A B'),
+ ('A é B', 'A é B'),
+ ('A é B', 'A é B'),
+ ('A é B', 'A é B'),
+ ('A B', 'A B'),
+ ('A   B', 'A B'),
+ ]
+
+ site = self.get_site()
+
for title in title_tests:
with self.subTest(title=title):
self.assertEqual(Link(title, site).title, title)
- self.assertEqual(Link('Talk:Sandbox', site).title, 'Sandbox')
- self.assertEqual(Link('Talk:Foo:Sandbox', site).title, 'Foo:Sandbox')
- self.assertEqual(Link('File:Example.svg', site).title, 'Example.svg')
- self.assertEqual(Link('File_talk:Example.svg', site).title,
- 'Example.svg')
- self.assertEqual(Link(':A', site).title, 'A')
- # Length is 256 total, but only title part matters
- self.assertEqual(Link('Category:' + 'X' * 248, site).title, 'X' * 248)
- self.assertEqual(Link('A%20B', site).title, 'A B')
- self.assertEqual(Link('A é B', site).title, 'A é B')
- self.assertEqual(Link('A é B', site).title, 'A é B')
- self.assertEqual(Link('A é B', site).title, 'A é B')
- self.assertEqual(Link('A B', site).title, 'A B')
- self.assertEqual(Link('A   B', site).title, 'A B')
+ for link, title in extended_title_tests:
+ with self.subTest(link=link, title=title):
+ self.assertEqual(Link(link, site).title, title)
anchor_link = Link('A | B', site)
self.assertEqual(anchor_link.title, 'A')
--
To view, visit https://gerrit.wikimedia.org/r/567468
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I75399c0b0e6d95b4a7cafd23d07cdbf3f959e763
Gerrit-Change-Number: 567468
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/568982 )
Change subject: [cleanup] Remove deprecated/not implemented rcstream methods
......................................................................
[cleanup] Remove deprecated/not implemented rcstream methods
rcstream support was removed with 3.0.20171212 in favour of eventstreams.
The old path methods are obsolete.
- remove rcstream* methods from Family
- remove rcstream_host from WikimediaFamily
Change-Id: I5b5c93cc6b1fe5a6b3554d160ac50522ab8e550d
---
M pywikibot/family.py
1 file changed, 1 insertion(+), 18 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 9eeccc6..abe13db 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Objects representing MediaWiki families."""
#
-# (C) Pywikibot team, 2004-2019
+# (C) Pywikibot team, 2004-2020
#
# Distributed under the terms of the MIT license.
#
@@ -1217,18 +1217,6 @@
"""DEPRECATED: Return nice path prefix, e.g. '/wiki/'."""
return '/wiki/'
- def rcstream_host(self, code):
- """Hostname for RCStream."""
- raise NotImplementedError('This family does not support RCStream')
-
- def rcstream_path(self, code):
- """Return path for RCStream."""
- raise NotImplementedError('This family does not support RCStream')
-
- def rcstream_port(self, code):
- """Return port for RCStream."""
- raise NotImplementedError('This family does not support RCStream')
-
def eventstreams_host(self, code):
"""Hostname for EventStreams."""
raise NotImplementedError('This family does not support EventStreams')
@@ -1741,11 +1729,6 @@
"""Return 'https' as the protocol."""
return 'https'
- @deprecated('eventstreams_host', since='20170713')
- def rcstream_host(self, code):
- """DEPRECATED: use eventstreams_host instead."""
- return self.eventstreams_host(code)
-
def eventstreams_host(self, code):
"""Return 'https://stream.wikimedia.org' as the stream hostname."""
return 'https://stream.wikimedia.org'
--
To view, visit https://gerrit.wikimedia.org/r/568982
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b5c93cc6b1fe5a6b3554d160ac50522ab8e550d
Gerrit-Change-Number: 568982
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/567290 )
Change subject: [doc] update tests/README.rst
......................................................................
[doc] update tests/README.rst
- add a hint that -lang and -family option can be used with pwb.py
- some minor changes
Change-Id: I1711c8b218f97397937e56d909d1135ff1a0fd24
---
M tests/README.rst
1 file changed, 9 insertions(+), 6 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/README.rst b/tests/README.rst
index b2e8500..56984ec 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -70,7 +70,9 @@
Specific tests
--------------
-Individual test components can be run using unittest, nosetests, or pwb
+Individual test components can be run using unittest, nosetests, or pwb.
+With -lang and -family options pwb can be used to specify a site.
+
unittest
~~~~~~~~
@@ -104,6 +106,7 @@
python pwb.py tests/api_tests -v
python pwb.py tests/site_tests -v
python pwb.py tests/api_tests -v TestParamInfo.test_init
+ python pwb.py -lang:de -family:wikipedia tests/page_tests -v TestPageObject
env
~~~
@@ -123,10 +126,10 @@
https://github.com/wikimedia/pywikibot , and travis tests are run and
published at https://travis-ci.org/wikimedia/pywikibot/builds . These tests
use the Wikimedia global (SUL) account 'Pywikibot-test', which has a password
-securely stored in .travis.yml . See section env:global:secure.
+securely stored in .travis.yml file. See section env:global:secure.
Anyone can run these tests on travis-ci.org using their own github account, with
-code changes that have not been merged into the main repository. To do this:
+code changes that have not been merged into the main repository. To do this:
1. create a github and travis-ci account
2. fork the main github repository https://github.com/wikimedia/pywikibot
@@ -135,7 +138,7 @@
5. watch the build at https://travis-ci.org/<username>/pywikibot/builds
Only travis-ci builds from the main repository can access the password for the
-Wikimedia account 'Pywikibot-test'. All tests which require a logged in user
+Wikimedia account 'Pywikibot-test'. All tests which require a logged in user
are skipped if the travis-ci build environment does not have a password.
To enable 'user' tests on travis-ci builds for a different repository, add
@@ -166,7 +169,7 @@
After changes are published into a github repository, tests may be run on
a Microsoft Windows box provided by ci.appveyor.com according to the
-configuration in .appveyor.yml . To do this:
+configuration in .appveyor.yml file. To do this:
1. create a github and appveyor account
2. fork the main github repository
@@ -207,7 +210,7 @@
=====================
There are a set of 'edit failure' tests, which attempt to write to the wikis
-and **should** fail. If there is a bug in pywikibot or MediaWiki, these
+and **should** fail. If there is a bug in pywikibot or MediaWiki, these
tests **may** actually perform a write operation.
These 'edit failure' tests are disabled by default. On Travis they are enabled
--
To view, visit https://gerrit.wikimedia.org/r/567290
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1711c8b218f97397937e56d909d1135ff1a0fd24
Gerrit-Change-Number: 567290
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/567887 )
Change subject: [doc] Update HISTORY.rst
......................................................................
[doc] Update HISTORY.rst
Change-Id: Ic0e84ea0de088af0b0cb221dd0216e14966db39c
---
M HISTORY.rst
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index fdf865b..8348b67 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -4,6 +4,10 @@
Current release
---------------
+* preload urllib.quote() with Python 2 (T243710, T222623)
+* Drop isbn_hyphenate package due to outdated data (T243157)
+* Fix UnboundLocalError in ProofreadPage._ocr_callback (T243644)
+* Deprecate/remove sysop parameter in several methods and functions
* Refactor Wikibase entity namespace handling (T160395)
* Site.has_api method will be removed in next release
* Category.copyTo and Category.copyAndKeep will be removed in the next release
--
To view, visit https://gerrit.wikimedia.org/r/567887
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic0e84ea0de088af0b0cb221dd0216e14966db39c
Gerrit-Change-Number: 567887
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)