本文整理汇总了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)