Ejemplo n.º 1
0
 def setUp(self):
     self.content_api = superdesk.get_resource_service('content_api')
     self.db = self.app.data.mongo.pymongo(prefix=MONGO_PREFIX).db
     self.app.config['SECRET_KEY'] = 'secret'
     config = copy(self.app.config)
     config['AMAZON_CONTAINER_NAME'] = None  # force gridfs
     config['SERVER_NAME'] = 'localhost:5400'
     config['URL_PREFIX'] = ''
     self.capi = get_app(config)
     self.capi.testing = True
     self.subscriber = {'_id': 'sub1'}
Ejemplo n.º 2
0
 def setUp(self):
     self.content_api = superdesk.get_resource_service("content_api")
     self.db = self.app.data.mongo.pymongo(prefix=MONGO_PREFIX).db
     self.app.config["SECRET_KEY"] = "secret"
     config = copy(self.app.config)
     config["AMAZON_CONTAINER_NAME"] = None  # force gridfs
     config["SERVER_NAME"] = "localhost:5400"
     config["URL_PREFIX"] = ""
     self.capi = get_app(config)
     self.capi.testing = True
     self.subscriber = {"_id": "sub1"}
Ejemplo n.º 3
0
def setup(context=None, config=None):
    app_config = get_test_settings()
    if config:
        app_config.update(config)

    app = get_app(app_config)
    drop_elastic(app)
    drop_mongo(app)

    # create index again after dropping it
    app.data.elastic.init_app(app)

    if context:
        context.app = app
        context.client = app.test_client()
Ejemplo n.º 4
0
def setup(context=None, config=None):
    app_config = get_test_settings()
    if config:
        app_config.update(config)

    app = get_app(app_config)
    drop_elastic(app)
    drop_mongo(app)

    # create index again after dropping it
    app.data.elastic.init_app(app)

    if context:
        context.app = app
        context.client = app.test_client()
Ejemplo n.º 5
0
from content_api.app import get_app

application = get_app()
Ejemplo n.º 6
0
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

"""
A module that runs the Superdesk public API.
"""

import logging
from content_api.app import get_app


logger = logging.getLogger('superdesk')


if __name__ == '__main__':
    app = get_app()
    app.run(
        host='0.0.0.0',
        port=5050,   # XXX: have PUBAPI_PORT in config... and other things
        debug=False,  # TODO: remove before pushing to production (+ have in cfg)
        use_reloader=False
    )
Ejemplo n.º 7
0
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license

"""
A module that runs the Superdesk public API.
"""

import logging
from content_api.app import get_app


logger = logging.getLogger('superdesk')


if __name__ == '__main__':
    app = get_app()
    app.run(
        host='0.0.0.0',
        port=5050,   # XXX: have PUBAPI_PORT in config... and other things
        debug=True,  # TODO: remove before pushing to production (+ have in cfg)
        use_reloader=True
    )
Ejemplo n.º 8
0
 def setUp(self):
     self.content_api = superdesk.get_resource_service('content_api')
     self.db = self.app.data.mongo.pymongo(prefix=MONGO_PREFIX).db
     self.app.config['SECRET_KEY'] = 'secret'
     self.capi = get_app(copy(self.app.config))
     self.capi.testing = True
Ejemplo n.º 9
0
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license


from content_api.app import get_app

application = get_app()