Esempio n. 1
0
    def _get_test_app(self, settings=None):
        app_settings = self.get_app_settings(settings)
        self.config = Configurator(settings=app_settings)
        self.config.add_subscriber(self.listener, ServerFlushed)
        self.config.commit()
        app = webtest.TestApp(main({}, config=self.config, **app_settings))
        app.RequestClass = core_support.get_request_class(prefix="v1")

        return app
Esempio n. 2
0
    def _get_test_app(self, settings=None):
        app_settings = self.get_app_settings(settings)
        self.config = Configurator(settings=app_settings)
        self.config.add_subscriber(self.listener, ServerFlushed)
        self.config.commit()
        app = webtest.TestApp(main({}, config=self.config, **app_settings))
        app.RequestClass = core_support.get_request_class(prefix="v1")

        return app
Esempio n. 3
0
 def make_app(self, settings=None):
     settings = self.get_app_settings(settings)
     self.config = Configurator(settings=settings)
     for event_cls in self.subscribed:
         self.config.add_subscriber(self.listener, event_cls)
     self.config.commit()
     app = make_testapp(config=self.config)
     app = webtest.TestApp(app)
     app.RequestClass = get_request_class(self.api_prefix)
     return app
Esempio n. 4
0
 def make_app(self, settings=None):
     settings = self.get_app_settings(settings)
     self.config = Configurator(settings=settings)
     for event_cls in self.subscribed:
         self.config.add_subscriber(self.listener, event_cls)
     self.config.commit()
     app = make_testapp(config=self.config)
     app = webtest.TestApp(app)
     app.RequestClass = get_request_class(self.api_prefix)
     return app
    def make_app(self):
        import webtest
        from kinto import main as testapp
        from kinto import DEFAULT_SETTINGS
        from kinto.tests.core import support as core_support

        settings = core_support.DEFAULT_SETTINGS.copy()
        settings.update(**DEFAULT_SETTINGS)
        settings['storage_backend'] = 'kinto.core.storage.memory'
        settings['permission_backend'] = 'kinto.core.permission.memory'
        settings['userid_hmac_secret'] = "this is not a secret"
        settings['includes'] = "kinto_attachment"

        settings['kinto.attachment.base_path'] = "/tmp"
        settings['kinto.attachment.base_url'] = ""
        settings['kinto.attachment.keep_old_files'] = "true"

        app = webtest.TestApp(testapp({}, **settings))
        app.RequestClass = core_support.get_request_class(prefix="v1")
        return app
    def make_app(self):
        import webtest
        from kinto import main as testapp
        from kinto import DEFAULT_SETTINGS
        from kinto.tests.core import support as core_support

        settings = core_support.DEFAULT_SETTINGS.copy()
        settings.update(**DEFAULT_SETTINGS)
        settings['storage_backend'] = 'kinto.core.storage.memory'
        settings['permission_backend'] = 'kinto.core.permission.memory'
        settings['userid_hmac_secret'] = "this is not a secret"
        settings['includes'] = "kinto_attachment"

        settings['kinto.attachment.base_path'] = "/tmp"
        settings['kinto.attachment.base_url'] = ""
        settings['kinto.attachment.keep_old_files'] = "true"

        app = webtest.TestApp(testapp({}, **settings))
        app.RequestClass = core_support.get_request_class(prefix="v1")
        return app
Esempio n. 7
0
 def make_app(self):
     curdir = os.path.dirname(os.path.realpath(__file__))
     app = webtest.TestApp("config:%s" % self.config, relative_to=curdir)
     app.RequestClass = core_support.get_request_class(prefix="v1")
     return app
Esempio n. 8
0
 def _get_test_app(self, settings=None):
     app = webtest.TestApp(testapp({}, **self.get_app_settings(settings)))
     app.RequestClass = core_support.get_request_class(prefix="v1")
     return app
Esempio n. 9
0
 def _get_test_app(self, settings=None):
     app = webtest.TestApp(testapp({}, **self.get_app_settings(settings)))
     app.RequestClass = core_support.get_request_class(prefix="v1")
     return app
Esempio n. 10
0
 def make_app(self):
     curdir = os.path.dirname(os.path.realpath(__file__))
     app = webtest.TestApp("config:%s" % self.config, relative_to=curdir)
     app.RequestClass = core_support.get_request_class(prefix="v1")
     return app