本文整理匯總了Python中pywikibot.page.WikibasePage類的典型用法代碼示例。如果您正苦於以下問題:Python WikibasePage類的具體用法?Python WikibasePage怎麽用?Python WikibasePage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了WikibasePage類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_base_get_args
def test_base_get_args(self):
"""Test WikibasePage.get() with sysop argument."""
item = WikibasePage(self.repo, 'Q1')
# avoid loading anything
item._content = {}
self.assertRaises(NotImplementedError,
item.get, force=True, sysop=True)
self.assertRaises(NotImplementedError,
item.get, force=False, sysop=True)
self.assertRaises(NotImplementedError,
item.get, force=False, sysop=False)
self.assertRaises(NotImplementedError,
item.get, sysop=True)
示例2: test_normalize_data
def test_normalize_data(self):
data_in = {
'aliases': {'en': ['Bah']},
'labels': {'en': 'Foo'},
}
response = WikibasePage._normalizeData(data_in)
self.assertEqual(response, self.data_out)
示例3: test_normalized_data
def test_normalized_data(self):
response = WikibasePage._normalizeData(
copy.deepcopy(self.data_out))
self.assertEqual(response, self.data_out)
示例4: test_normalize_lang
def test_normalize_lang(self):
lang_in = {self.site: 'foo'}
response = WikibasePage._normalizeLanguages(lang_in)
self.assertEqual(response, self.lang_out)
示例5: test_normalized_data
def test_normalized_data(self):
"""Test _normalizeData() method for normalized data."""
response = WikibasePage._normalizeData(
copy.deepcopy(self.data_out))
self.assertEqual(response, self.data_out)
示例6: test_normalized_lang
def test_normalized_lang(self):
"""Test _normalizeData() method."""
response = WikibasePage._normalizeData(
copy.deepcopy(self.lang_out))
self.assertEqual(response, self.lang_out)
示例7: test_normalize_data
def test_normalize_data(self):
data_in = {"aliases": {"en": ["Bah"]}, "labels": {"en": "Foo"}}
response = WikibasePage._normalizeData(data_in)
self.assertEqual(response, self.data_out)