def Site(self, code=None, fam=None, user=None, *args, **kwargs):
     """Patched version of pywikibot.Site."""
     self.assertEqual(code, fam.code)
     self.assertEqual(fam.domain, self.NETLOC)
     self.assertEqual(user, self.USERNAME)
     site = DrySite(code, fam, user, *args, **kwargs)
     site._siteinfo._cache.update(
         (key, (value, True)) for key, value in self._siteinfo.items())
     return site
示例#2
0
 def Site(self, code, fam, *args, **kwargs):
     """Own DrySite creator."""
     self.assertEqual(args, ())
     self.assertEqual(kwargs, {})
     self.assertEqual(code, self.current_code)
     self.assertEqual(fam, self.current_family)
     site = DrySite(code, fam, None, None)
     site._siteinfo._cache['general'] = ({'articlepath': self.article_path},
                                         True)
     return site