Skip to content

Commit

Permalink
Merge "[tests] mark failing write tests as expectedFailure"
Browse files Browse the repository at this point in the history
  • Loading branch information
jenkins-bot authored and Gerrit Code Review committed Jun 12, 2024
2 parents d4193c7 + c8bd2b7 commit ba9e4d1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/deletionbot_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def save_page(cls):
cls.page.text = 'Pywikibot deletion test.'
cls.page.save('Pywikibot unit test', botflag=True)

@unittest.expectedFailure # T367299
def test_delete_mark(self):
"""Test marking User:Unicodesnowman/DeleteMark for deletion."""
delete.main('-page:User:Unicodesnowman/DeleteMark', '-always',
Expand Down
1 change: 1 addition & 0 deletions tests/edit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def test_merge_history_validation(self):
except Error as err:
self.assertEqual(str(err), error_msg)

@unittest.expectedFailure # T367300
def test_merge_history(self):
"""Test Site.merge_history functionality."""
site = self.get_site()
Expand Down
1 change: 1 addition & 0 deletions tests/flow_edit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class TestFlowLockTopic(TestCase):
code = 'test'
write = True

@unittest.expectedFailure # T367301
def test_lock_unlock_topic(self):
"""Lock and unlock a test topic."""
# Setup
Expand Down
3 changes: 2 additions & 1 deletion tests/flow_thanks_tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Tests for thanks-related code."""
#
# (C) Pywikibot team, 2016-2023
# (C) Pywikibot team, 2016-2024
#
# Distributed under the terms of the MIT license.
#
Expand Down Expand Up @@ -32,6 +32,7 @@ def setUpClass(cls):
super().setUpClass()
cls._topic_title = 'Topic:Tvkityksg1ukyrrw'

@unittest.expectedFailure # T367308
def test_thank_post(self):
"""Test thanks for Flow posts."""
site = self.get_site()
Expand Down
1 change: 1 addition & 0 deletions tests/site_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def test_revdel_page(self):
show='content|comment|user',
reason='pywikibot unit tests')

@unittest.expectedFailure # T367309
def test_revdel_file(self):
"""Test deleting and undeleting file revisions."""
site = pywikibot.Site('test')
Expand Down
1 change: 1 addition & 0 deletions tests/thanks_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestThankRevision(TestCase):
code = 'test'
write = True

@unittest.expectedFailure # T367311
def test_thank_revision(self):
"""Test thanks for normal revisions.
Expand Down
10 changes: 8 additions & 2 deletions tests/upload_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
These tests write to the wiki.
"""
#
# (C) Pywikibot team, 2014-2022
# (C) Pywikibot team, 2014-2024
#
# Distributed under the terms of the MIT license.
#
Expand All @@ -31,13 +31,15 @@ class TestUpload(TestCase):
sounds_png = join_images_path('MP_sounds.png')
arrow_png = join_images_path('1rightarrow.png')

@unittest.expectedFailure # T367319
def test_png(self):
"""Test uploading a png using Site.upload."""
page = pywikibot.FilePage(self.site, 'MP_sounds-pwb.png')
self.site.upload(page, source_filename=self.sounds_png,
comment='pywikibot test',
ignore_warnings=True)

@unittest.expectedFailure # T367320
def test_png_chunked(self):
"""Test uploading a png in two chunks using Site.upload."""
page = pywikibot.FilePage(self.site, 'MP_sounds-pwb-chunked.png')
Expand Down Expand Up @@ -106,15 +108,17 @@ def _test_continue_filekey(self, chunk_size):
'info ({}) did not start with '
'"File not found"'.format(cm.exception.info))

@unittest.expectedFailure # T367314
def test_continue_filekey_once(self):
"""Test continuing to upload a file without using chunked mode."""
self._test_continue_filekey(0)

@unittest.expectedFailure # see T112416
@unittest.expectedFailure # T133288
def test_continue_filekey_chunked(self):
"""Test continuing to upload a file with using chunked mode."""
self._test_continue_filekey(1024)

@unittest.expectedFailure # T367321
def test_sha1_missmatch(self):
"""Test trying to continue with a different file."""
self._init_upload(1024)
Expand All @@ -127,6 +131,7 @@ def test_sha1_missmatch(self):
'3dd334f11aa1e780d636416dc0649b96b67588b6'.format(self._file_key))
self._verify_stash()

@unittest.expectedFailure # T367316
def test_offset_missmatch(self):
"""Test trying to continue with a different offset."""
self._init_upload(1024)
Expand All @@ -139,6 +144,7 @@ def test_offset_missmatch(self):
'offset was 0'.format(self._file_key))
self._verify_stash()

@unittest.expectedFailure # T367317
def test_offset_oversize(self):
"""Test trying to continue with an offset which is to large."""
self._init_upload(1024)
Expand Down
3 changes: 3 additions & 0 deletions tests/wikibase_edit_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ def test_edit_entity_new_item(self):
item = pywikibot.ItemPage(testsite)
item.editEntity(data)

@unittest.expectedFailure # T367324
def test_edit_entity_propogation(self):
"""Test that ``ItemPage.editEntity`` propagates changes to claims."""
testsite = self.get_repo()
Expand Down Expand Up @@ -291,6 +292,7 @@ def test_WbMonolingualText_edit(self):
claim = item.claims['P271'][0]
self.assertEqual(claim.getTarget(), target)

@unittest.expectedFailure # T367326
def test_Coordinate_edit(self):
"""Attempt adding a Coordinate with globe set via item."""
testsite = self.get_repo()
Expand Down Expand Up @@ -393,6 +395,7 @@ def test_WbGeoShape_edit(self):
claim = item.claims['P27199'][0]
self.assertEqual(claim.getTarget(), target)

@unittest.expectedFailure # T367327
def test_WbTabularData_edit(self):
"""Attempt adding a tabular-data with valid input."""
# Clean the slate in preparation for test.
Expand Down

0 comments on commit ba9e4d1

Please sign in to comment.