Exemple #1
0
 def setUp(self):
     super(AMOTestCase, self).setUp()
     self.config = 'config.ini'
     curdir = os.path.dirname(os.path.realpath(__file__))
     app = webtest.TestApp("config:%s" % self.config, relative_to=curdir)
     app.RequestClass = cliquet_support.get_request_class(prefix="v1")
     self.app = app
Exemple #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 = cliquet_support.get_request_class(prefix="v1")

        return app
Exemple #3
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 = cliquet_support.get_request_class(prefix="v1")

        return app
Exemple #4
0
 def make_app(self, settings=None):
     settings = self.get_app_settings(settings)
     self.config = Configurator(settings=settings)
     self.config.add_subscriber(self.listener, ResourceChanged)
     self.config.add_subscriber(self.listener, ResourceRead)
     self.config.commit()
     app = testapp(config=self.config)
     app = webtest.TestApp(app)
     app.RequestClass = get_request_class(self.api_prefix)
     return app
Exemple #5
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 = testapp(config=self.config)
     app = webtest.TestApp(app)
     app.RequestClass = get_request_class(self.api_prefix)
     return app
Exemple #6
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 = testapp(config=self.config)
     app = webtest.TestApp(app)
     app.RequestClass = get_request_class(self.api_prefix)
     return app
Exemple #7
0
    def __init__(self, *args, **kwargs):
        super(BaseWebTest, self).__init__(*args, **kwargs)
        self.config = testing.setUp()

        self.config.add_settings({
            'cliquet.storage_backend': 'cliquet.storage.memory',
            'cliquet.project_version': '0.0.1',
            'cliquet.project_name': 'cliquet',
            'cliquet.project_docs': 'https://cliquet.rtfd.org/',
        })

        cliquet.initialize(self.config)
        self.config.scan("cliquet.tests.testapp.views")

        self.app = webtest.TestApp(self.config.make_wsgi_app())
        self.app.RequestClass = get_request_class(self.config.route_prefix)

        self.collection_url = '/mushrooms'
        self.item_url = '/mushrooms/{id}'
    def make_app(self):
        import webtest
        from kinto import main as testapp
        from kinto import DEFAULT_SETTINGS
        from cliquet.tests import support as cliquet_support

        settings = cliquet_support.DEFAULT_SETTINGS.copy()
        settings.update(**DEFAULT_SETTINGS)
        settings['storage_backend'] = 'cliquet.storage.memory'
        settings['permission_backend'] = 'cliquet.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 = cliquet_support.get_request_class(prefix="v1")
        return app
Exemple #9
0
    def __init__(self, *args, **kwargs):
        super(BaseWebTest, self).__init__(*args, **kwargs)
        self.config = testing.setUp()

        self.config.add_settings(
            {
                "cliquet.storage_backend": "cliquet.storage.memory",
                "cliquet.project_version": "0.0.1",
                "cliquet.project_name": "cliquet",
                "cliquet.project_docs": "https://cliquet.rtfd.org/",
                "multiauth.authorization_policy": self.authorization_policy,
            }
        )

        cliquet.initialize(self.config)
        self.config.scan("cliquet.tests.testapp.views")

        self.app = webtest.TestApp(self.config.make_wsgi_app())
        self.app.RequestClass = get_request_class(self.config.route_prefix)
        self.principal = USER_PRINCIPAL

        self.headers = {"Content-Type": "application/json", "Authorization": "Basic bWF0OjE="}
Exemple #10
0
    def __init__(self, *args, **kwargs):
        super(BaseWebTest, self).__init__(*args, **kwargs)
        self.config = testing.setUp()

        self.config.add_settings({
            'cliquet.storage_backend': 'cliquet.storage.memory',
            'cliquet.project_version': '0.0.1',
            'cliquet.project_name': 'cliquet',
            'cliquet.project_docs': 'https://cliquet.rtfd.org/',
            'multiauth.authorization_policy': self.authorization_policy
        })

        cliquet.initialize(self.config)
        self.config.scan("cliquet.tests.testapp.views")

        self.app = webtest.TestApp(self.config.make_wsgi_app())
        self.app.RequestClass = get_request_class(self.config.route_prefix)
        self.item_url = '/mushrooms/{id}'
        self.principal = USER_PRINCIPAL

        self.headers = {
            'Content-Type': 'application/json',
            'Authorization': 'Basic bWF0OjE='
        }
Exemple #11
0
 def _get_test_app(self, settings=None):
     app = webtest.TestApp(testapp({}, **self.get_app_settings(settings)))
     app.RequestClass = cliquet_support.get_request_class(prefix="v1")
     return app
Exemple #12
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 = cliquet_support.get_request_class(prefix="v1")
     return app
Exemple #13
0
 def _get_test_app(self, settings=None):
     app = webtest.TestApp("config:config/readinglist.ini",
                           relative_to='.')
     app.RequestClass = get_request_class(API_VERSION)
     return app
 def make_app(self):
     curdir = os.path.dirname(os.path.realpath(__file__))
     app = webtest.TestApp("config:%s" % self.config, relative_to=curdir)
     app.RequestClass = cliquet_support.get_request_class(prefix="v1")
     return app
 def _get_test_app(self, settings=None):
     app = webtest.TestApp("config:config/readinglist.ini", relative_to='.')
     app.RequestClass = get_request_class(API_VERSION)
     return app