Ejemplo n.º 1
0
 def test_async_request(self):
     """Test async request."""
     self.assertTrue(page_put_queue.empty())
     self.assertNotIn('statistics', self.site.siteinfo)
     async_request(self.site.siteinfo.get, 'statistics')
     page_put_queue.join()
     self.assertIn('statistics', self.site.siteinfo)
Ejemplo n.º 2
0
 def wrapper(self, *args, **kwargs):
     if kwargs.get('asynchronous'):
         pywikibot.async_request(handle, func, self, *args, **kwargs)
     else:
         handle(func, self, *args, **kwargs)