Xqt created this task.
Xqt added projects: Pywikibot, Pywikibot-tests, Pywikibot-Wikidata.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
    12:39:51 =================================== FAILURES 
===================================
    12:39:51 ______________________ TestItemLoad.test_load_item_set_id 
______________________
    12:39:51 
    12:39:51 self = <tests.wikibase_tests.TestItemLoad 
testMethod=test_load_item_set_id>
    12:39:51 
    12:39:51     def test_load_item_set_id(self) -> None:
    12:39:51         """Test setting item.id attribute on empty item."""
    12:39:51         wikidata = self.get_repo()
    12:39:51         item = ItemPage(wikidata, '-1')
    12:39:51         self.assertEqual(item._link._title, '-1')
    12:39:51         item.id = 'Q60'
    12:39:51         self.assertNotHasAttr(item, '_content')
    12:39:51         self.assertEqual(item.getID(), 'Q60')
    12:39:51         self.assertNotHasAttr(item, '_content')
    12:39:51         item.get()
    12:39:51         self.assertHasAttr(item, '_content')
    12:39:51 >       self.assertIn('mul', item.labels)
    12:39:51 E       AssertionError: 'mul' not found in LanguageDict({'ab': 
'Ниу-Иорк', 'acm': 'نيويورك', 'af': 'New York', 'am': 'ኒው ዮርክ', ...})
    12:39:51 
    12:39:51 tests/wikibase_tests.py:286: AssertionError
    12:39:51 _____________________ TestItemLoad.test_reuse_item_set_id 
______________________
    12:39:51 
    12:39:51 self = <tests.wikibase_tests.TestItemLoad 
testMethod=test_reuse_item_set_id>
    12:39:51 
    12:39:51     def test_reuse_item_set_id(self) -> None:
    12:39:51         """Test modifying item.id attribute.
    12:39:51     
    12:39:51         Some scripts are using item.id = 'Q60' semantics, which 
does
    12:39:51         work but modifying item.id does not currently work, and 
this
    12:39:51         test highlights that it breaks silently.
    12:39:51         """
    12:39:51         # label could change
    12:39:51         label = ['New York', 'New York City']
    12:39:51         wikidata = self.get_repo()
    12:39:51         item = ItemPage(wikidata, 'Q60')
    12:39:51         item.get()
    12:39:51 >       self.assertIn(item.labels['mul'], label)
    12:39:51                       ^^^^^^^^^^^^^^^^^^
    12:39:51 
    12:39:51 tests/wikibase_tests.py:303: 
    12:39:51 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_ _ _ _ _ _ _ 
    12:39:51 
    12:39:51 self = LanguageDict({'ab': 'Ниу-Иорк', 'acm': 'نيويورك', 'af': 
'New York', 'am': 'ኒው ዮርክ', ...})
    12:39:51 key = 'mul'
    12:39:51 
    12:39:51     def __getitem__(self, key: BaseSite | str) -> Any:
    12:39:51         key = self.normalizeKey(key)
    12:39:51 >       return self._data[key]
    12:39:51                ^^^^^^^^^^^^^^^
    12:39:51 E       KeyError: 'mul'
    12:39:51 
    12:39:51 pywikibot/page/_collections.py:48: KeyError

TASK DETAIL
  https://phabricator.wikimedia.org/T416072

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to