jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332477?usp=email )
Change subject: tests: Fix chunked upload warning test
......................................................................
tests: Fix chunked upload warning test
A first chunk with an unignored warning is stored as a standalone
stashed file, not an active chunked upload session. Verify that
behavior instead of trying to resume the invalid session.
Bug: T133288
Change-Id: I5ea10e03f0457cb5621907332204116f5010c507
---
M tests/upload_tests.py
1 file changed, 7 insertions(+), 7 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/upload_tests.py b/tests/upload_tests.py
index c196248..87e66ad 100755
--- a/tests/upload_tests.py
+++ b/tests/upload_tests.py
@@ -317,9 +317,10 @@
# First upload the warning with warnings enabled
page = pywikibot.FilePage(self.site, 'MP_sounds-pwb.png')
self.assertNotHasAttr(self, '_file_key')
- self.site.upload(page, source_filename=self.sounds_png,
- comment='pywikibot test', chunk_size=chunk_size,
- ignore_warnings=warn_callback)
+ self.assertFalse(
+ self.site.upload(page, source_filename=self.sounds_png,
+ comment='pywikibot test', chunk_size=chunk_size,
+ ignore_warnings=warn_callback))
# Check that the warning happened and it's cached
self.assertHasAttr(self, '_file_key')
@@ -359,10 +360,9 @@
"""Test continuing to upload a file without using chunked mode."""
self._test_continue_filekey(0)
- @unittest.expectedFailure # T133288
- def test_continue_filekey_chunked(self) -> None:
- """Test continuing to upload a file with using chunked mode."""
- self._test_continue_filekey(1024)
+ def test_first_chunk_warning_stash(self) -> None:
+ """Test a first chunk is stashed after an upload warning."""
+ self._init_upload(1024)
@unittest.expectedFailure # T367321
def test_sha1_mismatch(self) -> None:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332477?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I5ea10e03f0457cb5621907332204116f5010c507
Gerrit-Change-Number: 1332477
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <mahveotm(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332231?usp=email )
Change subject: tests: Remove unreliable bad recipient test
......................................................................
tests: Remove unreliable bad recipient test
The test treats User.is_thankable as the server's recipient policy.
Wikimedia wikis allow thanking bots under T341388, so a bot selected
from recent changes can be thanked successfully instead of raising
invalidrecipient.
The self-thank test already covers invalidrecipient deterministically.
Change-Id: I9b835a809e83bbc7aed540987140030977ccff2b
---
M tests/thanks_tests.py
1 file changed, 0 insertions(+), 15 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/thanks_tests.py b/tests/thanks_tests.py
index 1298407..bba6606 100755
--- a/tests/thanks_tests.py
+++ b/tests/thanks_tests.py
@@ -77,21 +77,6 @@
code = 'test'
write = True
- def test_bad_recipient(self) -> None:
- """Test that thanking a bad recipient causes an error."""
- site = self.get_site()
- data = site.recentchanges(total=20)
- for rev in data:
- revid = rev['revid']
- username = rev['user']
- user = User(site, username)
- if not user.is_thankable:
- break
- else:
- self.skipTest(NO_THANKABLE_REVS)
- self.assertAPIError('invalidrecipient', None, site.thank_revision,
- revid, source='pywikibot test')
-
def test_invalid_revision(self) -> None:
"""Test that passing an invalid revision ID causes an error."""
site = self.get_site()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1332231?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I9b835a809e83bbc7aed540987140030977ccff2b
Gerrit-Change-Number: 1332231
Gerrit-PatchSet: 2
Gerrit-Owner: Mahveotm <mahveotm(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot