def _make_fut(self): from autopush.web.webpush import WebPushRequestSchema from autopush.settings import AutopushSettings schema = WebPushRequestSchema() schema.context["log"] = Mock() schema.context["settings"] = settings = AutopushSettings( hostname="localhost", statsd_host=None, ) settings.router = Mock() settings.router.get_uaid.return_value = dict( router_type="gcm", uaid=dummy_uaid, ) settings.fernet = self.fernet_mock = Mock() return schema
def _make_fut(self): from autopush.web.webpush import WebPushRequestSchema schema = WebPushRequestSchema() schema.context.update(conf=Mock(), metrics=SinkMetrics(), db=test_db(), routers=Mock(), log=Mock()) return schema
def _make_fut(self): from autopush.config import AutopushConfig from autopush.web.webpush import WebPushRequestSchema conf = AutopushConfig( hostname="localhost", statsd_host=None, ) db = test_db() schema = WebPushRequestSchema() schema.context.update(conf=conf, metrics=SinkMetrics(), db=db, routers=Mock(), log=Mock()) db.router.get_uaid.return_value = dict( router_type="gcm", uaid=dummy_uaid, router_data=dict(creds=dict(senderID="bogus")), ) conf.fernet = self.fernet_mock = Mock() return schema
def _make_fut(self): from autopush.web.webpush import WebPushRequestSchema schema = WebPushRequestSchema() schema.context["settings"] = Mock() schema.context["log"] = Mock() return schema