예제 #1
0
    def setUp(self):
        twisted.internet.base.DelayedCall.debug = True

        conf = AutopushConfig(
            hostname="localhost",
            statsd_host=None,
        )

        self.logs = _TestingLogObserver()
        begin_or_register(self.logs, discardBuffer=True)
        self.addCleanup(globalLogPublisher.removeObserver, self.logs)

        app = EndpointHTTPFactory.for_handler(LogCheckHandler, conf)
        self.client = Client(app)
예제 #2
0
    def setUp(self):
        self.conf = AutopushConfig(
            hostname="localhost",
            resolve_hostname=True,
            port=8080,
            router_port=8081,
            statsd_host=None,
            env="test",
            auto_ping_interval=float(300),
            auto_ping_timeout=float(10),
            close_handshake_timeout=10,
            max_connections=2000000,
        )

        self.logs = TestingLogObserver()
        begin_or_register(self.logs)
        self.addCleanup(globalLogPublisher.removeObserver, self.logs)

        self.db = db = DatabaseManager.from_config(self.conf)
        self.metrics = db.metrics = Mock(spec=SinkMetrics)
        db.setup_tables()
예제 #3
0
    def setUp(self):
        self.timeout = 4
        twisted.internet.base.DelayedCall.debug = True

        conf = AutopushConfig(
            hostname="localhost",
            statsd_host=None,
        )

        # ignore logging
        logs = _TestingLogObserver()
        begin_or_register(logs)
        self.addCleanup(globalLogPublisher.removeObserver, logs)

        lb_app = EndpointHTTPFactory.for_handler(
            LBHeartbeatHandler, conf, db=None
        )
        ver_app = EndpointHTTPFactory.for_handler(
            VersionHandler, conf, db=None
        )
        self.lb_client = Client(lb_app)
        self.ver_client = Client(ver_app)
예제 #4
0
    def setUp(self):
        self.timeout = 0.5
        twisted.internet.base.DelayedCall.debug = True

        conf = AutopushConfig(
            hostname="localhost",
            statsd_host=None,
        )

        db = DatabaseManager.from_config(conf)
        db.client = autopush.db.g_client
        db.setup_tables()

        # ignore logging
        logs = TestingLogObserver()
        begin_or_register(logs)
        self.addCleanup(globalLogPublisher.removeObserver, logs)

        app = EndpointHTTPFactory.for_handler(HealthHandler, conf, db=db)
        self.router_table = app.db.router.table
        self.message = app.db.message
        self.client = Client(app)
예제 #5
0
    def setUp(self):
        self.timeout = 0.5
        twisted.internet.base.DelayedCall.debug = True

        self.mock_dynamodb2 = mock_dynamodb2()
        self.mock_dynamodb2.start()
        self.addCleanup(self.mock_dynamodb2.stop)

        settings = AutopushSettings(
            hostname="localhost",
            statsd_host=None,
        )

        # ignore logging
        logs = TestingLogObserver()
        begin_or_register(logs)
        self.addCleanup(globalLogPublisher.removeObserver, logs)

        app = EndpointHTTPFactory.for_handler(HealthHandler, settings)
        self.router_table = app.db.router.table
        self.storage_table = app.db.storage.table
        self.client = Client(app)