Beispiel #1
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.blob_dir = set_database_connection(self.request)
     settings = disable_cache()
     self.config = testing.setUp(request=self.request, settings=settings)
     with open(get_resource('pyramid.json'), 'rb') as pyramid_json:
         self.pypi_response = FakeGRequestResponse(200, pyramid_json.read())
Beispiel #2
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.blob_dir = set_database_connection(self.request)
     settings = disable_cache()
     self.config = testing.setUp(request=self.request, settings=settings)
     with open(get_resource('pyramid.json'), 'rb') as pyramid_json:
         self.pypi_response = FakeGRequestResponse(200, pyramid_json.read())
Beispiel #3
0
 def setUp(self):
     self.request = testing.DummyRequest(matched_route=FakeRoute("simple"))
     self.blob_dir = set_database_connection(self.request)
     self.config = testing.setUp(request=self.request)
     self.config.add_route("simple", "/simple*traverse", factory="papaye.factories:repository_root_factory")
     registry = get_current_registry()
     registry.settings = disable_cache()
Beispiel #4
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.config = testing.setUp(request=self.request)
     self.blob_dir = set_database_connection(
         self.request,
         config=self.config
     )
Beispiel #5
0
 def setUp(self):
     self.request = testing.DummyRequest(matched_route=FakeRoute('simple'))
     self.blob_dir = set_database_connection(self.request)
     settings = disable_cache()
     self.config = testing.setUp(request=self.request, settings=settings)
     self.config.add_route(
         'simple',
         '/simple*traverse',
         factory='papaye.factories:repository_root_factory')
Beispiel #6
0
def repo_configuration(request, request_factory, tmpdir, config_factory):
    settings = disable_cache()
    settings.update({
        'papaye.proxy': False,
        'papaye.packages_directory': tmpdir.strpath,
        'pyramid.incluces': 'pyramid_zodbconn',
    })
#     req = testing.DummyRequest()
    req = request_factory(matched_route=FakeRoute('simple'))
    set_database_connection(req)
    config = config_factory(settings=settings, request=req)
    deserialized_settings = {
        'papaye': {
            'packages_directory': tmpdir.strpath,
            'proxy': False,
        }
    }
    config.registry.registerUtility(
        deserialized_settings,
        ISettings,
        name='settings'
    )
    config.set_request_property(
        lambda x: deserialized_settings,
        'papaye_settings',
        reify=True
    )
    config.add_static_view(
        'repo',
        tmpdir.strpath,
        cache_max_age=3600
    )
    config.add_route(
        'simple',
        '/simple*traverse',
        factory='papaye.factories.root:repository_root_factory'
    )
    config.add_route('home', '/')

    def clean_tmp_dir():
        if os.path.exists(tmpdir.strpath):
            shutil.rmtree(tmpdir.strpath)

    request.addfinalizer(clean_tmp_dir)
Beispiel #7
0
 def setUp(self):
     self.request = testing.DummyRequest(matched_route=FakeRoute('simple'))
     self.blob_dir = set_database_connection(self.request)
     self.config = testing.setUp(request=self.request)
     self.config.add_route(
         'simple',
         '/simple*traverse',
         factory='papaye.factories:repository_root_factory')
     registry = get_current_registry()
     registry.settings = {
         'cache.regions': 'pypi',
         'cache.enabled': 'false',
     }
Beispiel #8
0
 def setUp(self):
     self.request = testing.DummyRequest(matched_route=FakeRoute('simple'))
     self.blob_dir = set_database_connection(self.request)
     self.config = testing.setUp(request=self.request)
Beispiel #9
0
 def setUp(self):
     self.request = testing.DummyRequest(matched_route=FakeRoute('simple'))
     self.blob_dir = set_database_connection(self.request)
     settings = disable_cache()
     self.config = testing.setUp(request=self.request, settings=settings)
Beispiel #10
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.config = testing.setUp(request=self.request)
     self.blob_dir = set_database_connection(self.request,
                                             config=self.config)
Beispiel #11
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.blob_dir = set_database_connection(self.request)
     settings = disable_cache()
     self.config = testing.setUp(request=self.request, settings=settings)