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 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to