コード例 #1
0
 def setUp(self):
     super(TestLinks, self).setUp()
     self.wdp = pywikibot.ItemPage(self.get_repo(), 'Q60')
     self.wdp.id = 'Q60'
     with open(join_pages_path('Q60_only_sitelinks.wd')) as f:
         self.wdp._content = json.load(f)
     self.wdp.get()
コード例 #2
0
 def setUp(self):
     super(TestJSON, self).setUp()
     wikidata = self.get_repo()
     self.wdp = pywikibot.ItemPage(wikidata, 'Q60')
     self.wdp.id = 'Q60'
     with open(join_pages_path('Q60.wd')) as f:
         self.wdp._content = json.load(f)
     self.wdp.get()
     del self.wdp._content['id']
     del self.wdp._content['type']
     del self.wdp._content['lastrevid']