Esempio n. 1
0
    def get_app(self):
        self.motor_client = motor.motor_tornado.MotorClient(os.environ["MONGODB_URI"])
        self.mongo_db = self.motor_client.get_default_database()

        return make_app({
            "motor_client": self.motor_client,
            "mongo_db": self.mongo_db
        })
    def get_app(self):
        self.motor_client = motor.motor_tornado.MotorClient(
            os.environ.get("MONGODB_URI", "mongodb://127.0.0.1:27017"))
        self.mongo_db = self.motor_client["test_db"]

        return make_app({
            "motor_client": self.motor_client,
            "mongo_db": self.mongo_db
        })
    def get_app(self):
        self.mongo_db = mock.Mock()
        self.redis = mock.Mock()
        self.mysql = mock.Mock()

        return make_app({
            "mongo_db": self.mongo_db,
            "redis": self.redis,
            "mysql": self.mysql
        })
Esempio n. 4
0
    def get_app(self):
        mock_app = tornado.web.Application([("/weather", MockWeatherHandler)])
        socket, self.mock_server_port = tornado.testing.bind_unused_port()

        self.mock_server = tornado.httpserver.HTTPServer(mock_app)
        self.mock_server.add_sockets([socket])

        return make_app({
            "weather_uri":
            f"http://localhost:{self.mock_server_port}/weather"
        })
Esempio n. 5
0
 def get_app(self):
     return make_app({})
Esempio n. 6
0
    def get_app(self):
        self.redis = self.io_loop.run_sync(lambda: connect_redis(os.environ))

        return make_app({
            "redis": self.redis
        })
Esempio n. 7
0
    def get_app(self):
        self.s3_object = S3Object(os.environ["AWS_S3_BUCKET"], os.environ["AWS_S3_OBJECT"])

        return make_app({
            "s3_object": self.s3_object
        })
Esempio n. 8
0
    def get_app(self):
        self.mysql = self.io_loop.run_sync(self.setup_database)

        return make_app({"mysql": self.mysql})