summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO.txt6
-rw-r--r--docs/narr/MyProject/myproject/run.py2
-rw-r--r--docs/narr/MyProject/myproject/tests.py4
-rw-r--r--docs/tutorials/bfgwiki/src/authorization/tutorial/login.py8
-rw-r--r--docs/tutorials/bfgwiki/src/authorization/tutorial/models.py4
-rw-r--r--docs/tutorials/bfgwiki/src/authorization/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py6
-rw-r--r--docs/tutorials/bfgwiki/src/authorization/tutorial/views.py6
-rw-r--r--docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki/src/models/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki/src/models/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py6
-rw-r--r--docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py4
-rw-r--r--docs/tutorials/bfgwiki/src/views/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki/src/views/tutorial/tests.py6
-rw-r--r--docs/tutorials/bfgwiki/src/views/tutorial/views.py2
-rw-r--r--docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py6
-rw-r--r--docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/models/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki2/src/models/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/views/tutorial/run.py2
-rw-r--r--docs/tutorials/bfgwiki2/src/views/tutorial/tests.py4
-rw-r--r--docs/tutorials/bfgwiki2/src/views/tutorial/views.py2
-rw-r--r--pyramid/__init__.py3
-rw-r--r--pyramid/authentication.py8
-rw-r--r--pyramid/authorization.py16
-rw-r--r--pyramid/chameleon_text.py16
-rw-r--r--pyramid/chameleon_zpt.py14
-rw-r--r--pyramid/configuration.py128
-rw-r--r--pyramid/events.py8
-rw-r--r--pyramid/exceptions.py4
-rw-r--r--pyramid/i18n.py10
-rw-r--r--pyramid/includes/meta.zcml72
-rw-r--r--pyramid/paster.py2
-rw-r--r--pyramid/renderers.py22
-rw-r--r--pyramid/request.py4
-rw-r--r--pyramid/resource.py8
-rw-r--r--pyramid/router.py44
-rw-r--r--pyramid/scripting.py4
-rw-r--r--pyramid/security.py12
-rw-r--r--pyramid/settings.py4
-rw-r--r--pyramid/static.py8
-rw-r--r--pyramid/testing.py40
-rw-r--r--pyramid/tests/ccbugapp/configure.zcml2
-rw-r--r--pyramid/tests/exceptionviewapp/configure.zcml2
-rw-r--r--pyramid/tests/fixtureapp/another.zcml2
-rw-r--r--pyramid/tests/fixtureapp/configure.zcml2
-rw-r--r--pyramid/tests/fixtureapp/subpackage/yetanother.zcml4
-rw-r--r--pyramid/tests/fixtureapp/views.py2
-rw-r--r--pyramid/tests/grokkedapp/__init__.py2
-rw-r--r--pyramid/tests/grokkedapp/another.py2
-rw-r--r--pyramid/tests/grokkedapp/configure.zcml2
-rw-r--r--pyramid/tests/grokkedapp/pod/notinit.py2
-rw-r--r--pyramid/tests/grokkedapp/subpackage/__init__.py2
-rw-r--r--pyramid/tests/grokkedapp/subpackage/notinit.py2
-rw-r--r--pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py2
-rw-r--r--pyramid/tests/hybridapp/configure.zcml6
-rw-r--r--pyramid/tests/restbugapp/configure.zcml2
-rw-r--r--pyramid/tests/routesapp/configure.zcml2
-rw-r--r--pyramid/tests/test_authentication.py46
-rw-r--r--pyramid/tests/test_authorization.py32
-rw-r--r--pyramid/tests/test_chameleon_text.py32
-rw-r--r--pyramid/tests/test_chameleon_zpt.py32
-rw-r--r--pyramid/tests/test_compat.py2
-rw-r--r--pyramid/tests/test_configuration.py794
-rw-r--r--pyramid/tests/test_decorator.py2
-rw-r--r--pyramid/tests/test_encode.py6
-rw-r--r--pyramid/tests/test_events.py56
-rw-r--r--pyramid/tests/test_exceptions.py10
-rw-r--r--pyramid/tests/test_i18n.py52
-rw-r--r--pyramid/tests/test_integration.py34
-rw-r--r--pyramid/tests/test_location.py6
-rw-r--r--pyramid/tests/test_log.py2
-rw-r--r--pyramid/tests/test_paster.py4
-rw-r--r--pyramid/tests/test_path.py58
-rw-r--r--pyramid/tests/test_registry.py2
-rw-r--r--pyramid/tests/test_renderers.py96
-rw-r--r--pyramid/tests/test_request.py10
-rw-r--r--pyramid/tests/test_resource.py126
-rw-r--r--pyramid/tests/test_router.py206
-rw-r--r--pyramid/tests/test_scripting.py2
-rw-r--r--pyramid/tests/test_security.py60
-rw-r--r--pyramid/tests/test_settings.py10
-rw-r--r--pyramid/tests/test_static.py40
-rw-r--r--pyramid/tests/test_testing.py146
-rw-r--r--pyramid/tests/test_threadlocal.py16
-rw-r--r--pyramid/tests/test_traversal.py68
-rw-r--r--pyramid/tests/test_url.py44
-rw-r--r--pyramid/tests/test_urldispatch.py22
-rw-r--r--pyramid/tests/test_view.py38
-rw-r--r--pyramid/tests/test_wsgi.py4
-rw-r--r--pyramid/tests/test_zcml.py280
-rw-r--r--pyramid/tests/viewdecoratorapp/configure.zcml2
-rw-r--r--pyramid/tests/viewdecoratorapp/views/views.py4
-rw-r--r--pyramid/threadlocal.py2
-rw-r--r--pyramid/traversal.py20
-rw-r--r--pyramid/url.py18
-rw-r--r--pyramid/urldispatch.py16
-rw-r--r--pyramid/view.py16
-rw-r--r--pyramid/wsgi.py4
-rw-r--r--pyramid/zcml.py38
-rw-r--r--setup.cfg5
-rw-r--r--setup.py25
110 files changed, 1535 insertions, 1530 deletions
diff --git a/TODO.txt b/TODO.txt
index 069af7b05..840dfb072 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -82,3 +82,9 @@
- CRSF token machinery
+- Converter: <configure xmlns="http://namespaces.repoze.org/bfg"> ->
+ <configure xmlns="http://pyramid.pylonshq.com/">
+
+- Converter: <include package="repoze.bfg.includes" /> ->
+ <include package="pyramid.includes" />
+
diff --git a/docs/narr/MyProject/myproject/run.py b/docs/narr/MyProject/myproject/run.py
index ce1c7a81e..9b6ba7072 100644
--- a/docs/narr/MyProject/myproject/run.py
+++ b/docs/narr/MyProject/myproject/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from myproject.models import get_root
def app(global_config, **settings):
diff --git a/docs/narr/MyProject/myproject/tests.py b/docs/narr/MyProject/myproject/tests.py
index 498bd96e8..e179819d7 100644
--- a/docs/narr/MyProject/myproject/tests.py
+++ b/docs/narr/MyProject/myproject/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/login.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/login.py
index 8620dc705..c029f25ce 100644
--- a/docs/tutorials/bfgwiki/src/authorization/tutorial/login.py
+++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/login.py
@@ -1,10 +1,10 @@
from webob.exc import HTTPFound
-from repoze.bfg.view import bfg_view
-from repoze.bfg.url import model_url
+from pyramid.view import bfg_view
+from pyramid.url import model_url
-from repoze.bfg.security import remember
-from repoze.bfg.security import forget
+from pyramid.security import remember
+from pyramid.security import forget
from tutorial.models import Wiki
from tutorial.security import USERS
diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/models.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/models.py
index 08e1da7e4..dcffc28ac 100644
--- a/docs/tutorials/bfgwiki/src/authorization/tutorial/models.py
+++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/models.py
@@ -1,8 +1,8 @@
from persistent import Persistent
from persistent.mapping import PersistentMapping
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Everyone
+from pyramid.security import Allow
+from pyramid.security import Everyone
class Wiki(PersistentMapping):
__name__ = None
diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py
index 6efc148c3..875e77590 100644
--- a/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py
+++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py
index 6853bc376..d082fb84d 100644
--- a/docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ class AddPageTests(unittest.TestCase):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -106,7 +106,7 @@ class EditPageTests(unittest.TestCase):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/views.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/views.py
index 17ca01566..f0fef5d81 100644
--- a/docs/tutorials/bfgwiki/src/authorization/tutorial/views.py
+++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/views.py
@@ -2,11 +2,11 @@ from docutils.core import publish_parts
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
+from pyramid.url import model_url
-from repoze.bfg.security import authenticated_userid
+from pyramid.security import authenticated_userid
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
from tutorial.models import Page
from tutorial.models import Wiki
diff --git a/docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py b/docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py
index d1575b19a..5eef90841 100644
--- a/docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py
+++ b/docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
diff --git a/docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py b/docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py
index 32821ce0e..e11b3625e 100644
--- a/docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
diff --git a/docs/tutorials/bfgwiki/src/models/tutorial/run.py b/docs/tutorials/bfgwiki/src/models/tutorial/run.py
index d1575b19a..5eef90841 100644
--- a/docs/tutorials/bfgwiki/src/models/tutorial/run.py
+++ b/docs/tutorials/bfgwiki/src/models/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
diff --git a/docs/tutorials/bfgwiki/src/models/tutorial/tests.py b/docs/tutorials/bfgwiki/src/models/tutorial/tests.py
index 1eee68e7f..2f5bc48e3 100644
--- a/docs/tutorials/bfgwiki/src/models/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki/src/models/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class PageModelTests(unittest.TestCase):
diff --git a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py
index d1575b19a..5eef90841 100644
--- a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py
+++ b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
diff --git a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py
index 6853bc376..d082fb84d 100644
--- a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ class AddPageTests(unittest.TestCase):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -106,7 +106,7 @@ class EditPageTests(unittest.TestCase):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
diff --git a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py
index 08489f4ef..60cb49faa 100644
--- a/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py
+++ b/docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py
@@ -2,8 +2,8 @@ from docutils.core import publish_parts
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
-from repoze.bfg.view import bfg_view
+from pyramid.url import model_url
+from pyramid.view import bfg_view
from tutorial.models import Page
from tutorial.models import Wiki
diff --git a/docs/tutorials/bfgwiki/src/views/tutorial/run.py b/docs/tutorials/bfgwiki/src/views/tutorial/run.py
index d1575b19a..5eef90841 100644
--- a/docs/tutorials/bfgwiki/src/views/tutorial/run.py
+++ b/docs/tutorials/bfgwiki/src/views/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
diff --git a/docs/tutorials/bfgwiki/src/views/tutorial/tests.py b/docs/tutorials/bfgwiki/src/views/tutorial/tests.py
index 1ebdbf63e..c5aafcac5 100644
--- a/docs/tutorials/bfgwiki/src/views/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki/src/views/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ class AddPageTests(unittest.TestCase):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -107,7 +107,7 @@ class EditPageTests(unittest.TestCase):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
diff --git a/docs/tutorials/bfgwiki/src/views/tutorial/views.py b/docs/tutorials/bfgwiki/src/views/tutorial/views.py
index 57ca24d1b..f13ed0381 100644
--- a/docs/tutorials/bfgwiki/src/views/tutorial/views.py
+++ b/docs/tutorials/bfgwiki/src/views/tutorial/views.py
@@ -2,7 +2,7 @@ from docutils.core import publish_parts
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
+from pyramid.url import model_url
from tutorial.models import Page
diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py
index 893a07a5d..1a54d575c 100644
--- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py
+++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py
@@ -1,8 +1,8 @@
from webob.exc import HTTPFound
-from repoze.bfg.security import remember
-from repoze.bfg.security import forget
-from repoze.bfg.url import route_url
+from pyramid.security import remember
+from pyramid.security import forget
+from pyramid.url import route_url
from tutorial.security import USERS
diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py
index f8acf5f49..a77b4964c 100644
--- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py
+++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py
@@ -1,7 +1,7 @@
import transaction
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Everyone
+from pyramid.security import Allow
+from pyramid.security import Everyone
from sqlalchemy import create_engine
from sqlalchemy import Column
diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py
index 65dbfd5d3..82ce37490 100644
--- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py
+++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py
index 7bc8e11ce..65330ce17 100644
--- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import DBSession
diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py
index 49167a629..a7e7a57c7 100644
--- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py
+++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py
@@ -4,8 +4,8 @@ from docutils.core import publish_parts
from webob.exc import HTTPFound
-from repoze.bfg.security import authenticated_userid
-from repoze.bfg.url import route_url
+from pyramid.security import authenticated_userid
+from pyramid.url import route_url
from tutorial.models import DBSession
from tutorial.models import Page
diff --git a/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py b/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py
index 35cd79e10..7225987ee 100644
--- a/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py
+++ b/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py b/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py
index 2ef74cce7..72f0c89d8 100644
--- a/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/models/tutorial/run.py b/docs/tutorials/bfgwiki2/src/models/tutorial/run.py
index 35cd79e10..7225987ee 100644
--- a/docs/tutorials/bfgwiki2/src/models/tutorial/run.py
+++ b/docs/tutorials/bfgwiki2/src/models/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/models/tutorial/tests.py b/docs/tutorials/bfgwiki2/src/models/tutorial/tests.py
index 2ef74cce7..72f0c89d8 100644
--- a/docs/tutorials/bfgwiki2/src/models/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki2/src/models/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/views/tutorial/run.py b/docs/tutorials/bfgwiki2/src/views/tutorial/run.py
index 35cd79e10..7225987ee 100644
--- a/docs/tutorials/bfgwiki2/src/views/tutorial/run.py
+++ b/docs/tutorials/bfgwiki2/src/views/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
diff --git a/docs/tutorials/bfgwiki2/src/views/tutorial/tests.py b/docs/tutorials/bfgwiki2/src/views/tutorial/tests.py
index 15e00a355..40336fca4 100644
--- a/docs/tutorials/bfgwiki2/src/views/tutorial/tests.py
+++ b/docs/tutorials/bfgwiki2/src/views/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import DBSession
diff --git a/docs/tutorials/bfgwiki2/src/views/tutorial/views.py b/docs/tutorials/bfgwiki2/src/views/tutorial/views.py
index bb1a87932..c0d793d38 100644
--- a/docs/tutorials/bfgwiki2/src/views/tutorial/views.py
+++ b/docs/tutorials/bfgwiki2/src/views/tutorial/views.py
@@ -4,7 +4,7 @@ from docutils.core import publish_parts
from webob.exc import HTTPFound
-from repoze.bfg.url import route_url
+from pyramid.url import route_url
from tutorial.models import DBSession
from tutorial.models import Page
diff --git a/pyramid/__init__.py b/pyramid/__init__.py
index f33bdbc35..5f6a326f8 100644
--- a/pyramid/__init__.py
+++ b/pyramid/__init__.py
@@ -1 +1,2 @@
-__import__('pkg_resources').declare_namespace(__name__) #pragma NO COVERAGE
+# pyramid package
+
diff --git a/pyramid/authentication.py b/pyramid/authentication.py
index 54e106af5..443f91428 100644
--- a/pyramid/authentication.py
+++ b/pyramid/authentication.py
@@ -8,11 +8,11 @@ from paste.request import get_cookies
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthenticationPolicy
-from repoze.bfg.request import add_global_response_headers
-from repoze.bfg.security import Authenticated
-from repoze.bfg.security import Everyone
+from pyramid.request import add_global_response_headers
+from pyramid.security import Authenticated
+from pyramid.security import Everyone
class CallbackAuthenticationPolicy(object):
""" Abstract class """
diff --git a/pyramid/authorization.py b/pyramid/authorization.py
index 8c46b4a33..d06069c63 100644
--- a/pyramid/authorization.py
+++ b/pyramid/authorization.py
@@ -1,13 +1,13 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthorizationPolicy
-
-from repoze.bfg.location import lineage
-from repoze.bfg.security import ACLAllowed
-from repoze.bfg.security import ACLDenied
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Deny
-from repoze.bfg.security import Everyone
+from pyramid.interfaces import IAuthorizationPolicy
+
+from pyramid.location import lineage
+from pyramid.security import ACLAllowed
+from pyramid.security import ACLDenied
+from pyramid.security import Allow
+from pyramid.security import Deny
+from pyramid.security import Everyone
class ACLAuthorizationPolicy(object):
""" An :term:`authorization policy` which consults an :term:`ACL`
diff --git a/pyramid/chameleon_text.py b/pyramid/chameleon_text.py
index 4a9d2655e..337075c36 100644
--- a/pyramid/chameleon_text.py
+++ b/pyramid/chameleon_text.py
@@ -20,14 +20,14 @@ except ImportError: # pragma: no cover
class Parser(object):
pass
-from repoze.bfg.interfaces import ITemplateRenderer
-from repoze.bfg.interfaces import IChameleonTranslate
-
-from repoze.bfg.decorator import reify
-from repoze.bfg import renderers
-from repoze.bfg.path import caller_package
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.interfaces import ITemplateRenderer
+from pyramid.interfaces import IChameleonTranslate
+
+from pyramid.decorator import reify
+from pyramid import renderers
+from pyramid.path import caller_package
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
class TextTemplateFile(TemplateFile):
default_parser = Parser()
diff --git a/pyramid/chameleon_zpt.py b/pyramid/chameleon_zpt.py
index 3c1c59f1c..beedd6fc9 100644
--- a/pyramid/chameleon_zpt.py
+++ b/pyramid/chameleon_zpt.py
@@ -12,14 +12,14 @@ except ImportError: # pragma: no cover
def __init__(self, *arg, **kw):
raise ImportError, exc, tb
-from repoze.bfg.interfaces import IChameleonTranslate
-from repoze.bfg.interfaces import ITemplateRenderer
+from pyramid.interfaces import IChameleonTranslate
+from pyramid.interfaces import ITemplateRenderer
-from repoze.bfg.decorator import reify
-from repoze.bfg.path import caller_package
-from repoze.bfg import renderers
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.decorator import reify
+from pyramid.path import caller_package
+from pyramid import renderers
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
def renderer_factory(path):
return renderers.template_renderer_factory(path, ZPTTemplateRenderer)
diff --git a/pyramid/configuration.py b/pyramid/configuration.py
index 88bdcba58..e333b6de9 100644
--- a/pyramid/configuration.py
+++ b/pyramid/configuration.py
@@ -16,65 +16,65 @@ from zope.interface import implementedBy
from zope.interface.interfaces import IInterface
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthenticationPolicy
-from repoze.bfg.interfaces import IAuthorizationPolicy
-from repoze.bfg.interfaces import IChameleonTranslate
-from repoze.bfg.interfaces import IDebugLogger
-from repoze.bfg.interfaces import IDefaultPermission
-from repoze.bfg.interfaces import IDefaultRootFactory
-from repoze.bfg.interfaces import IExceptionViewClassifier
-from repoze.bfg.interfaces import ILocaleNegotiator
-from repoze.bfg.interfaces import IMultiView
-from repoze.bfg.interfaces import IPackageOverrides
-from repoze.bfg.interfaces import IRendererFactory
-from repoze.bfg.interfaces import IRendererGlobalsFactory
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRequestFactory
-from repoze.bfg.interfaces import IRootFactory
-from repoze.bfg.interfaces import IRouteRequest
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import ISettings
-from repoze.bfg.interfaces import IStaticURLInfo
-from repoze.bfg.interfaces import ITranslationDirectories
-from repoze.bfg.interfaces import ITraverser
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-from repoze.bfg.interfaces import IExceptionResponse
-from repoze.bfg.interfaces import IException
-
-from repoze.bfg import chameleon_text
-from repoze.bfg import chameleon_zpt
-from repoze.bfg import renderers
-from repoze.bfg.renderers import RendererHelper
-from repoze.bfg.authorization import ACLAuthorizationPolicy
-from repoze.bfg.compat import all
-from repoze.bfg.compat import md5
-from repoze.bfg.events import ApplicationCreated
-from repoze.bfg.exceptions import Forbidden
-from repoze.bfg.exceptions import NotFound
-from repoze.bfg.exceptions import PredicateMismatch
-from repoze.bfg.exceptions import ConfigurationError
-from repoze.bfg.i18n import get_localizer
-from repoze.bfg.log import make_stream_logger
-from repoze.bfg.path import caller_package
-from repoze.bfg.path import package_path
-from repoze.bfg.path import package_of
-from repoze.bfg.registry import Registry
-from repoze.bfg.request import route_request_iface
-from repoze.bfg.resource import PackageOverrides
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.settings import Settings
-from repoze.bfg.static import StaticURLInfo
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.threadlocal import get_current_request
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.traversal import traversal_path
-from repoze.bfg.traversal import DefaultRootFactory
-from repoze.bfg.traversal import find_interface
-from repoze.bfg.urldispatch import RoutesMapper
-from repoze.bfg.view import render_view_to_response
-from repoze.bfg.view import default_exceptionresponse_view
+from pyramid.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthorizationPolicy
+from pyramid.interfaces import IChameleonTranslate
+from pyramid.interfaces import IDebugLogger
+from pyramid.interfaces import IDefaultPermission
+from pyramid.interfaces import IDefaultRootFactory
+from pyramid.interfaces import IExceptionViewClassifier
+from pyramid.interfaces import ILocaleNegotiator
+from pyramid.interfaces import IMultiView
+from pyramid.interfaces import IPackageOverrides
+from pyramid.interfaces import IRendererFactory
+from pyramid.interfaces import IRendererGlobalsFactory
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRequestFactory
+from pyramid.interfaces import IRootFactory
+from pyramid.interfaces import IRouteRequest
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import ISettings
+from pyramid.interfaces import IStaticURLInfo
+from pyramid.interfaces import ITranslationDirectories
+from pyramid.interfaces import ITraverser
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IExceptionResponse
+from pyramid.interfaces import IException
+
+from pyramid import chameleon_text
+from pyramid import chameleon_zpt
+from pyramid import renderers
+from pyramid.renderers import RendererHelper
+from pyramid.authorization import ACLAuthorizationPolicy
+from pyramid.compat import all
+from pyramid.compat import md5
+from pyramid.events import ApplicationCreated
+from pyramid.exceptions import Forbidden
+from pyramid.exceptions import NotFound
+from pyramid.exceptions import PredicateMismatch
+from pyramid.exceptions import ConfigurationError
+from pyramid.i18n import get_localizer
+from pyramid.log import make_stream_logger
+from pyramid.path import caller_package
+from pyramid.path import package_path
+from pyramid.path import package_of
+from pyramid.registry import Registry
+from pyramid.request import route_request_iface
+from pyramid.resource import PackageOverrides
+from pyramid.resource import resolve_resource_spec
+from pyramid.settings import Settings
+from pyramid.static import StaticURLInfo
+from pyramid.threadlocal import get_current_registry
+from pyramid.threadlocal import get_current_request
+from pyramid.threadlocal import manager
+from pyramid.traversal import traversal_path
+from pyramid.traversal import DefaultRootFactory
+from pyramid.traversal import find_interface
+from pyramid.urldispatch import RoutesMapper
+from pyramid.view import render_view_to_response
+from pyramid.view import default_exceptionresponse_view
MAX_ORDER = 1 << 30
DEFAULT_PHASH = md5().hexdigest()
@@ -598,7 +598,7 @@ class Configurator(object):
the current configuration state and sends a
:class:`repoze.bfg.interfaces.IApplicationCreated`
event to all listeners."""
- from repoze.bfg.router import Router # avoid circdep
+ from pyramid.router import Router # avoid circdep
app = Router(self.registry)
# We push the registry on to the stack here in case any code
# that depends on the registry threadlocal APIs used in
@@ -1879,7 +1879,7 @@ class Configurator(object):
:func:`repoze.bfg.security.effective_principals`, and
:func:`repoze.bfg.security.principals_allowed_by_permission`.
"""
- from repoze.bfg.testing import DummySecurityPolicy
+ from pyramid.testing import DummySecurityPolicy
policy = DummySecurityPolicy(userid, groupids, permissive)
self.registry.registerUtility(policy, IAuthorizationPolicy)
self.registry.registerUtility(policy, IAuthenticationPolicy)
@@ -1962,7 +1962,7 @@ class Configurator(object):
method named ``testing_add_template`` had the same signature
and purpose in previous releases)..
"""
- from repoze.bfg.testing import DummyRendererFactory
+ from pyramid.testing import DummyRendererFactory
helper = RendererHelper(path, registry=self.registry)
factory = helper.factory
if not isinstance(factory, DummyRendererFactory):
@@ -1970,7 +1970,7 @@ class Configurator(object):
self.registry.registerUtility(factory, IRendererFactory,
name=helper.renderer_type)
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
if renderer is None:
renderer = DummyTemplateRenderer()
factory.add(helper.renderer_name, renderer)
@@ -2114,7 +2114,7 @@ def _make_predicates(xhr=None, request_method=None, path_info=None,
# adds 'traverse' to the matchdict if it's specified in the
# routing args. This causes the ModelGraphTraverser to use
# the resolved traverse pattern as the traversal path.
- from repoze.bfg.urldispatch import _compile_route
+ from pyramid.urldispatch import _compile_route
_, tgenerate = _compile_route(traverse)
def traverse_predicate(context, request):
if 'traverse' in context:
diff --git a/pyramid/events.py b/pyramid/events.py
index efcbdf61f..9a5ff3a7b 100644
--- a/pyramid/events.py
+++ b/pyramid/events.py
@@ -2,10 +2,10 @@ import venusian
from zope.interface import implements
-from repoze.bfg.interfaces import IContextFound
-from repoze.bfg.interfaces import INewRequest
-from repoze.bfg.interfaces import INewResponse
-from repoze.bfg.interfaces import IApplicationCreated
+from pyramid.interfaces import IContextFound
+from pyramid.interfaces import INewRequest
+from pyramid.interfaces import INewResponse
+from pyramid.interfaces import IApplicationCreated
class subscriber(object):
""" Decorator activated via a :term:`scan` which treats the
diff --git a/pyramid/exceptions.py b/pyramid/exceptions.py
index 9b885d9dc..785a26cee 100644
--- a/pyramid/exceptions.py
+++ b/pyramid/exceptions.py
@@ -1,8 +1,8 @@
from zope.configuration.exceptions import ConfigurationError as ZCE
from zope.interface import implements
-from repoze.bfg.decorator import reify
-from repoze.bfg.interfaces import IExceptionResponse
+from pyramid.decorator import reify
+from pyramid.interfaces import IExceptionResponse
import cgi
class ExceptionResponse(Exception):
diff --git a/pyramid/i18n.py b/pyramid/i18n.py
index c3ba7efad..d082ef6bf 100644
--- a/pyramid/i18n.py
+++ b/pyramid/i18n.py
@@ -9,12 +9,12 @@ from translationstring import TranslationStringFactory # API
TranslationString = TranslationString # PyFlakes
TranslationStringFactory = TranslationStringFactory # PyFlakes
-from repoze.bfg.interfaces import ILocalizer
-from repoze.bfg.interfaces import ITranslationDirectories
-from repoze.bfg.interfaces import ILocaleNegotiator
+from pyramid.interfaces import ILocalizer
+from pyramid.interfaces import ITranslationDirectories
+from pyramid.interfaces import ILocaleNegotiator
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
class Localizer(object):
"""
diff --git a/pyramid/includes/meta.zcml b/pyramid/includes/meta.zcml
index 58ab1c782..26a475ee3 100644
--- a/pyramid/includes/meta.zcml
+++ b/pyramid/includes/meta.zcml
@@ -6,110 +6,110 @@
<meta:directive
name="view"
- schema="repoze.bfg.zcml.IViewDirective"
- handler="repoze.bfg.zcml.view"
+ schema="pyramid.zcml.IViewDirective"
+ handler="pyramid.zcml.view"
/>
<meta:directive
name="scan"
- schema="repoze.bfg.zcml.IScanDirective"
- handler="repoze.bfg.zcml.scan"
+ schema="pyramid.zcml.IScanDirective"
+ handler="pyramid.zcml.scan"
/>
<meta:directive
name="notfound"
- schema="repoze.bfg.zcml.ISystemViewDirective"
- handler="repoze.bfg.zcml.notfound"
+ schema="pyramid.zcml.ISystemViewDirective"
+ handler="pyramid.zcml.notfound"
/>
<meta:directive
name="forbidden"
- schema="repoze.bfg.zcml.ISystemViewDirective"
- handler="repoze.bfg.zcml.forbidden"
+ schema="pyramid.zcml.ISystemViewDirective"
+ handler="pyramid.zcml.forbidden"
/>
<meta:directive
name="route"
- schema="repoze.bfg.zcml.IRouteDirective"
- handler="repoze.bfg.zcml.route"
+ schema="pyramid.zcml.IRouteDirective"
+ handler="pyramid.zcml.route"
/>
<meta:directive
name="resource"
- schema="repoze.bfg.zcml.IResourceDirective"
- handler="repoze.bfg.zcml.resource"
+ schema="pyramid.zcml.IResourceDirective"
+ handler="pyramid.zcml.resource"
/>
<meta:directive
name="static"
- schema="repoze.bfg.zcml.IStaticDirective"
- handler="repoze.bfg.zcml.static"
+ schema="pyramid.zcml.IStaticDirective"
+ handler="pyramid.zcml.static"
/>
<meta:directive
name="renderer"
- schema="repoze.bfg.zcml.IRendererDirective"
- handler="repoze.bfg.zcml.renderer"
+ schema="pyramid.zcml.IRendererDirective"
+ handler="pyramid.zcml.renderer"
/>
<meta:directive
name="repozewho1authenticationpolicy"
- schema="repoze.bfg.zcml.IRepozeWho1AuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.repozewho1authenticationpolicy"
+ schema="pyramid.zcml.IRepozeWho1AuthenticationPolicyDirective"
+ handler="pyramid.zcml.repozewho1authenticationpolicy"
/>
<meta:directive
name="remoteuserauthenticationpolicy"
- schema="repoze.bfg.zcml.IRemoteUserAuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.remoteuserauthenticationpolicy"
+ schema="pyramid.zcml.IRemoteUserAuthenticationPolicyDirective"
+ handler="pyramid.zcml.remoteuserauthenticationpolicy"
/>
<meta:directive
name="authtktauthenticationpolicy"
- schema="repoze.bfg.zcml.IAuthTktAuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.authtktauthenticationpolicy"
+ schema="pyramid.zcml.IAuthTktAuthenticationPolicyDirective"
+ handler="pyramid.zcml.authtktauthenticationpolicy"
/>
<meta:directive
name="aclauthorizationpolicy"
- schema="repoze.bfg.zcml.IACLAuthorizationPolicyDirective"
- handler="repoze.bfg.zcml.aclauthorizationpolicy"
+ schema="pyramid.zcml.IACLAuthorizationPolicyDirective"
+ handler="pyramid.zcml.aclauthorizationpolicy"
/>
<meta:directive
name="translationdir"
- schema="repoze.bfg.zcml.ITranslationDirDirective"
- handler="repoze.bfg.zcml.translationdir"
+ schema="pyramid.zcml.ITranslationDirDirective"
+ handler="pyramid.zcml.translationdir"
/>
<meta:directive
name="localenegotiator"
- schema="repoze.bfg.zcml.ILocaleNegotiatorDirective"
- handler="repoze.bfg.zcml.localenegotiator"
+ schema="pyramid.zcml.ILocaleNegotiatorDirective"
+ handler="pyramid.zcml.localenegotiator"
/>
<meta:directive
name="adapter"
- schema="repoze.bfg.zcml.IAdapterDirective"
- handler="repoze.bfg.zcml.adapter"
+ schema="pyramid.zcml.IAdapterDirective"
+ handler="pyramid.zcml.adapter"
/>
<meta:directive
name="subscriber"
- schema="repoze.bfg.zcml.ISubscriberDirective"
- handler="repoze.bfg.zcml.subscriber"
+ schema="pyramid.zcml.ISubscriberDirective"
+ handler="pyramid.zcml.subscriber"
/>
<meta:directive
name="utility"
- schema="repoze.bfg.zcml.IUtilityDirective"
- handler="repoze.bfg.zcml.utility"
+ schema="pyramid.zcml.IUtilityDirective"
+ handler="pyramid.zcml.utility"
/>
<meta:directive
name="default_permission"
- schema="repoze.bfg.zcml.IDefaultPermissionDirective"
- handler="repoze.bfg.zcml.default_permission"
+ schema="pyramid.zcml.IDefaultPermissionDirective"
+ handler="pyramid.zcml.default_permission"
/>
</meta:directives>
diff --git a/pyramid/paster.py b/pyramid/paster.py
index e8ce46ce2..e84cd42d9 100644
--- a/pyramid/paster.py
+++ b/pyramid/paster.py
@@ -7,7 +7,7 @@ from paste.script.command import Command
from paste.script.templates import Template
from paste.util.template import paste_script_template_renderer
-from repoze.bfg.scripting import get_root
+from pyramid.scripting import get_root
class StarterProjectTemplate(Template):
diff --git a/pyramid/renderers.py b/pyramid/renderers.py
index 00413e3fe..a1b3196c4 100644
--- a/pyramid/renderers.py
+++ b/pyramid/renderers.py
@@ -6,17 +6,17 @@ from webob import Response
from zope.deprecation import deprecated
-from repoze.bfg.interfaces import IRendererGlobalsFactory
-from repoze.bfg.interfaces import IRendererFactory
-from repoze.bfg.interfaces import IResponseFactory
-from repoze.bfg.interfaces import ITemplateRenderer
-
-from repoze.bfg.compat import json
-from repoze.bfg.path import caller_package
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.decorator import reify
+from pyramid.interfaces import IRendererGlobalsFactory
+from pyramid.interfaces import IRendererFactory
+from pyramid.interfaces import IResponseFactory
+from pyramid.interfaces import ITemplateRenderer
+
+from pyramid.compat import json
+from pyramid.path import caller_package
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
+from pyramid.resource import resolve_resource_spec
+from pyramid.decorator import reify
# API
diff --git a/pyramid/request.py b/pyramid/request.py
index f32a7a40c..04ce1acd7 100644
--- a/pyramid/request.py
+++ b/pyramid/request.py
@@ -4,7 +4,7 @@ from zope.interface.interface import InterfaceClass
from webob import Request as WebobRequest
-from repoze.bfg.interfaces import IRequest
+from pyramid.interfaces import IRequest
class Request(WebobRequest):
"""
@@ -217,7 +217,7 @@ def add_global_response_headers(request, headerlist):
response.headerlist.append((k, v))
request.add_response_callback(add_headers)
-from repoze.bfg.threadlocal import get_current_request as get_request # b/c
+from pyramid.threadlocal import get_current_request as get_request # b/c
get_request # prevent PyFlakes complaints
diff --git a/pyramid/resource.py b/pyramid/resource.py
index da49f16ec..b2b2e43a1 100644
--- a/pyramid/resource.py
+++ b/pyramid/resource.py
@@ -3,11 +3,11 @@ import pkg_resources
from zope.interface import implements
-from repoze.bfg.interfaces import IPackageOverrides
+from pyramid.interfaces import IPackageOverrides
-from repoze.bfg.path import package_path
-from repoze.bfg.path import package_name
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.path import package_path
+from pyramid.path import package_name
+from pyramid.threadlocal import get_current_registry
class OverrideProvider(pkg_resources.DefaultProvider):
def __init__(self, module):
diff --git a/pyramid/router.py b/pyramid/router.py
index 7b3bcb75e..d140f8225 100644
--- a/pyramid/router.py
+++ b/pyramid/router.py
@@ -1,28 +1,28 @@
from zope.interface import implements
from zope.interface import providedBy
-from repoze.bfg.interfaces import IDebugLogger
-from repoze.bfg.interfaces import IExceptionViewClassifier
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRootFactory
-from repoze.bfg.interfaces import IRouteRequest
-from repoze.bfg.interfaces import IRouter
-from repoze.bfg.interfaces import IRequestFactory
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISettings
-from repoze.bfg.interfaces import ITraverser
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-
-from repoze.bfg.configuration import make_app # b/c import
-from repoze.bfg.events import ContextFound
-from repoze.bfg.events import NewRequest
-from repoze.bfg.events import NewResponse
-from repoze.bfg.exceptions import NotFound
-from repoze.bfg.request import Request
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.traversal import DefaultRootFactory
-from repoze.bfg.traversal import ModelGraphTraverser
+from pyramid.interfaces import IDebugLogger
+from pyramid.interfaces import IExceptionViewClassifier
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRootFactory
+from pyramid.interfaces import IRouteRequest
+from pyramid.interfaces import IRouter
+from pyramid.interfaces import IRequestFactory
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISettings
+from pyramid.interfaces import ITraverser
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+
+from pyramid.configuration import make_app # b/c import
+from pyramid.events import ContextFound
+from pyramid.events import NewRequest
+from pyramid.events import NewResponse
+from pyramid.exceptions import NotFound
+from pyramid.request import Request
+from pyramid.threadlocal import manager
+from pyramid.traversal import DefaultRootFactory
+from pyramid.traversal import ModelGraphTraverser
make_app # prevent pyflakes from complaining
diff --git a/pyramid/scripting.py b/pyramid/scripting.py
index ca0bea597..4ef6799a7 100644
--- a/pyramid/scripting.py
+++ b/pyramid/scripting.py
@@ -1,5 +1,5 @@
-from repoze.bfg.request import Request
-from repoze.bfg.interfaces import IRequestFactory
+from pyramid.request import Request
+from pyramid.interfaces import IRequestFactory
def get_root(app, request=None):
""" Return a tuple composed of ``(root, closer)`` when provided a
diff --git a/pyramid/security.py b/pyramid/security.py
index cd1bae9a5..8f896c7a0 100644
--- a/pyramid/security.py
+++ b/pyramid/security.py
@@ -2,13 +2,13 @@ from zope.interface import providedBy
from zope.deprecation import deprecated
-from repoze.bfg.interfaces import IAuthenticationPolicy
-from repoze.bfg.interfaces import IAuthorizationPolicy
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import IViewClassifier
+from pyramid.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthorizationPolicy
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import IViewClassifier
-from repoze.bfg.exceptions import Forbidden as Unauthorized # b/c import
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.exceptions import Forbidden as Unauthorized # b/c import
+from pyramid.threadlocal import get_current_registry
Unauthorized # prevent PyFlakes from complaining
diff --git a/pyramid/settings.py b/pyramid/settings.py
index 5e1181809..129bea36c 100644
--- a/pyramid/settings.py
+++ b/pyramid/settings.py
@@ -2,9 +2,9 @@ import os
from zope.interface import implements
-from repoze.bfg.interfaces import ISettings
+from pyramid.interfaces import ISettings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.threadlocal import get_current_registry
class Settings(dict):
""" Deployment settings. Update application settings (usually
diff --git a/pyramid/static.py b/pyramid/static.py
index 71db132b7..871f6f50c 100644
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -10,10 +10,10 @@ from paste.urlparser import StaticURLParser
from zope.interface import implements
-from repoze.bfg.interfaces import IStaticURLInfo
-from repoze.bfg.path import caller_package
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.url import route_url
+from pyramid.interfaces import IStaticURLInfo
+from pyramid.path import caller_package
+from pyramid.resource import resolve_resource_spec
+from pyramid.url import route_url
class PackageURLParser(StaticURLParser):
""" This probably won't work with zipimported resources """
diff --git a/pyramid/testing.py b/pyramid/testing.py
index c99ba8706..0e24cff7c 100644
--- a/pyramid/testing.py
+++ b/pyramid/testing.py
@@ -11,25 +11,25 @@ from zope.interface import implements
from zope.interface import Interface
from zope.interface import alsoProvides
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-from repoze.bfg.interfaces import IViewPermission
-
-from repoze.bfg.configuration import Configurator
-from repoze.bfg.exceptions import Forbidden
-from repoze.bfg.registry import Registry
-from repoze.bfg.security import Allowed
-from repoze.bfg.security import Authenticated
-from repoze.bfg.security import Denied
-from repoze.bfg.security import Everyone
-from repoze.bfg.security import has_permission
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.urldispatch import RoutesMapper
-from repoze.bfg.zcml import zcml_configure # API
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IViewPermission
+
+from pyramid.configuration import Configurator
+from pyramid.exceptions import Forbidden
+from pyramid.registry import Registry
+from pyramid.security import Allowed
+from pyramid.security import Authenticated
+from pyramid.security import Denied
+from pyramid.security import Everyone
+from pyramid.security import has_permission
+from pyramid.threadlocal import get_current_registry
+from pyramid.threadlocal import manager
+from pyramid.urldispatch import RoutesMapper
+from pyramid.zcml import zcml_configure # API
zcml_configure # prevent pyflakes from complaining
@@ -702,7 +702,7 @@ def setUp(registry=None, request=None, hook_zca=True):
# someone may be passing us an esoteric "dummy" registry, and
# the below won't succeed if it doesn't have a registerUtility
# method.
- from repoze.bfg.configuration import DEFAULT_RENDERERS
+ from pyramid.configuration import DEFAULT_RENDERERS
for name, renderer in DEFAULT_RENDERERS:
# Cause the default renderers to be registered because
# in-the-wild test code relies on being able to call
diff --git a/pyramid/tests/ccbugapp/configure.zcml b/pyramid/tests/ccbugapp/configure.zcml
index cb9ca6f1d..e95749d88 100644
--- a/pyramid/tests/ccbugapp/configure.zcml
+++ b/pyramid/tests/ccbugapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<route
view=".views.rdf_view"
diff --git a/pyramid/tests/exceptionviewapp/configure.zcml b/pyramid/tests/exceptionviewapp/configure.zcml
index 680e065a6..e3cb1568d 100644
--- a/pyramid/tests/exceptionviewapp/configure.zcml
+++ b/pyramid/tests/exceptionviewapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view view=".views.maybe"/>
diff --git a/pyramid/tests/fixtureapp/another.zcml b/pyramid/tests/fixtureapp/another.zcml
index f8678bad7..d3d5edecd 100644
--- a/pyramid/tests/fixtureapp/another.zcml
+++ b/pyramid/tests/fixtureapp/another.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view
view=".views.fixture_view"
diff --git a/pyramid/tests/fixtureapp/configure.zcml b/pyramid/tests/fixtureapp/configure.zcml
index e3470d47a..a19b577a1 100644
--- a/pyramid/tests/fixtureapp/configure.zcml
+++ b/pyramid/tests/fixtureapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view
view=".views.fixture_view"
diff --git a/pyramid/tests/fixtureapp/subpackage/yetanother.zcml b/pyramid/tests/fixtureapp/subpackage/yetanother.zcml
index 464163477..dd50ea465 100644
--- a/pyramid/tests/fixtureapp/subpackage/yetanother.zcml
+++ b/pyramid/tests/fixtureapp/subpackage/yetanother.zcml
@@ -1,8 +1,8 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
- <include package="repoze.bfg.tests.fixtureapp" file="another.zcml"/>
+ <include package="pyramid.tests.fixtureapp" file="another.zcml"/>
</configure>
diff --git a/pyramid/tests/fixtureapp/views.py b/pyramid/tests/fixtureapp/views.py
index 862046d43..9ab985e32 100644
--- a/pyramid/tests/fixtureapp/views.py
+++ b/pyramid/tests/fixtureapp/views.py
@@ -1,6 +1,6 @@
from zope.interface import Interface
from webob import Response
-from repoze.bfg.exceptions import Forbidden
+from pyramid.exceptions import Forbidden
def fixture_view(context, request):
""" """
diff --git a/pyramid/tests/grokkedapp/__init__.py b/pyramid/tests/grokkedapp/__init__.py
index 5d2843885..547987d8b 100644
--- a/pyramid/tests/grokkedapp/__init__.py
+++ b/pyramid/tests/grokkedapp/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view()
def grokked(context, request):
diff --git a/pyramid/tests/grokkedapp/another.py b/pyramid/tests/grokkedapp/another.py
index 7dda1d579..872eaf103 100644
--- a/pyramid/tests/grokkedapp/another.py
+++ b/pyramid/tests/grokkedapp/another.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='another')
def grokked(context, request):
diff --git a/pyramid/tests/grokkedapp/configure.zcml b/pyramid/tests/grokkedapp/configure.zcml
index 6867046df..34b81285d 100644
--- a/pyramid/tests/grokkedapp/configure.zcml
+++ b/pyramid/tests/grokkedapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<scan package="."/>
</configure>
diff --git a/pyramid/tests/grokkedapp/pod/notinit.py b/pyramid/tests/grokkedapp/pod/notinit.py
index ca0538123..9c033eaef 100644
--- a/pyramid/tests/grokkedapp/pod/notinit.py
+++ b/pyramid/tests/grokkedapp/pod/notinit.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='pod_notinit')
def subpackage_notinit(context, request):
diff --git a/pyramid/tests/grokkedapp/subpackage/__init__.py b/pyramid/tests/grokkedapp/subpackage/__init__.py
index bdbe54e13..7f93f0f16 100644
--- a/pyramid/tests/grokkedapp/subpackage/__init__.py
+++ b/pyramid/tests/grokkedapp/subpackage/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subpackage_init')
def subpackage_init(context, request):
diff --git a/pyramid/tests/grokkedapp/subpackage/notinit.py b/pyramid/tests/grokkedapp/subpackage/notinit.py
index 84de6503d..3f26180b3 100644
--- a/pyramid/tests/grokkedapp/subpackage/notinit.py
+++ b/pyramid/tests/grokkedapp/subpackage/notinit.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subpackage_notinit')
def subpackage_notinit(context, request):
diff --git a/pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py b/pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
index a83be850b..d380226ab 100644
--- a/pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
+++ b/pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subsubpackage_init')
def subpackage_init(context, request):
diff --git a/pyramid/tests/hybridapp/configure.zcml b/pyramid/tests/hybridapp/configure.zcml
index a94409e26..5073a2446 100644
--- a/pyramid/tests/hybridapp/configure.zcml
+++ b/pyramid/tests/hybridapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<!-- we want this view to "win" -->
<route
@@ -11,13 +11,13 @@
<!-- .. even though this one has a more specific context -->
<view
view=".views.global_view"
- context="repoze.bfg.traversal.DefaultRootFactory"
+ context="pyramid.traversal.DefaultRootFactory"
/>
<view
name="global2"
view=".views.global2_view"
- context="repoze.bfg.traversal.DefaultRootFactory"
+ context="pyramid.traversal.DefaultRootFactory"
/>
<route
diff --git a/pyramid/tests/restbugapp/configure.zcml b/pyramid/tests/restbugapp/configure.zcml
index 67954b892..19e9232ca 100644
--- a/pyramid/tests/restbugapp/configure.zcml
+++ b/pyramid/tests/restbugapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes"/>
+ <include package="pyramid.includes"/>
<route
path="/pet"
diff --git a/pyramid/tests/routesapp/configure.zcml b/pyramid/tests/routesapp/configure.zcml
index 01062b6d4..666d4024d 100644
--- a/pyramid/tests/routesapp/configure.zcml
+++ b/pyramid/tests/routesapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<route
path=":id"
diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py
index d020a11a6..3bd1587f3 100644
--- a/pyramid/tests/test_authentication.py
+++ b/pyramid/tests/test_authentication.py
@@ -2,7 +2,7 @@ import unittest
class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import RepozeWho1AuthenticationPolicy
+ from pyramid.authentication import RepozeWho1AuthenticationPolicy
return RepozeWho1AuthenticationPolicy
def _makeOne(self, identifier_name='auth_tkt', callback=None):
@@ -10,12 +10,12 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne())
def test_authenticated_userid_None(self):
@@ -46,14 +46,14 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals_userid_only(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred'}})
policy = self._makeOne()
@@ -61,8 +61,8 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
[Everyone, Authenticated, 'fred'])
def test_effective_principals_userid_and_groups(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred',
'groups':['quux', 'biz']}})
@@ -73,7 +73,7 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
[Everyone, Authenticated, 'fred', 'quux', 'biz'])
def test_effective_principals_userid_callback_returns_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred',
'groups':['quux', 'biz']}})
@@ -116,7 +116,7 @@ class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
class TestRemoteUserAuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import RemoteUserAuthenticationPolicy
+ from pyramid.authentication import RemoteUserAuthenticationPolicy
return RemoteUserAuthenticationPolicy
def _makeOne(self, environ_key='REMOTE_USER', callback=None):
@@ -124,12 +124,12 @@ class TestRemoteUserAuthenticationPolicy(unittest.TestCase):
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne())
def test_authenticated_userid_None(self):
@@ -143,14 +143,14 @@ class TestRemoteUserAuthenticationPolicy(unittest.TestCase):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest({'REMOTE_USER':'fred'})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request),
@@ -170,7 +170,7 @@ class TestRemoteUserAuthenticationPolicy(unittest.TestCase):
class TestAutkTktAuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import AuthTktAuthenticationPolicy
+ from pyramid.authentication import AuthTktAuthenticationPolicy
return AuthTktAuthenticationPolicy
def _makeOne(self, callback, cookieidentity, **kw):
@@ -188,12 +188,12 @@ class TestAutkTktAuthenticationPolicy(unittest.TestCase):
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne(None, None))
def test_authenticated_userid_no_cookie_identity(self):
@@ -216,13 +216,13 @@ class TestAutkTktAuthenticationPolicy(unittest.TestCase):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_no_cookie_identity(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne(None, None)
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals_callback_returns_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
def callback(userid, request):
return None
@@ -230,8 +230,8 @@ class TestAutkTktAuthenticationPolicy(unittest.TestCase):
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest({})
def callback(userid, request):
return ['group.foo']
@@ -260,7 +260,7 @@ class TestAutkTktAuthenticationPolicy(unittest.TestCase):
class TestAuthTktCookieHelper(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import AuthTktCookieHelper
+ from pyramid.authentication import AuthTktCookieHelper
return AuthTktCookieHelper
def _makeOne(self, *arg, **kw):
diff --git a/pyramid/tests/test_authorization.py b/pyramid/tests/test_authorization.py
index 6b8c8293a..e44eb86c5 100644
--- a/pyramid/tests/test_authorization.py
+++ b/pyramid/tests/test_authorization.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestACLAuthorizationPolicy(unittest.TestCase):
def setUp(self):
@@ -10,7 +10,7 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.authorization import ACLAuthorizationPolicy
+ from pyramid.authorization import ACLAuthorizationPolicy
return ACLAuthorizationPolicy
def _makeOne(self):
@@ -18,12 +18,12 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
def test_class_implements_IAuthorizationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
verifyClass(IAuthorizationPolicy, self._getTargetClass())
def test_instance_implements_IAuthorizationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
verifyObject(IAuthorizationPolicy, self._makeOne())
def test_permits_no_acl(self):
@@ -32,12 +32,12 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
self.assertEqual(policy.permits(context, [], 'view'), False)
def test_permits(self):
- from repoze.bfg.security import Deny
- from repoze.bfg.security import Allow
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
- from repoze.bfg.security import ALL_PERMISSIONS
- from repoze.bfg.security import DENY_ALL
+ from pyramid.security import Deny
+ from pyramid.security import Allow
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
+ from pyramid.security import ALL_PERMISSIONS
+ from pyramid.security import DENY_ALL
root = DummyContext()
community = DummyContext(__name__='community', __parent__=root)
blog = DummyContext(__name__='blog', __parent__=community)
@@ -120,8 +120,8 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
'<No ACL found on any object in model lineage>')
def test_principals_allowed_by_permission_direct(self):
- from repoze.bfg.security import Allow
- from repoze.bfg.security import DENY_ALL
+ from pyramid.security import Allow
+ from pyramid.security import DENY_ALL
context = DummyContext()
acl = [ (Allow, 'chrism', ('read', 'write')),
DENY_ALL,
@@ -133,10 +133,10 @@ class TestACLAuthorizationPolicy(unittest.TestCase):
self.assertEqual(result, ['chrism'])
def test_principals_allowed_by_permission(self):
- from repoze.bfg.security import Allow
- from repoze.bfg.security import Deny
- from repoze.bfg.security import DENY_ALL
- from repoze.bfg.security import ALL_PERMISSIONS
+ from pyramid.security import Allow
+ from pyramid.security import Deny
+ from pyramid.security import DENY_ALL
+ from pyramid.security import ALL_PERMISSIONS
root = DummyContext(__name__='', __parent__=None)
community = DummyContext(__name__='community', __parent__=root)
blog = DummyContext(__name__='blog', __parent__=community)
diff --git a/pyramid/tests/test_chameleon_text.py b/pyramid/tests/test_chameleon_text.py
index d9cefbd67..764124502 100644
--- a/pyramid/tests/test_chameleon_text.py
+++ b/pyramid/tests/test_chameleon_text.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class Base:
def setUp(self):
@@ -21,7 +21,7 @@ class Base:
return os.path.join(here, 'fixtures', name)
def _registerUtility(self, utility, iface, name=''):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
reg.registerUtility(utility, iface, name=name)
return reg
@@ -29,8 +29,8 @@ class Base:
class TextTemplateRendererTests(Base, unittest.TestCase):
def setUp(self):
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.registry import Registry
+ from pyramid.configuration import Configurator
+ from pyramid.registry import Registry
registry = Registry()
self.config = Configurator(registry=registry)
self.config.begin()
@@ -39,7 +39,7 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
self.config.end()
def _getTargetClass(self):
- from repoze.bfg.chameleon_text import TextTemplateRenderer
+ from pyramid.chameleon_text import TextTemplateRenderer
return TextTemplateRenderer
def _makeOne(self, *arg, **kw):
@@ -48,13 +48,13 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
def test_instance_implements_ITemplate(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
path = self._getTemplatePath('minimal.txt')
verifyObject(ITemplateRenderer, self._makeOne(path))
def test_class_implements_ITemplate(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
verifyClass(ITemplateRenderer, self._getTargetClass())
def test_template_reified(self):
@@ -65,7 +65,7 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
self.assertEqual(template, instance.__dict__['template'])
def test_template_with_ichameleon_translate(self):
- from repoze.bfg.interfaces import IChameleonTranslate
+ from pyramid.interfaces import IChameleonTranslate
def ct(): pass
self.config.registry.registerUtility(ct, IChameleonTranslate)
minimal = self._getTemplatePath('minimal.txt')
@@ -91,7 +91,7 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
self.assertEqual(template.auto_reload, True)
def test_template_with_emptydict(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
self.config.registry.registerUtility({}, ISettings)
minimal = self._getTemplatePath('minimal.txt')
instance = self._makeOne(minimal)
@@ -128,7 +128,7 @@ class TextTemplateRendererTests(Base, unittest.TestCase):
class RenderTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_text import render_template
+ from pyramid.chameleon_text import render_template
return render_template(name, **kw)
def test_it(self):
@@ -139,7 +139,7 @@ class RenderTemplateTests(Base, unittest.TestCase):
class RenderTemplateToResponseTests(Base, unittest.TestCase):
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_text import render_template_to_response
+ from pyramid.chameleon_text import render_template_to_response
return render_template_to_response(name, **kw)
def test_minimal(self):
@@ -155,7 +155,7 @@ class RenderTemplateToResponseTests(Base, unittest.TestCase):
from webob import Response
class Response2(Response):
pass
- from repoze.bfg.interfaces import IResponseFactory
+ from pyramid.interfaces import IResponseFactory
self._registerUtility(Response2, IResponseFactory)
minimal = self._getTemplatePath('minimal.txt')
result = self._callFUT(minimal)
@@ -163,11 +163,11 @@ class RenderTemplateToResponseTests(Base, unittest.TestCase):
class GetRendererTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_text import get_renderer
+ from pyramid.chameleon_text import get_renderer
return get_renderer(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self): pass
@@ -180,11 +180,11 @@ class GetRendererTests(Base, unittest.TestCase):
class GetTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_text import get_template
+ from pyramid.chameleon_text import get_template
return get_template(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self):
diff --git a/pyramid/tests/test_chameleon_zpt.py b/pyramid/tests/test_chameleon_zpt.py
index a0f01701a..a969bac00 100644
--- a/pyramid/tests/test_chameleon_zpt.py
+++ b/pyramid/tests/test_chameleon_zpt.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class Base(object):
def setUp(self):
@@ -15,15 +15,15 @@ class Base(object):
return os.path.join(here, 'fixtures', name)
def _registerUtility(self, utility, iface, name=''):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
reg.registerUtility(utility, iface, name=name)
return reg
class ZPTTemplateRendererTests(Base, unittest.TestCase):
def setUp(self):
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.registry import Registry
+ from pyramid.configuration import Configurator
+ from pyramid.registry import Registry
registry = Registry()
self.config = Configurator(registry=registry)
self.config.begin()
@@ -32,7 +32,7 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
self.config.end()
def _getTargetClass(self):
- from repoze.bfg.chameleon_zpt import ZPTTemplateRenderer
+ from pyramid.chameleon_zpt import ZPTTemplateRenderer
return ZPTTemplateRenderer
def _makeOne(self, *arg, **kw):
@@ -41,13 +41,13 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
def test_instance_implements_ITemplate(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
path = self._getTemplatePath('minimal.pt')
verifyObject(ITemplateRenderer, self._makeOne(path))
def test_class_implements_ITemplate(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
verifyClass(ITemplateRenderer, self._getTargetClass())
def test_call(self):
@@ -66,7 +66,7 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
self.assertEqual(template, instance.__dict__['template'])
def test_template_with_ichameleon_translate(self):
- from repoze.bfg.interfaces import IChameleonTranslate
+ from pyramid.interfaces import IChameleonTranslate
def ct(): pass
self.config.registry.registerUtility(ct, IChameleonTranslate)
minimal = self._getTemplatePath('minimal.pt')
@@ -92,7 +92,7 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
self.assertEqual(template.auto_reload, True)
def test_template_with_emptydict(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
self.config.registry.registerUtility({}, ISettings)
minimal = self._getTemplatePath('minimal.pt')
instance = self._makeOne(minimal)
@@ -117,7 +117,7 @@ class ZPTTemplateRendererTests(Base, unittest.TestCase):
class RenderTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_zpt import render_template
+ from pyramid.chameleon_zpt import render_template
return render_template(name, **kw)
def test_it(self):
@@ -135,7 +135,7 @@ class RenderTemplateToResponseTests(Base, unittest.TestCase):
cleanUp()
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_zpt import render_template_to_response
+ from pyramid.chameleon_zpt import render_template_to_response
return render_template_to_response(name, **kw)
def test_it(self):
@@ -152,7 +152,7 @@ class RenderTemplateToResponseTests(Base, unittest.TestCase):
from webob import Response
class Response2(Response):
pass
- from repoze.bfg.interfaces import IResponseFactory
+ from pyramid.interfaces import IResponseFactory
self._registerUtility(Response2, IResponseFactory)
minimal = self._getTemplatePath('minimal.pt')
result = self._callFUT(minimal)
@@ -160,11 +160,11 @@ class RenderTemplateToResponseTests(Base, unittest.TestCase):
class GetRendererTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_zpt import get_renderer
+ from pyramid.chameleon_zpt import get_renderer
return get_renderer(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self): pass
@@ -177,11 +177,11 @@ class GetRendererTests(Base, unittest.TestCase):
class GetTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_zpt import get_template
+ from pyramid.chameleon_zpt import get_template
return get_template(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self):
diff --git a/pyramid/tests/test_compat.py b/pyramid/tests/test_compat.py
index 66ea61860..16fc28826 100644
--- a/pyramid/tests/test_compat.py
+++ b/pyramid/tests/test_compat.py
@@ -2,7 +2,7 @@ import unittest
class TestAliases(unittest.TestCase):
def test_all(self):
- from repoze.bfg.compat import all
+ from pyramid.compat import all
self.assertEqual(all([True, True]), True)
self.assertEqual(all([False, False]), False)
self.assertEqual(all([False, True]), False)
diff --git a/pyramid/tests/test_configuration.py b/pyramid/tests/test_configuration.py
index 47649d6ba..7b121f930 100644
--- a/pyramid/tests/test_configuration.py
+++ b/pyramid/tests/test_configuration.py
@@ -1,15 +1,15 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class ConfiguratorTests(unittest.TestCase):
def _makeOne(self, *arg, **kw):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
return Configurator(*arg, **kw)
def _registerRenderer(self, config, name='.txt'):
- from repoze.bfg.interfaces import IRendererFactory
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import IRendererFactory
+ from pyramid.interfaces import ITemplateRenderer
from zope.interface import implements
class Renderer:
implements(ITemplateRenderer)
@@ -23,10 +23,10 @@ class ConfiguratorTests(unittest.TestCase):
def _getViewCallable(self, config, ctx_iface=None, request_iface=None,
name='', exception_view=False):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
if exception_view:
classifier = IExceptionViewClassifier
else:
@@ -40,12 +40,12 @@ class ConfiguratorTests(unittest.TestCase):
default=None)
def _getRouteRequestIface(self, config, name):
- from repoze.bfg.interfaces import IRouteRequest
+ from pyramid.interfaces import IRouteRequest
iface = config.registry.getUtility(IRouteRequest, name)
return iface
def _assertNotFound(self, wrapper, *arg):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
self.assertRaises(NotFound, wrapper, *arg)
def _registerEventListener(self, config, event_iface=None):
@@ -59,7 +59,7 @@ class ConfiguratorTests(unittest.TestCase):
return L
def _registerLogger(self, config):
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.interfaces import IDebugLogger
logger = DummyLogger()
config.registry.registerUtility(logger, IDebugLogger)
return logger
@@ -70,23 +70,23 @@ class ConfiguratorTests(unittest.TestCase):
return request
def _registerSecurityPolicy(self, config, permissive):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
policy = DummySecurityPolicy(permissive)
config.registry.registerUtility(policy, IAuthenticationPolicy)
config.registry.registerUtility(policy, IAuthorizationPolicy)
def _registerSettings(self, config, **settings):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
config.registry.registerUtility(settings, ISettings)
def test_ctor_no_registry(self):
import sys
- from repoze.bfg.interfaces import ISettings
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import ISettings
+ from pyramid.configuration import Configurator
+ from pyramid.interfaces import IRendererFactory
config = Configurator()
- this_pkg = sys.modules['repoze.bfg.tests']
+ this_pkg = sys.modules['pyramid.tests']
self.failUnless(config.registry.getUtility(ISettings))
self.assertEqual(config.package, this_pkg)
self.failUnless(config.registry.getUtility(IRendererFactory, 'json'))
@@ -95,7 +95,7 @@ class ConfiguratorTests(unittest.TestCase):
self.failUnless(config.registry.getUtility(IRendererFactory, '.txt'))
def test_begin(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
config = Configurator()
manager = DummyThreadLocalManager()
config.manager = manager
@@ -105,7 +105,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(manager.popped, False)
def test_begin_with_request(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
config = Configurator()
request = object()
manager = DummyThreadLocalManager()
@@ -116,7 +116,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(manager.popped, False)
def test_end(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
config = Configurator()
manager = DummyThreadLocalManager()
config.manager = manager
@@ -126,13 +126,13 @@ class ConfiguratorTests(unittest.TestCase):
def test_ctor_with_package_registry(self):
import sys
- from repoze.bfg.configuration import Configurator
- bfg_pkg = sys.modules['repoze.bfg']
+ from pyramid.configuration import Configurator
+ bfg_pkg = sys.modules['pyramid']
config = Configurator(package=bfg_pkg)
self.assertEqual(config.package, bfg_pkg)
def test_ctor_noreg_custom_settings(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
settings = {'reload_templates':True,
'mysetting':True}
config = self._makeOne(settings=settings)
@@ -142,96 +142,96 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(settings['mysetting'], True)
def test_ctor_noreg_debug_logger_None_default(self):
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.interfaces import IDebugLogger
config = self._makeOne()
logger = config.registry.getUtility(IDebugLogger)
self.assertEqual(logger.name, 'repoze.bfg.debug')
def test_ctor_noreg_debug_logger_non_None(self):
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.interfaces import IDebugLogger
logger = object()
config = self._makeOne(debug_logger=logger)
result = config.registry.getUtility(IDebugLogger)
self.assertEqual(logger, result)
def test_ctor_authentication_policy(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
policy = object()
config = self._makeOne(authentication_policy=policy)
result = config.registry.getUtility(IAuthenticationPolicy)
self.assertEqual(policy, result)
def test_ctor_authorization_policy_only(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
policy = object()
self.assertRaises(ConfigurationError,
self._makeOne, authorization_policy=policy)
def test_ctor_no_root_factory(self):
- from repoze.bfg.interfaces import IRootFactory
+ from pyramid.interfaces import IRootFactory
config = self._makeOne()
self.failUnless(config.registry.getUtility(IRootFactory))
def test_ctor_alternate_renderers(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
renderer = object()
config = self._makeOne(renderers=[('yeah', renderer)])
self.assertEqual(config.registry.getUtility(IRendererFactory, 'yeah'),
renderer)
def test_ctor_default_permission(self):
- from repoze.bfg.interfaces import IDefaultPermission
+ from pyramid.interfaces import IDefaultPermission
config = self._makeOne(default_permission='view')
self.assertEqual(config.registry.getUtility(IDefaultPermission), 'view')
def test_with_package_module(self):
- from repoze.bfg.tests import test_configuration
- import repoze.bfg.tests
+ from pyramid.tests import test_configuration
+ import pyramid.tests
config = self._makeOne()
newconfig = config.with_package(test_configuration)
- self.assertEqual(newconfig.package, repoze.bfg.tests)
+ self.assertEqual(newconfig.package, pyramid.tests)
def test_with_package_package(self):
- import repoze.bfg.tests
+ import pyramid.tests
config = self._makeOne()
- newconfig = config.with_package(repoze.bfg.tests)
- self.assertEqual(newconfig.package, repoze.bfg.tests)
+ newconfig = config.with_package(pyramid.tests)
+ self.assertEqual(newconfig.package, pyramid.tests)
def test_maybe_dotted_string_success(self):
- import repoze.bfg.tests
+ import pyramid.tests
config = self._makeOne()
- result = config.maybe_dotted('repoze.bfg.tests')
- self.assertEqual(result, repoze.bfg.tests)
+ result = config.maybe_dotted('pyramid.tests')
+ self.assertEqual(result, pyramid.tests)
def test_maybe_dotted_string_fail(self):
- from repoze.bfg.configuration import ConfigurationError
+ from pyramid.configuration import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError,
config.maybe_dotted, 'cant.be.found')
def test_maybe_dotted_notstring_success(self):
- import repoze.bfg.tests
+ import pyramid.tests
config = self._makeOne()
- result = config.maybe_dotted(repoze.bfg.tests)
- self.assertEqual(result, repoze.bfg.tests)
+ result = config.maybe_dotted(pyramid.tests)
+ self.assertEqual(result, pyramid.tests)
def test_absolute_resource_spec_already_absolute(self):
- import repoze.bfg.tests
- config = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ config = self._makeOne(package=pyramid.tests)
result = config.absolute_resource_spec('already:absolute')
self.assertEqual(result, 'already:absolute')
def test_absolute_resource_spec_notastring(self):
- import repoze.bfg.tests
- config = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ config = self._makeOne(package=pyramid.tests)
result = config.absolute_resource_spec(None)
self.assertEqual(result, None)
def test_absolute_resource_spec_relative(self):
- import repoze.bfg.tests
- config = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ config = self._makeOne(package=pyramid.tests)
result = config.absolute_resource_spec('templates')
- self.assertEqual(result, 'repoze.bfg.tests:templates')
+ self.assertEqual(result, 'pyramid.tests:templates')
def test_setup_registry_fixed(self):
class DummyRegistry(object):
@@ -249,8 +249,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(reg.events, (1,))
def test_setup_registry_registers_default_exceptionresponse_view(self):
- from repoze.bfg.interfaces import IExceptionResponse
- from repoze.bfg.view import default_exceptionresponse_view
+ from pyramid.interfaces import IExceptionResponse
+ from pyramid.view import default_exceptionresponse_view
class DummyRegistry(object):
def registerUtility(self, *arg, **kw):
pass
@@ -264,9 +264,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_setup_registry_explicit_notfound_trumps_iexceptionresponse(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.exceptions import NotFound
- from repoze.bfg.registry import Registry
+ from pyramid.interfaces import IRequest
+ from pyramid.exceptions import NotFound
+ from pyramid.registry import Registry
reg = Registry()
config = self._makeOne(reg)
config.setup_registry() # registers IExceptionResponse default view
@@ -280,8 +280,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(result, 'OK')
def test_setup_registry_custom_settings(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import ISettings
+ from pyramid.registry import Registry
+ from pyramid.interfaces import ISettings
settings = {'reload_templates':True,
'mysetting':True}
reg = Registry()
@@ -293,8 +293,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(settings['mysetting'], True)
def test_setup_registry_debug_logger_None_default(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IDebugLogger
reg = Registry()
config = self._makeOne(reg)
config.setup_registry()
@@ -302,8 +302,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(logger.name, 'repoze.bfg.debug')
def test_setup_registry_debug_logger_non_None(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IDebugLogger
logger = object()
reg = Registry()
config = self._makeOne(reg)
@@ -312,18 +312,18 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(logger, result)
def test_setup_registry_debug_logger_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IDebugLogger
reg = Registry()
config = self._makeOne(reg)
- config.setup_registry(debug_logger='repoze.bfg.tests')
+ config.setup_registry(debug_logger='pyramid.tests')
result = reg.getUtility(IDebugLogger)
- import repoze.bfg.tests
- self.assertEqual(result, repoze.bfg.tests)
+ import pyramid.tests
+ self.assertEqual(result, pyramid.tests)
def test_setup_registry_authentication_policy(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IAuthenticationPolicy
policy = object()
reg = Registry()
config = self._makeOne(reg)
@@ -332,30 +332,30 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(policy, result)
def test_setup_registry_authentication_policy_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IAuthenticationPolicy
reg = Registry()
config = self._makeOne(reg)
- config.setup_registry(authentication_policy='repoze.bfg.tests')
+ config.setup_registry(authentication_policy='pyramid.tests')
result = reg.getUtility(IAuthenticationPolicy)
- import repoze.bfg.tests
- self.assertEqual(result, repoze.bfg.tests)
+ import pyramid.tests
+ self.assertEqual(result, pyramid.tests)
def test_setup_registry_authorization_policy_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IAuthorizationPolicy
reg = Registry()
config = self._makeOne(reg)
dummy = object()
config.setup_registry(authentication_policy=dummy,
- authorization_policy='repoze.bfg.tests')
+ authorization_policy='pyramid.tests')
result = reg.getUtility(IAuthorizationPolicy)
- import repoze.bfg.tests
- self.assertEqual(result, repoze.bfg.tests)
+ import pyramid.tests
+ self.assertEqual(result, pyramid.tests)
def test_setup_registry_authorization_policy_only(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.registry import Registry
+ from pyramid.exceptions import ConfigurationError
policy = object()
reg = Registry()
config = self._makeOne(reg)
@@ -364,35 +364,35 @@ class ConfiguratorTests(unittest.TestCase):
authorization_policy=policy)
def test_setup_registry_default_root_factory(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRootFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRootFactory
reg = Registry()
config = self._makeOne(reg)
config.setup_registry()
self.failUnless(reg.getUtility(IRootFactory))
def test_setup_registry_dottedname_root_factory(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRootFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRootFactory
reg = Registry()
config = self._makeOne(reg)
- import repoze.bfg.tests
- config.setup_registry(root_factory='repoze.bfg.tests')
- self.assertEqual(reg.getUtility(IRootFactory), repoze.bfg.tests)
+ import pyramid.tests
+ config.setup_registry(root_factory='pyramid.tests')
+ self.assertEqual(reg.getUtility(IRootFactory), pyramid.tests)
def test_setup_registry_locale_negotiator_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.registry import Registry
+ from pyramid.interfaces import ILocaleNegotiator
reg = Registry()
config = self._makeOne(reg)
- import repoze.bfg.tests
- config.setup_registry(locale_negotiator='repoze.bfg.tests')
+ import pyramid.tests
+ config.setup_registry(locale_negotiator='pyramid.tests')
utility = reg.getUtility(ILocaleNegotiator)
- self.assertEqual(utility, repoze.bfg.tests)
+ self.assertEqual(utility, pyramid.tests)
def test_setup_registry_locale_negotiator(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.registry import Registry
+ from pyramid.interfaces import ILocaleNegotiator
reg = Registry()
config = self._makeOne(reg)
negotiator = object()
@@ -401,8 +401,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(utility, negotiator)
def test_setup_registry_request_factory(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRequestFactory
reg = Registry()
config = self._makeOne(reg)
factory = object()
@@ -411,18 +411,18 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(utility, factory)
def test_setup_registry_request_factory_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRequestFactory
reg = Registry()
config = self._makeOne(reg)
- import repoze.bfg.tests
- config.setup_registry(request_factory='repoze.bfg.tests')
+ import pyramid.tests
+ config.setup_registry(request_factory='pyramid.tests')
utility = reg.getUtility(IRequestFactory)
- self.assertEqual(utility, repoze.bfg.tests)
+ self.assertEqual(utility, pyramid.tests)
def test_setup_registry_renderer_globals_factory(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRendererGlobalsFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRendererGlobalsFactory
reg = Registry()
config = self._makeOne(reg)
factory = object()
@@ -431,18 +431,18 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(utility, factory)
def test_setup_registry_renderer_globals_factory_dottedname(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRendererGlobalsFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRendererGlobalsFactory
reg = Registry()
config = self._makeOne(reg)
- import repoze.bfg.tests
- config.setup_registry(renderer_globals_factory='repoze.bfg.tests')
+ import pyramid.tests
+ config.setup_registry(renderer_globals_factory='pyramid.tests')
utility = reg.getUtility(IRendererGlobalsFactory)
- self.assertEqual(utility, repoze.bfg.tests)
+ self.assertEqual(utility, pyramid.tests)
def test_setup_registry_alternate_renderers(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IRendererFactory
renderer = object()
reg = Registry()
config = self._makeOne(reg)
@@ -451,29 +451,29 @@ class ConfiguratorTests(unittest.TestCase):
renderer)
def test_setup_registry_default_permission(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import IDefaultPermission
+ from pyramid.registry import Registry
+ from pyramid.interfaces import IDefaultPermission
reg = Registry()
config = self._makeOne(reg)
config.setup_registry(default_permission='view')
self.assertEqual(reg.getUtility(IDefaultPermission), 'view')
def test_get_settings_nosettings(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
reg = Registry()
config = self._makeOne(reg)
self.assertEqual(config.get_settings(), None)
def test_get_settings_withsettings(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
settings = {'a':1}
config = self._makeOne()
config.registry.registerUtility(settings, ISettings)
self.assertEqual(config.get_settings(), settings)
def test_add_settings_settings_already_registered(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import ISettings
+ from pyramid.registry import Registry
+ from pyramid.interfaces import ISettings
reg = Registry()
config = self._makeOne(reg)
config._set_settings({'a':1})
@@ -483,8 +483,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(settings['b'], 2)
def test_add_settings_settings_not_yet_registered(self):
- from repoze.bfg.registry import Registry
- from repoze.bfg.interfaces import ISettings
+ from pyramid.registry import Registry
+ from pyramid.interfaces import ISettings
reg = Registry()
config = self._makeOne(reg)
config.add_settings({'a':1})
@@ -530,15 +530,15 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(len(L), 1)
def test_add_subscriber_dottednames(self):
- import repoze.bfg.tests
- from repoze.bfg.interfaces import INewRequest
+ import pyramid.tests
+ from pyramid.interfaces import INewRequest
config = self._makeOne()
- config.add_subscriber('repoze.bfg.tests',
- 'repoze.bfg.interfaces.INewRequest')
+ config.add_subscriber('pyramid.tests',
+ 'pyramid.interfaces.INewRequest')
handlers = list(config.registry.registeredHandlers())
self.assertEqual(len(handlers), 1)
handler = handlers[0]
- self.assertEqual(handler.handler, repoze.bfg.tests)
+ self.assertEqual(handler.handler, pyramid.tests)
self.assertEqual(handler.required, (INewRequest,))
def test_add_object_event_subscriber(self):
@@ -562,8 +562,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(len(L), 1)
def test_make_wsgi_app(self):
- from repoze.bfg.router import Router
- from repoze.bfg.interfaces import IApplicationCreated
+ from pyramid.router import Router
+ from pyramid.interfaces import IApplicationCreated
manager = DummyThreadLocalManager()
config = self._makeOne()
subscriber = self._registerEventListener(config, IApplicationCreated)
@@ -577,57 +577,57 @@ class ConfiguratorTests(unittest.TestCase):
self.failUnless(IApplicationCreated.providedBy(subscriber[0]))
def test_load_zcml_default(self):
- import repoze.bfg.tests.fixtureapp
- config = self._makeOne(package=repoze.bfg.tests.fixtureapp)
+ import pyramid.tests.fixtureapp
+ config = self._makeOne(package=pyramid.tests.fixtureapp)
registry = config.load_zcml()
- from repoze.bfg.tests.fixtureapp.models import IFixture
+ from pyramid.tests.fixtureapp.models import IFixture
self.failUnless(registry.queryUtility(IFixture)) # only in c.zcml
def test_load_zcml_routesapp(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
config = self._makeOne()
- config.load_zcml('repoze.bfg.tests.routesapp:configure.zcml')
+ config.load_zcml('pyramid.tests.routesapp:configure.zcml')
self.failUnless(config.registry.getUtility(IRoutesMapper))
def test_load_zcml_fixtureapp(self):
- from repoze.bfg.tests.fixtureapp.models import IFixture
+ from pyramid.tests.fixtureapp.models import IFixture
config = self._makeOne()
- config.load_zcml('repoze.bfg.tests.fixtureapp:configure.zcml')
+ config.load_zcml('pyramid.tests.fixtureapp:configure.zcml')
self.failUnless(config.registry.queryUtility(IFixture)) # only in c.zcml
def test_load_zcml_as_relative_filename(self):
- import repoze.bfg.tests.fixtureapp
- config = self._makeOne(package=repoze.bfg.tests.fixtureapp)
+ import pyramid.tests.fixtureapp
+ config = self._makeOne(package=pyramid.tests.fixtureapp)
registry = config.load_zcml('configure.zcml')
- from repoze.bfg.tests.fixtureapp.models import IFixture
+ from pyramid.tests.fixtureapp.models import IFixture
self.failUnless(registry.queryUtility(IFixture)) # only in c.zcml
def test_load_zcml_as_absolute_filename(self):
import os
- import repoze.bfg.tests.fixtureapp
- config = self._makeOne(package=repoze.bfg.tests.fixtureapp)
- dn = os.path.dirname(repoze.bfg.tests.fixtureapp.__file__)
+ import pyramid.tests.fixtureapp
+ config = self._makeOne(package=pyramid.tests.fixtureapp)
+ dn = os.path.dirname(pyramid.tests.fixtureapp.__file__)
c_z = os.path.join(dn, 'configure.zcml')
registry = config.load_zcml(c_z)
- from repoze.bfg.tests.fixtureapp.models import IFixture
+ from pyramid.tests.fixtureapp.models import IFixture
self.failUnless(registry.queryUtility(IFixture)) # only in c.zcml
def test_load_zcml_lock_and_unlock(self):
config = self._makeOne()
dummylock = DummyLock()
config.load_zcml(
- 'repoze.bfg.tests.fixtureapp:configure.zcml',
+ 'pyramid.tests.fixtureapp:configure.zcml',
lock=dummylock)
self.assertEqual(dummylock.acquired, True)
self.assertEqual(dummylock.released, True)
def test_add_view_view_callable_None_no_renderer(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError, config.add_view)
def test_add_view_with_request_type_and_route_name(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
view = lambda *arg: 'OK'
self.assertRaises(ConfigurationError, config.add_view, view, '', None,
@@ -648,11 +648,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_with_request_type(self):
from zope.interface import directlyProvides
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
view = lambda *arg: 'OK'
config = self._makeOne()
config.add_view(view=view,
- request_type='repoze.bfg.interfaces.IRequest')
+ request_type='pyramid.interfaces.IRequest')
wrapper = self._getViewCallable(config)
request = DummyRequest()
self._assertNotFound(wrapper, None, request)
@@ -679,7 +679,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_view_callable_dottedname(self):
config = self._makeOne()
- config.add_view(view='repoze.bfg.tests.test_configuration.dummy_view')
+ config.add_view(view='pyramid.tests.test_configuration.dummy_view')
wrapper = self._getViewCallable(config)
self.assertEqual(wrapper(None, None), 'OK')
@@ -772,7 +772,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_context_as_dottedname(self):
view = lambda *arg: 'OK'
config = self._makeOne()
- config.add_view(context='repoze.bfg.tests.test_configuration.IDummy',
+ config.add_view(context='pyramid.tests.test_configuration.IDummy',
view=view)
wrapper = self._getViewCallable(config, IDummy)
self.assertEqual(wrapper, view)
@@ -780,7 +780,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_for__as_dottedname(self):
view = lambda *arg: 'OK'
config = self._makeOne()
- config.add_view(for_='repoze.bfg.tests.test_configuration.IDummy',
+ config.add_view(for_='pyramid.tests.test_configuration.IDummy',
view=view)
wrapper = self._getViewCallable(config, IDummy)
self.assertEqual(wrapper, view)
@@ -817,9 +817,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_register_secured_view(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import ISecuredView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import ISecuredView
+ from pyramid.interfaces import IViewClassifier
view = lambda *arg: 'OK'
view.__call_permissive__ = view
config = self._makeOne()
@@ -831,9 +831,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exception_register_secured_view(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IExceptionViewClassifier
view = lambda *arg: 'OK'
view.__call_permissive__ = view
config = self._makeOne()
@@ -844,12 +844,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapper, view)
def test_add_view_same_phash_overrides_existing_single_view(self):
- from repoze.bfg.compat import md5
+ from pyramid.compat import md5
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IMultiView
phash = md5()
phash.update('xhr:True')
view = lambda *arg: 'NOT OK'
@@ -867,12 +867,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapper(None, request), 'OK')
def test_add_view_exc_same_phash_overrides_existing_single_view(self):
- from repoze.bfg.compat import md5
+ from pyramid.compat import md5
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IMultiView
phash = md5()
phash.update('xhr:True')
view = lambda *arg: 'NOT OK'
@@ -895,10 +895,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_default_phash_overrides_no_phash(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'NOT OK'
config = self._makeOne()
config.registry.registerAdapter(
@@ -914,10 +914,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_default_phash_overrides_no_phash(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'NOT OK'
config = self._makeOne()
config.registry.registerAdapter(
@@ -935,12 +935,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapper(None, request), 'OK')
def test_add_view_default_phash_overrides_default_phash(self):
- from repoze.bfg.configuration import DEFAULT_PHASH
+ from pyramid.configuration import DEFAULT_PHASH
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'NOT OK'
view.__phash__ = DEFAULT_PHASH
config = self._makeOne()
@@ -956,12 +956,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapper(None, request), 'OK')
def test_add_view_exc_default_phash_overrides_default_phash(self):
- from repoze.bfg.configuration import DEFAULT_PHASH
+ from pyramid.configuration import DEFAULT_PHASH
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'NOT OK'
view.__phash__ = DEFAULT_PHASH
config = self._makeOne()
@@ -981,10 +981,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_replaces_existing_view(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'OK'
view.__phash__ = 'abc'
config = self._makeOne()
@@ -997,11 +997,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_multiview_replaces_existing_view(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IMultiView
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IMultiView
view = lambda *arg: 'OK'
view.__phash__ = 'abc'
config = self._makeOne()
@@ -1021,10 +1021,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_replaces_existing_securedview(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import ISecuredView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import ISecuredView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
view = lambda *arg: 'OK'
view.__phash__ = 'abc'
config = self._makeOne()
@@ -1038,11 +1038,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_multiview_replaces_existing_securedview(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import ISecuredView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import ISecuredView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
view = lambda *arg: 'OK'
view.__phash__ = 'abc'
config = self._makeOne()
@@ -1062,10 +1062,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_with_accept_multiview_replaces_existing_view(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
def view(context, request):
return 'OK'
def view2(context, request):
@@ -1085,11 +1085,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_with_accept_multiview_replaces_existing_view(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
def view(context, request):
return 'OK'
def view2(context, request):
@@ -1116,10 +1116,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_replaces_existing_view_with___accept__(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
def view(context, request):
return 'OK'
def view2(context, request):
@@ -1141,11 +1141,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_mulview_replaces_existing_view_with___accept__(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
def view(context, request):
return 'OK'
def view2(context, request):
@@ -1174,9 +1174,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_replaces_multiview(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
view = DummyMultiView()
config = self._makeOne()
config.registry.registerAdapter(
@@ -1191,10 +1191,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_exc_multiview_replaces_multiview(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
view = DummyMultiView()
config = self._makeOne()
config.registry.registerAdapter(
@@ -1215,10 +1215,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_context_superclass_then_subclass(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
class ISuper(Interface):
pass
class ISub(ISuper):
@@ -1238,11 +1238,11 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_view_multiview_exception_superclass_then_subclass(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IMultiView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IMultiView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
class Super(Exception):
pass
class Sub(Super):
@@ -1355,24 +1355,24 @@ class ConfiguratorTests(unittest.TestCase):
return {'a':'1'}
config = self._makeOne()
renderer = self._registerRenderer(config)
- fixture = 'repoze.bfg.tests:fixtures/minimal.txt'
+ fixture = 'pyramid.tests:fixtures/minimal.txt'
config.add_view(view=view, renderer=fixture)
wrapper = self._getViewCallable(config)
request = self._makeRequest(config)
result = wrapper(None, request)
self.assertEqual(result.body, 'Hello!')
- self.assertEqual(renderer.path, 'repoze.bfg.tests:fixtures/minimal.txt')
+ self.assertEqual(renderer.path, 'pyramid.tests:fixtures/minimal.txt')
def test_add_view_with_template_renderer_no_callable(self):
config = self._makeOne()
renderer = self._registerRenderer(config)
- fixture = 'repoze.bfg.tests:fixtures/minimal.txt'
+ fixture = 'pyramid.tests:fixtures/minimal.txt'
config.add_view(view=None, renderer=fixture)
wrapper = self._getViewCallable(config)
request = self._makeRequest(config)
result = wrapper(None, request)
self.assertEqual(result.body, 'Hello!')
- self.assertEqual(renderer.path, 'repoze.bfg.tests:fixtures/minimal.txt')
+ self.assertEqual(renderer.path, 'pyramid.tests:fixtures/minimal.txt')
def test_add_view_with_request_type_as_iface(self):
from zope.interface import directlyProvides
@@ -1387,7 +1387,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(result, 'OK')
def test_add_view_with_request_type_as_noniface(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
view = lambda *arg: 'OK'
config = self._makeOne()
self.assertRaises(ConfigurationError,
@@ -1530,7 +1530,7 @@ class ConfiguratorTests(unittest.TestCase):
self._assertNotFound(wrapper, None, request)
def test_add_view_with_header_badregex(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
view = lambda *arg: 'OK'
config = self._makeOne()
self.assertRaises(ConfigurationError,
@@ -1573,7 +1573,7 @@ class ConfiguratorTests(unittest.TestCase):
self._assertNotFound(wrapper, None, request)
def test_add_view_with_header_val_missing(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
view = lambda *arg: 'OK'
config = self._makeOne()
config.add_view(view=view, header=r'Host:\d')
@@ -1624,14 +1624,14 @@ class ConfiguratorTests(unittest.TestCase):
config = self._makeOne()
config.add_view(
view=view,
- containment='repoze.bfg.tests.test_configuration.IDummy')
+ containment='pyramid.tests.test_configuration.IDummy')
wrapper = self._getViewCallable(config)
context = DummyContext()
directlyProvides(context, IDummy)
self.assertEqual(wrapper(context, None), 'OK')
def test_add_view_with_path_info_badregex(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
view = lambda *arg: 'OK'
config = self._makeOne()
self.assertRaises(ConfigurationError,
@@ -1769,7 +1769,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(view(None, request), 'OK')
def _assertRoute(self, config, name, path, num_predicates=0):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
mapper = config.registry.getUtility(IRoutesMapper)
routes = mapper.get_routes()
route = routes[0]
@@ -1785,7 +1785,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(mapper.routelist, [])
def test_get_routes_mapper_already_registered(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
config = self._makeOne()
mapper = object()
config.registry.registerUtility(mapper, IRoutesMapper)
@@ -1808,7 +1808,7 @@ class ConfiguratorTests(unittest.TestCase):
config = self._makeOne()
route = config.add_route(
'name', 'path',
- factory='repoze.bfg.tests.test_configuration.dummyfactory')
+ factory='pyramid.tests.test_configuration.dummyfactory')
self.assertEqual(route.factory, dummyfactory)
def test_add_route_with_xhr(self):
@@ -1986,8 +1986,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapper(None, None).body, 'Hello!')
def test_add_route_with_view_permission(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
config = self._makeOne()
policy = lambda *arg: None
config.registry.registerUtility(policy, IAuthenticationPolicy)
@@ -2000,8 +2000,8 @@ class ConfiguratorTests(unittest.TestCase):
self.failUnless(hasattr(wrapper, '__call_permissive__'))
def test_add_route_with_view_permission_alias(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
config = self._makeOne()
policy = lambda *arg: None
config.registry.registerUtility(policy, IAuthenticationPolicy)
@@ -2020,7 +2020,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(route.name, 'name')
def test_add_route_no_path_no_pattern(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError, config.add_route, 'name')
@@ -2030,7 +2030,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(route.pregenerator, '123')
def test__override_not_yet_registered(self):
- from repoze.bfg.interfaces import IPackageOverrides
+ from pyramid.interfaces import IPackageOverrides
package = DummyPackage('package')
opackage = DummyPackage('opackage')
config = self._makeOne()
@@ -2042,7 +2042,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(overrides.package, package)
def test__override_already_registered(self):
- from repoze.bfg.interfaces import IPackageOverrides
+ from pyramid.interfaces import IPackageOverrides
package = DummyPackage('package')
opackage = DummyPackage('opackage')
overrides = DummyOverrides(package)
@@ -2055,11 +2055,11 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(overrides.package, package)
def test_add_static_here_no_utility_registered(self):
- from repoze.bfg.static import PackageURLParser
+ from pyramid.static import PackageURLParser
from zope.interface import implementedBy
- from repoze.bfg.static import StaticURLInfo
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.static import StaticURLInfo
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
config = self._makeOne()
config.add_static_view('static', 'fixtures/static')
request_type = self._getRouteRequestIface(config, 'static/')
@@ -2072,26 +2072,26 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(wrapped(None, request).__class__, PackageURLParser)
def test_add_static_view_package_relative(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
info = DummyStaticURLInfo()
config = self._makeOne()
config.registry.registerUtility(info, IStaticURLInfo)
- config.add_static_view('static', 'repoze.bfg.tests:fixtures/static')
+ config.add_static_view('static', 'pyramid.tests:fixtures/static')
self.assertEqual(info.added,
- [('static', 'repoze.bfg.tests:fixtures/static', {})])
+ [('static', 'pyramid.tests:fixtures/static', {})])
def test_add_static_view_package_here_relative(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
info = DummyStaticURLInfo()
config = self._makeOne()
config.registry.registerUtility(info, IStaticURLInfo)
config.add_static_view('static', 'fixtures/static')
self.assertEqual(info.added,
- [('static', 'repoze.bfg.tests:fixtures/static', {})])
+ [('static', 'pyramid.tests:fixtures/static', {})])
def test_add_static_view_absolute(self):
import os
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
info = DummyStaticURLInfo()
config = self._makeOne()
config.registry.registerUtility(info, IStaticURLInfo)
@@ -2103,8 +2103,8 @@ class ConfiguratorTests(unittest.TestCase):
def test_set_notfound_view(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.exceptions import NotFound
+ from pyramid.interfaces import IRequest
+ from pyramid.exceptions import NotFound
config = self._makeOne()
view = lambda *arg: arg
config.set_notfound_view(view)
@@ -2116,8 +2116,8 @@ class ConfiguratorTests(unittest.TestCase):
def test_set_notfound_view_request_has_context(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.exceptions import NotFound
+ from pyramid.interfaces import IRequest
+ from pyramid.exceptions import NotFound
config = self._makeOne()
view = lambda *arg: arg
config.set_notfound_view(view)
@@ -2130,8 +2130,8 @@ class ConfiguratorTests(unittest.TestCase):
def test_set_forbidden_view(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.interfaces import IRequest
+ from pyramid.exceptions import Forbidden
config = self._makeOne()
view = lambda *arg: 'OK'
config.set_forbidden_view(view)
@@ -2143,8 +2143,8 @@ class ConfiguratorTests(unittest.TestCase):
def test_set_forbidden_view_request_has_context(self):
from zope.interface import implementedBy
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.interfaces import IRequest
+ from pyramid.exceptions import Forbidden
config = self._makeOne()
view = lambda *arg: arg
config.set_forbidden_view(view)
@@ -2156,7 +2156,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(result, ('abc', request))
def test__set_authentication_policy(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
config = self._makeOne()
policy = object()
config._set_authentication_policy(policy)
@@ -2164,7 +2164,7 @@ class ConfiguratorTests(unittest.TestCase):
config.registry.getUtility(IAuthenticationPolicy), policy)
def test__set_authorization_policy(self):
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
config = self._makeOne()
policy = object()
config._set_authorization_policy(policy)
@@ -2172,7 +2172,7 @@ class ConfiguratorTests(unittest.TestCase):
config.registry.getUtility(IAuthorizationPolicy), policy)
def test_set_locale_negotiator(self):
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.interfaces import ILocaleNegotiator
config = self._makeOne()
def negotiator(request): pass
config.set_locale_negotiator(negotiator)
@@ -2180,30 +2180,30 @@ class ConfiguratorTests(unittest.TestCase):
negotiator)
def test_set_locale_negotiator_dottedname(self):
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.interfaces import ILocaleNegotiator
config = self._makeOne()
config.set_locale_negotiator(
- 'repoze.bfg.tests.test_configuration.dummyfactory')
+ 'pyramid.tests.test_configuration.dummyfactory')
self.assertEqual(config.registry.getUtility(ILocaleNegotiator),
dummyfactory)
def test_set_request_factory(self):
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.interfaces import IRequestFactory
config = self._makeOne()
factory = object()
config.set_request_factory(factory)
self.assertEqual(config.registry.getUtility(IRequestFactory), factory)
def test_set_request_factory_dottedname(self):
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.interfaces import IRequestFactory
config = self._makeOne()
config.set_request_factory(
- 'repoze.bfg.tests.test_configuration.dummyfactory')
+ 'pyramid.tests.test_configuration.dummyfactory')
self.assertEqual(config.registry.getUtility(IRequestFactory),
dummyfactory)
def test_set_renderer_globals_factory(self):
- from repoze.bfg.interfaces import IRendererGlobalsFactory
+ from pyramid.interfaces import IRendererGlobalsFactory
config = self._makeOne()
factory = object()
config.set_renderer_globals_factory(factory)
@@ -2211,22 +2211,22 @@ class ConfiguratorTests(unittest.TestCase):
factory)
def test_set_renderer_globals_factory_dottedname(self):
- from repoze.bfg.interfaces import IRendererGlobalsFactory
+ from pyramid.interfaces import IRendererGlobalsFactory
config = self._makeOne()
config.set_renderer_globals_factory(
- 'repoze.bfg.tests.test_configuration.dummyfactory')
+ 'pyramid.tests.test_configuration.dummyfactory')
self.assertEqual(config.registry.getUtility(IRendererGlobalsFactory),
dummyfactory)
def test_set_default_permission(self):
- from repoze.bfg.interfaces import IDefaultPermission
+ from pyramid.interfaces import IDefaultPermission
config = self._makeOne()
config.set_default_permission('view')
self.assertEqual(config.registry.getUtility(IDefaultPermission),
'view')
def test_add_translation_dirs_missing_dir(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError,
config.add_translation_dirs,
@@ -2234,22 +2234,22 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_translation_dirs_resource_spec(self):
import os
- from repoze.bfg.interfaces import ITranslationDirectories
+ from pyramid.interfaces import ITranslationDirectories
config = self._makeOne()
- config.add_translation_dirs('repoze.bfg.tests.localeapp:locale')
+ config.add_translation_dirs('pyramid.tests.localeapp:locale')
here = os.path.dirname(__file__)
locale = os.path.join(here, 'localeapp', 'locale')
self.assertEqual(config.registry.getUtility(ITranslationDirectories),
[locale])
def test_add_translation_dirs_registers_chameleon_translate(self):
- from repoze.bfg.interfaces import IChameleonTranslate
- from repoze.bfg.threadlocal import manager
+ from pyramid.interfaces import IChameleonTranslate
+ from pyramid.threadlocal import manager
request = DummyRequest()
config = self._makeOne()
manager.push({'request':request, 'registry':config.registry})
try:
- config.add_translation_dirs('repoze.bfg.tests.localeapp:locale')
+ config.add_translation_dirs('pyramid.tests.localeapp:locale')
translate = config.registry.getUtility(IChameleonTranslate)
self.assertEqual(translate('Approve'), u'Approve')
finally:
@@ -2257,7 +2257,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_add_translation_dirs_abspath(self):
import os
- from repoze.bfg.interfaces import ITranslationDirectories
+ from pyramid.interfaces import ITranslationDirectories
config = self._makeOne()
here = os.path.dirname(__file__)
locale = os.path.join(here, 'localeapp', 'locale')
@@ -2276,7 +2276,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_derive_view_dottedname(self):
config = self._makeOne()
result = config.derive_view(
- 'repoze.bfg.tests.test_configuration.dummy_view')
+ 'pyramid.tests.test_configuration.dummy_view')
self.failIf(result is dummy_view)
self.assertEqual(result(None, None), 'OK')
@@ -2485,7 +2485,7 @@ class ConfiguratorTests(unittest.TestCase):
"'view_name' against context None): True")
def test__derive_view_debug_auth_permission_authpol_denied(self):
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.exceptions import Forbidden
view = lambda *arg: 'OK'
config = self._makeOne()
self._registerSettings(config,
@@ -2558,7 +2558,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(predicates, [True, True])
def test__derive_view_with_predicates_notall(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
view = lambda *arg: 'OK'
predicates = []
def predicate1(context, request):
@@ -2576,8 +2576,8 @@ class ConfiguratorTests(unittest.TestCase):
def test__derive_view_with_wrapper_viewname(self):
from webob import Response
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
inner_response = Response('OK')
def inner_view(context, request):
return inner_response
@@ -2612,18 +2612,18 @@ class ConfiguratorTests(unittest.TestCase):
self.assertRaises(ValueError, wrapped, None, request)
def test_override_resource_samename(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError, config.override_resource,'a', 'a')
def test_override_resource_directory_with_file(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError, config.override_resource,
'a:foo/', 'a:foo.pt')
def test_override_resource_file_with_directory(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
config = self._makeOne()
self.assertRaises(ConfigurationError, config.override_resource,
'a:foo.pt', 'a:foo/')
@@ -2632,18 +2632,18 @@ class ConfiguratorTests(unittest.TestCase):
config = self._makeOne()
override = DummyUnderOverride()
config.override_resource(
- 'repoze.bfg.tests.fixtureapp:templates/foo.pt',
- 'repoze.bfg.tests.fixtureapp.subpackage:templates/bar.pt',
+ 'pyramid.tests.fixtureapp:templates/foo.pt',
+ 'pyramid.tests.fixtureapp.subpackage:templates/bar.pt',
_override=override)
- from repoze.bfg.tests import fixtureapp
- from repoze.bfg.tests.fixtureapp import subpackage
+ from pyramid.tests import fixtureapp
+ from pyramid.tests.fixtureapp import subpackage
self.assertEqual(override.package, fixtureapp)
self.assertEqual(override.path, 'templates/foo.pt')
self.assertEqual(override.override_package, subpackage)
self.assertEqual(override.override_prefix, 'templates/bar.pt')
def test_add_renderer(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
config = self._makeOne()
renderer = object()
config.add_renderer('name', renderer)
@@ -2651,18 +2651,18 @@ class ConfiguratorTests(unittest.TestCase):
renderer)
def test_add_renderer_dottedname_factory(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
config = self._makeOne()
- import repoze.bfg.tests
- config.add_renderer('name', 'repoze.bfg.tests')
+ import pyramid.tests
+ config.add_renderer('name', 'pyramid.tests')
self.assertEqual(config.registry.getUtility(IRendererFactory, 'name'),
- repoze.bfg.tests)
+ pyramid.tests)
def test_scan_integration(self):
from zope.interface import alsoProvides
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.view import render_view_to_response
- import repoze.bfg.tests.grokkedapp as package
+ from pyramid.interfaces import IRequest
+ from pyramid.view import render_view_to_response
+ import pyramid.tests.grokkedapp as package
config = self._makeOne()
config.scan(package)
@@ -2759,10 +2759,10 @@ class ConfiguratorTests(unittest.TestCase):
def test_scan_integration_dottedname_package(self):
from zope.interface import alsoProvides
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.view import render_view_to_response
+ from pyramid.interfaces import IRequest
+ from pyramid.view import render_view_to_response
config = self._makeOne()
- config.scan('repoze.bfg.tests.grokkedapp')
+ config.scan('pyramid.tests.grokkedapp')
ctx = DummyContext()
req = DummyRequest()
@@ -2774,12 +2774,12 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(result, 'grokked')
def test_testing_securitypolicy(self):
- from repoze.bfg.testing import DummySecurityPolicy
+ from pyramid.testing import DummySecurityPolicy
config = self._makeOne()
config.testing_securitypolicy('user', ('group1', 'group2'),
permissive=False)
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
ut = config.registry.getUtility(IAuthenticationPolicy)
self.failUnless(isinstance(ut, DummySecurityPolicy))
ut = config.registry.getUtility(IAuthorizationPolicy)
@@ -2788,8 +2788,8 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(ut.permissive, False)
def test_testing_models(self):
- from repoze.bfg.traversal import find_model
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.traversal import find_model
+ from pyramid.interfaces import ITraverser
ob1 = object()
ob2 = object()
models = {'/ob1':ob1, '/ob2':ob2}
@@ -2830,7 +2830,7 @@ class ConfiguratorTests(unittest.TestCase):
def test_testing_add_subscriber_dottedname(self):
config = self._makeOne()
L = config.testing_add_subscriber(
- 'repoze.bfg.tests.test_configuration.IDummy')
+ 'pyramid.tests.test_configuration.IDummy')
event = DummyEvent()
config.registry.notify(event)
self.assertEqual(len(L), 1)
@@ -2860,7 +2860,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(L[-1], event2)
def test_hook_zca(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
gsm = DummyGetSiteManager()
config = self._makeOne()
config.hook_zca(getSiteManager=gsm)
@@ -2875,9 +2875,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_testing_add_renderer(self):
config = self._makeOne()
renderer = config.testing_add_renderer('templates/foo.pt')
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
self.failUnless(isinstance(renderer, DummyTemplateRenderer))
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
# must provide request to pass in registry (this is a functest)
request = DummyRequest()
request.registry = config.registry
@@ -2894,7 +2894,7 @@ class ConfiguratorTests(unittest.TestCase):
self.assertEqual(kw, {'foo':1, 'bar':2})
raise E
renderer = config.testing_add_renderer('templates/foo.pt', renderer)
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
# must provide request to pass in registry (this is a functest)
request = DummyRequest()
request.registry = config.registry
@@ -2909,9 +2909,9 @@ class ConfiguratorTests(unittest.TestCase):
def test_testing_add_template(self):
config = self._makeOne()
renderer = config.testing_add_template('templates/foo.pt')
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
self.failUnless(isinstance(renderer, DummyTemplateRenderer))
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
# must provide request to pass in registry (this is a functest)
request = DummyRequest()
request.registry = config.registry
@@ -2923,7 +2923,7 @@ class ConfiguratorTests(unittest.TestCase):
class Test__map_view(unittest.TestCase):
def setUp(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
self.registry = Registry()
testing.setUp(registry=self.registry)
@@ -2932,8 +2932,8 @@ class Test__map_view(unittest.TestCase):
testing.tearDown()
def _registerRenderer(self, typ='.txt'):
- from repoze.bfg.interfaces import IRendererFactory
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import IRendererFactory
+ from pyramid.interfaces import ITemplateRenderer
from zope.interface import implements
class Renderer:
implements(ITemplateRenderer)
@@ -2951,7 +2951,7 @@ class Test__map_view(unittest.TestCase):
return request
def _callFUT(self, *arg, **kw):
- from repoze.bfg.configuration import _map_view
+ from pyramid.configuration import _map_view
return _map_view(*arg, **kw)
def test__map_view_as_function_context_and_request(self):
@@ -3256,17 +3256,17 @@ class Test__map_view(unittest.TestCase):
def view(context, request):
return {'a':'1'}
result = self._callFUT(view, renderer_name=renderer.spec,
- package='repoze.bfg')
+ package='pyramid')
self.failIf(result is view)
self.assertEqual(view.__module__, result.__module__)
self.assertEqual(view.__doc__, result.__doc__)
request = self._makeRequest()
self.assertEqual(result(None, request).body, 'Hello!')
- self.assertEqual(renderer.path, 'repoze.bfg:abc.txt')
+ self.assertEqual(renderer.path, 'pyramid:abc.txt')
class Test_decorate_view(unittest.TestCase):
def _callFUT(self, wrapped, original):
- from repoze.bfg.configuration import decorate_view
+ from pyramid.configuration import decorate_view
return decorate_view(wrapped, original)
def test_it_same(self):
@@ -3316,7 +3316,7 @@ class Test_decorate_view(unittest.TestCase):
class Test__make_predicates(unittest.TestCase):
def _callFUT(self, **kw):
- from repoze.bfg.configuration import _make_predicates
+ from pyramid.configuration import _make_predicates
return _make_predicates(**kw)
def test_ordering_xhr_and_request_method_trump_only_containment(self):
@@ -3525,7 +3525,7 @@ class Test__make_predicates(unittest.TestCase):
class TestMultiView(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.configuration import MultiView
+ from pyramid.configuration import MultiView
return MultiView
def _makeOne(self, name='name'):
@@ -3533,12 +3533,12 @@ class TestMultiView(unittest.TestCase):
def test_class_implements_ISecuredView(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ISecuredView
+ from pyramid.interfaces import ISecuredView
verifyClass(ISecuredView, self._getTargetClass())
def test_instance_implements_ISecuredView(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ISecuredView
+ from pyramid.interfaces import ISecuredView
verifyObject(ISecuredView, self._makeOne())
def test_add(self):
@@ -3605,14 +3605,14 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(mv.get_views(request), mv.views)
def test_match_not_found(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
self.assertRaises(NotFound, mv.match, context, request)
def test_match_predicate_fails(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
def view(context, request):
""" """
@@ -3634,7 +3634,7 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(result, view)
def test_permitted_no_views(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -3661,14 +3661,14 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(result, False)
def test__call__not_found(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
self.assertRaises(NotFound, mv, context, request)
def test___call__intermediate_not_found(self):
- from repoze.bfg.exceptions import PredicateMismatch
+ from pyramid.exceptions import PredicateMismatch
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -3683,7 +3683,7 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(response, expected_response)
def test___call__raise_not_found_isnt_interpreted_as_pred_mismatch(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -3708,7 +3708,7 @@ class TestMultiView(unittest.TestCase):
self.assertEqual(response, expected_response)
def test__call_permissive__not_found(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
mv = self._makeOne()
context = DummyContext()
request = DummyRequest()
@@ -3772,7 +3772,7 @@ class TestMultiView(unittest.TestCase):
class TestRequestOnly(unittest.TestCase):
def _callFUT(self, arg):
- from repoze.bfg.configuration import requestonly
+ from pyramid.configuration import requestonly
return requestonly(arg)
def test_newstyle_class_no_init(self):
@@ -3935,7 +3935,7 @@ class TestMakeApp(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.configuration import make_app
+ from pyramid.configuration import make_app
return make_app(*arg, **kw)
def test_it(self):
@@ -3973,11 +3973,11 @@ class TestMakeApp(unittest.TestCase):
class TestDottedNameResolver(unittest.TestCase):
def _makeOne(self, package=None):
- from repoze.bfg.configuration import DottedNameResolver
+ from pyramid.configuration import DottedNameResolver
return DottedNameResolver(package)
def config_exc(self, func, *arg, **kw):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
try:
func(*arg, **kw)
except ConfigurationError, e:
@@ -3988,33 +3988,33 @@ class TestDottedNameResolver(unittest.TestCase):
def test_zope_dottedname_style_resolve_absolute(self):
typ = self._makeOne()
result = typ._zope_dottedname_style(
- 'repoze.bfg.tests.test_configuration.TestDottedNameResolver')
+ 'pyramid.tests.test_configuration.TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test_zope_dottedname_style_irrresolveable_absolute(self):
typ = self._makeOne()
self.assertRaises(ImportError, typ._zope_dottedname_style,
- 'repoze.bfg.test_configuration.nonexisting_name')
+ 'pyramid.test_configuration.nonexisting_name')
def test__zope_dottedname_style_resolve_relative(self):
- import repoze.bfg.tests
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ typ = self._makeOne(package=pyramid.tests)
result = typ._zope_dottedname_style(
'.test_configuration.TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test__zope_dottedname_style_resolve_relative_leading_dots(self):
- import repoze.bfg.tests.test_configuration
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests.test_configuration
+ typ = self._makeOne(package=pyramid.tests)
result = typ._zope_dottedname_style(
'..tests.test_configuration.TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test__zope_dottedname_style_resolve_relative_is_dot(self):
- import repoze.bfg.tests
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ typ = self._makeOne(package=pyramid.tests)
result = typ._zope_dottedname_style('.')
- self.assertEqual(result, repoze.bfg.tests)
+ self.assertEqual(result, pyramid.tests)
def test__zope_dottedname_style_irresolveable_relative_is_dot(self):
typ = self._makeOne()
@@ -4031,63 +4031,63 @@ class TestDottedNameResolver(unittest.TestCase):
"relative name '.whatever' irresolveable without package")
def test_zope_dottedname_style_irrresolveable_relative(self):
- import repoze.bfg.tests
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ typ = self._makeOne(package=pyramid.tests)
self.assertRaises(ImportError, typ._zope_dottedname_style,
'.notexisting')
def test__zope_dottedname_style_resolveable_relative(self):
- import repoze.bfg
- typ = self._makeOne(package=repoze.bfg)
+ import pyramid
+ typ = self._makeOne(package=pyramid)
result = typ._zope_dottedname_style('.tests')
- from repoze.bfg import tests
+ from pyramid import tests
self.assertEqual(result, tests)
def test__zope_dottedname_style_irresolveable_absolute(self):
typ = self._makeOne()
self.assertRaises(
ImportError,
- typ._zope_dottedname_style, 'repoze.bfg.fudge.bar')
+ typ._zope_dottedname_style, 'pyramid.fudge.bar')
def test__zope_dottedname_style_resolveable_absolute(self):
typ = self._makeOne()
result = typ._zope_dottedname_style(
- 'repoze.bfg.tests.test_configuration.TestDottedNameResolver')
+ 'pyramid.tests.test_configuration.TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test__pkg_resources_style_resolve_absolute(self):
typ = self._makeOne()
result = typ._pkg_resources_style(
- 'repoze.bfg.tests.test_configuration:TestDottedNameResolver')
+ 'pyramid.tests.test_configuration:TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test__pkg_resources_style_irrresolveable_absolute(self):
typ = self._makeOne()
self.assertRaises(ImportError, typ._pkg_resources_style,
- 'repoze.bfg.tests:nonexisting')
+ 'pyramid.tests:nonexisting')
def test__pkg_resources_style_resolve_relative(self):
- import repoze.bfg.tests
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ typ = self._makeOne(package=pyramid.tests)
result = typ._pkg_resources_style(
'.test_configuration:TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test__pkg_resources_style_resolve_relative_is_dot(self):
- import repoze.bfg.tests
- typ = self._makeOne(package=repoze.bfg.tests)
+ import pyramid.tests
+ typ = self._makeOne(package=pyramid.tests)
result = typ._pkg_resources_style('.')
- self.assertEqual(result, repoze.bfg.tests)
+ self.assertEqual(result, pyramid.tests)
def test__pkg_resources_style_resolve_relative_nocurrentpackage(self):
typ = self._makeOne()
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
self.assertRaises(ConfigurationError, typ._pkg_resources_style,
'.whatever')
def test__pkg_resources_style_irrresolveable_relative(self):
- import repoze.bfg
- typ = self._makeOne(package=repoze.bfg)
+ import pyramid
+ typ = self._makeOne(package=pyramid)
self.assertRaises(ImportError, typ._pkg_resources_style,
':notexisting')
@@ -4099,13 +4099,13 @@ class TestDottedNameResolver(unittest.TestCase):
def test_resolve_using_pkgresources_style(self):
typ = self._makeOne()
result = typ.resolve(
- 'repoze.bfg.tests.test_configuration:TestDottedNameResolver')
+ 'pyramid.tests.test_configuration:TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test_resolve_using_zope_dottedname_style(self):
typ = self._makeOne()
result = typ.resolve(
- 'repoze.bfg.tests.test_configuration:TestDottedNameResolver')
+ 'pyramid.tests.test_configuration:TestDottedNameResolver')
self.assertEqual(result, self.__class__)
def test_resolve_missing_raises(self):
@@ -4115,33 +4115,33 @@ class TestDottedNameResolver(unittest.TestCase):
"The dotted name 'cant.be.found' cannot be imported")
def test_ctor_string_module_resolveable(self):
- import repoze.bfg.tests
- typ = self._makeOne('repoze.bfg.tests.test_configuration')
- self.assertEqual(typ.package, repoze.bfg.tests)
- self.assertEqual(typ.package_name, 'repoze.bfg.tests')
+ import pyramid.tests
+ typ = self._makeOne('pyramid.tests.test_configuration')
+ self.assertEqual(typ.package, pyramid.tests)
+ self.assertEqual(typ.package_name, 'pyramid.tests')
def test_ctor_string_package_resolveable(self):
- import repoze.bfg.tests
- typ = self._makeOne('repoze.bfg.tests')
- self.assertEqual(typ.package, repoze.bfg.tests)
- self.assertEqual(typ.package_name, 'repoze.bfg.tests')
+ import pyramid.tests
+ typ = self._makeOne('pyramid.tests')
+ self.assertEqual(typ.package, pyramid.tests)
+ self.assertEqual(typ.package_name, 'pyramid.tests')
def test_ctor_string_irresolveable(self):
- from repoze.bfg.configuration import ConfigurationError
+ from pyramid.configuration import ConfigurationError
self.assertRaises(ConfigurationError, self._makeOne, 'cant.be.found')
def test_ctor_module(self):
- import repoze.bfg.tests
- import repoze.bfg.tests.test_configuration
- typ = self._makeOne(repoze.bfg.tests.test_configuration)
- self.assertEqual(typ.package, repoze.bfg.tests)
- self.assertEqual(typ.package_name, 'repoze.bfg.tests')
+ import pyramid.tests
+ import pyramid.tests.test_configuration
+ typ = self._makeOne(pyramid.tests.test_configuration)
+ self.assertEqual(typ.package, pyramid.tests)
+ self.assertEqual(typ.package_name, 'pyramid.tests')
def test_ctor_package(self):
- import repoze.bfg.tests
- typ = self._makeOne(repoze.bfg.tests)
- self.assertEqual(typ.package, repoze.bfg.tests)
- self.assertEqual(typ.package_name, 'repoze.bfg.tests')
+ import pyramid.tests
+ typ = self._makeOne(pyramid.tests)
+ self.assertEqual(typ.package, pyramid.tests)
+ self.assertEqual(typ.package_name, 'pyramid.tests')
def test_ctor_None(self):
typ = self._makeOne(None)
@@ -4150,7 +4150,7 @@ class TestDottedNameResolver(unittest.TestCase):
class Test_isexception(unittest.TestCase):
def _callFUT(self, ob):
- from repoze.bfg.configuration import isexception
+ from pyramid.configuration import isexception
return isexception(ob)
def test_is_exception_instance(self):
@@ -4165,11 +4165,11 @@ class Test_isexception(unittest.TestCase):
self.assertEqual(self._callFUT(E), True)
def test_is_IException(self):
- from repoze.bfg.interfaces import IException
+ from pyramid.interfaces import IException
self.assertEqual(self._callFUT(IException), True)
def test_is_IException_subinterface(self):
- from repoze.bfg.interfaces import IException
+ from pyramid.interfaces import IException
class ISubException(IException):
pass
self.assertEqual(self._callFUT(ISubException), True)
@@ -4283,7 +4283,7 @@ class DummyAccept(object):
return val in self.matches
from zope.interface import implements
-from repoze.bfg.interfaces import IMultiView
+from pyramid.interfaces import IMultiView
class DummyMultiView:
implements(IMultiView)
def __init__(self):
diff --git a/pyramid/tests/test_decorator.py b/pyramid/tests/test_decorator.py
index d41c62c65..9ab1b7229 100644
--- a/pyramid/tests/test_decorator.py
+++ b/pyramid/tests/test_decorator.py
@@ -2,7 +2,7 @@ import unittest
class TestReify(unittest.TestCase):
def _makeOne(self, wrapped):
- from repoze.bfg.decorator import reify
+ from pyramid.decorator import reify
return reify(wrapped)
def test___get__withinst(self):
diff --git a/pyramid/tests/test_encode.py b/pyramid/tests/test_encode.py
index 364247fb3..8a5530f2d 100644
--- a/pyramid/tests/test_encode.py
+++ b/pyramid/tests/test_encode.py
@@ -2,7 +2,7 @@ import unittest
class UrlEncodeTests(unittest.TestCase):
def _callFUT(self, query, doseq=False):
- from repoze.bfg.encode import urlencode
+ from pyramid.encode import urlencode
return urlencode(query, doseq)
def test_ascii_only(self):
@@ -30,7 +30,7 @@ class UrlEncodeTests(unittest.TestCase):
class URLQuoteTests(unittest.TestCase):
def _callFUT(self, val, safe=''):
- from repoze.bfg.encode import url_quote
+ from pyramid.encode import url_quote
return url_quote(val, safe)
def test_it_default(self):
@@ -45,7 +45,7 @@ class URLQuoteTests(unittest.TestCase):
class TestQuotePlus(unittest.TestCase):
def _callFUT(self, val, safe=''):
- from repoze.bfg.encode import quote_plus
+ from pyramid.encode import quote_plus
return quote_plus(val, safe)
def test_it_default(self):
diff --git a/pyramid/tests/test_events.py b/pyramid/tests/test_events.py
index d097ca0f4..2930683db 100644
--- a/pyramid/tests/test_events.py
+++ b/pyramid/tests/test_events.py
@@ -2,20 +2,20 @@ import unittest
class NewRequestEventTests(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.events import NewRequest
+ from pyramid.events import NewRequest
return NewRequest
def _makeOne(self, request):
return self._getTargetClass()(request)
def test_class_implements(self):
- from repoze.bfg.interfaces import INewRequest
+ from pyramid.interfaces import INewRequest
from zope.interface.verify import verifyClass
klass = self._getTargetClass()
verifyClass(INewRequest, klass)
def test_instance_implements(self):
- from repoze.bfg.interfaces import INewRequest
+ from pyramid.interfaces import INewRequest
from zope.interface.verify import verifyObject
request = DummyRequest()
inst = self._makeOne(request)
@@ -28,20 +28,20 @@ class NewRequestEventTests(unittest.TestCase):
class NewResponseEventTests(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.events import NewResponse
+ from pyramid.events import NewResponse
return NewResponse
def _makeOne(self, request, response):
return self._getTargetClass()(request, response)
def test_class_implements(self):
- from repoze.bfg.interfaces import INewResponse
+ from pyramid.interfaces import INewResponse
from zope.interface.verify import verifyClass
klass = self._getTargetClass()
verifyClass(INewResponse, klass)
def test_instance_implements(self):
- from repoze.bfg.interfaces import INewResponse
+ from pyramid.interfaces import INewResponse
from zope.interface.verify import verifyObject
request = DummyRequest()
response = DummyResponse()
@@ -57,49 +57,49 @@ class NewResponseEventTests(unittest.TestCase):
class ApplicationCreatedEventTests(unittest.TestCase):
def test_alias_object_implements(self):
- from repoze.bfg.events import WSGIApplicationCreatedEvent
+ from pyramid.events import WSGIApplicationCreatedEvent
event = WSGIApplicationCreatedEvent(object())
- from repoze.bfg.interfaces import IWSGIApplicationCreatedEvent
- from repoze.bfg.interfaces import IApplicationCreated
+ from pyramid.interfaces import IWSGIApplicationCreatedEvent
+ from pyramid.interfaces import IApplicationCreated
from zope.interface.verify import verifyObject
verifyObject(IWSGIApplicationCreatedEvent, event)
verifyObject(IApplicationCreated, event)
def test_alias_class_implements(self):
- from repoze.bfg.events import WSGIApplicationCreatedEvent
- from repoze.bfg.interfaces import IWSGIApplicationCreatedEvent
- from repoze.bfg.interfaces import IApplicationCreated
+ from pyramid.events import WSGIApplicationCreatedEvent
+ from pyramid.interfaces import IWSGIApplicationCreatedEvent
+ from pyramid.interfaces import IApplicationCreated
from zope.interface.verify import verifyClass
verifyClass(IWSGIApplicationCreatedEvent, WSGIApplicationCreatedEvent)
verifyClass(IApplicationCreated, WSGIApplicationCreatedEvent)
def test_object_implements(self):
- from repoze.bfg.events import ApplicationCreated
+ from pyramid.events import ApplicationCreated
event = ApplicationCreated(object())
- from repoze.bfg.interfaces import IApplicationCreated
+ from pyramid.interfaces import IApplicationCreated
from zope.interface.verify import verifyObject
verifyObject(IApplicationCreated, event)
def test_class_implements(self):
- from repoze.bfg.events import ApplicationCreated
- from repoze.bfg.interfaces import IApplicationCreated
+ from pyramid.events import ApplicationCreated
+ from pyramid.interfaces import IApplicationCreated
from zope.interface.verify import verifyClass
verifyClass(IApplicationCreated, ApplicationCreated)
class ContextFoundEventTests(unittest.TestCase):
def test_alias_class_implements(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.events import AfterTraversal
- from repoze.bfg.interfaces import IAfterTraversal
- from repoze.bfg.interfaces import IContextFound
+ from pyramid.events import AfterTraversal
+ from pyramid.interfaces import IAfterTraversal
+ from pyramid.interfaces import IContextFound
verifyClass(IAfterTraversal, AfterTraversal)
verifyClass(IContextFound, AfterTraversal)
def test_alias_instance_implements(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.events import AfterTraversal
- from repoze.bfg.interfaces import IAfterTraversal
- from repoze.bfg.interfaces import IContextFound
+ from pyramid.events import AfterTraversal
+ from pyramid.interfaces import IAfterTraversal
+ from pyramid.interfaces import IContextFound
request = DummyRequest()
inst = AfterTraversal(request)
verifyObject(IAfterTraversal, inst)
@@ -107,14 +107,14 @@ class ContextFoundEventTests(unittest.TestCase):
def test_class_implements(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.events import ContextFound
- from repoze.bfg.interfaces import IContextFound
+ from pyramid.events import ContextFound
+ from pyramid.interfaces import IContextFound
verifyClass(IContextFound, ContextFound)
def test_instance_implements(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.events import ContextFound
- from repoze.bfg.interfaces import IContextFound
+ from pyramid.events import ContextFound
+ from pyramid.interfaces import IContextFound
request = DummyRequest()
inst = ContextFound(request)
verifyObject(IContextFound, inst)
@@ -122,7 +122,7 @@ class ContextFoundEventTests(unittest.TestCase):
class TestSubscriber(unittest.TestCase):
def setUp(self):
registry = DummyRegistry()
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
self.config = Configurator(registry)
self.config.begin()
@@ -130,7 +130,7 @@ class TestSubscriber(unittest.TestCase):
self.config.end()
def _makeOne(self, *ifaces):
- from repoze.bfg.events import subscriber
+ from pyramid.events import subscriber
return subscriber(*ifaces)
def test_register(self):
diff --git a/pyramid/tests/test_exceptions.py b/pyramid/tests/test_exceptions.py
index 4091eb941..f17f19336 100644
--- a/pyramid/tests/test_exceptions.py
+++ b/pyramid/tests/test_exceptions.py
@@ -2,7 +2,7 @@ import unittest
class TestExceptionResponse(unittest.TestCase):
def _makeOne(self, message):
- from repoze.bfg.exceptions import ExceptionResponse
+ from pyramid.exceptions import ExceptionResponse
return ExceptionResponse(message)
def test_app_iter(self):
@@ -24,22 +24,22 @@ class TestExceptionResponse(unittest.TestCase):
class TestNotFound(unittest.TestCase):
def _makeOne(self, message):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
return NotFound(message)
def test_it(self):
- from repoze.bfg.exceptions import ExceptionResponse
+ from pyramid.exceptions import ExceptionResponse
e = self._makeOne('notfound')
self.failUnless(isinstance(e, ExceptionResponse))
self.assertEqual(e.status, '404 Not Found')
class TestForbidden(unittest.TestCase):
def _makeOne(self, message):
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.exceptions import Forbidden
return Forbidden(message)
def test_it(self):
- from repoze.bfg.exceptions import ExceptionResponse
+ from pyramid.exceptions import ExceptionResponse
e = self._makeOne('unauthorized')
self.failUnless(isinstance(e, ExceptionResponse))
self.assertEqual(e.status, '401 Unauthorized')
diff --git a/pyramid/tests/test_i18n.py b/pyramid/tests/test_i18n.py
index 95017807f..e65f29bc8 100644
--- a/pyramid/tests/test_i18n.py
+++ b/pyramid/tests/test_i18n.py
@@ -2,11 +2,11 @@
#
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestTranslationString(unittest.TestCase):
def _makeOne(self, *arg, **kw):
- from repoze.bfg.i18n import TranslationString
+ from pyramid.i18n import TranslationString
return TranslationString(*arg, **kw)
def test_it(self):
@@ -17,7 +17,7 @@ class TestTranslationString(unittest.TestCase):
class TestTranslationStringFactory(unittest.TestCase):
def _makeOne(self, *arg, **kw):
- from repoze.bfg.i18n import TranslationStringFactory
+ from pyramid.i18n import TranslationStringFactory
return TranslationStringFactory(*arg, **kw)
def test_it(self):
@@ -28,7 +28,7 @@ class TestTranslationStringFactory(unittest.TestCase):
class TestLocalizer(unittest.TestCase):
def _makeOne(self, *arg, **kw):
- from repoze.bfg.i18n import Localizer
+ from pyramid.i18n import Localizer
return Localizer(*arg, **kw)
def test_ctor(self):
@@ -59,13 +59,13 @@ class Test_negotiate_locale_name(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.i18n import negotiate_locale_name
+ from pyramid.i18n import negotiate_locale_name
return negotiate_locale_name(request)
def _registerImpl(self, impl):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.interfaces import ILocaleNegotiator
registry.registerUtility(impl, ILocaleNegotiator)
def test_no_registry_on_request(self):
@@ -75,7 +75,7 @@ class Test_negotiate_locale_name(unittest.TestCase):
self.assertEqual(result, 'bogus')
def test_with_registry_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
self._registerImpl(dummy_negotiator)
request = DummyRequest()
@@ -84,10 +84,10 @@ class Test_negotiate_locale_name(unittest.TestCase):
self.assertEqual(result, 'bogus')
def test_default_from_settings(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
settings = {'default_locale_name':'settings'}
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
registry.registerUtility(settings, ISettings)
request = DummyRequest()
request.registry = registry
@@ -95,7 +95,7 @@ class Test_negotiate_locale_name(unittest.TestCase):
self.assertEqual(result, 'settings')
def test_use_default_locale_negotiator(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
request = DummyRequest()
request.registry = registry
@@ -116,13 +116,13 @@ class Test_get_locale_name(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.i18n import get_locale_name
+ from pyramid.i18n import get_locale_name
return get_locale_name(request)
def _registerImpl(self, impl):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
- from repoze.bfg.interfaces import ILocaleNegotiator
+ from pyramid.interfaces import ILocaleNegotiator
registry.registerUtility(impl, ILocaleNegotiator)
def test_name_on_request(self):
@@ -146,7 +146,7 @@ class Test_get_localizer(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.i18n import get_localizer
+ from pyramid.i18n import get_localizer
return get_localizer(request)
def test_no_registry_on_request(self):
@@ -156,7 +156,7 @@ class Test_get_localizer(unittest.TestCase):
self.assertEqual(result, '123')
def test_with_registry_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
request = DummyRequest()
request.bfg_localizer = '123'
@@ -171,8 +171,8 @@ class Test_get_localizer(unittest.TestCase):
self.assertEqual(result, 'abc')
def test_locale_from_registry(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ILocalizer
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ILocalizer
registry = get_current_registry()
locale = 'abc'
registry.registerUtility(locale, ILocalizer, name='en')
@@ -183,9 +183,9 @@ class Test_get_localizer(unittest.TestCase):
def test_locale_from_mo(self):
import os
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ITranslationDirectories
- from repoze.bfg.i18n import Localizer
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ITranslationDirectories
+ from pyramid.i18n import Localizer
registry = get_current_registry()
here = os.path.dirname(__file__)
localedir = os.path.join(here, 'localeapp', 'locale')
@@ -202,9 +202,9 @@ class Test_get_localizer(unittest.TestCase):
def test_locale_from_mo_bad_mo(self):
import os
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ITranslationDirectories
- from repoze.bfg.i18n import Localizer
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ITranslationDirectories
+ from pyramid.i18n import Localizer
registry = get_current_registry()
here = os.path.dirname(__file__)
localedir = os.path.join(here, 'localeapp', 'locale')
@@ -225,7 +225,7 @@ class Test_default_locale_negotiator(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.i18n import default_locale_negotiator
+ from pyramid.i18n import default_locale_negotiator
return default_locale_negotiator(request)
def test_from_none(self):
@@ -253,7 +253,7 @@ class Test_default_locale_negotiator(unittest.TestCase):
class TestTranslations(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.i18n import Translations
+ from pyramid.i18n import Translations
return Translations
def _makeOne(self):
diff --git a/pyramid/tests/test_integration.py b/pyramid/tests/test_integration.py
index b6eb860ee..4d6f48399 100644
--- a/pyramid/tests/test_integration.py
+++ b/pyramid/tests/test_integration.py
@@ -1,13 +1,13 @@
import os
import unittest
-from repoze.bfg.wsgi import wsgiapp
-from repoze.bfg.view import bfg_view
-from repoze.bfg.view import static
+from pyramid.wsgi import wsgiapp
+from pyramid.view import bfg_view
+from pyramid.view import static
from zope.interface import Interface
-from repoze.bfg import testing
+from pyramid import testing
class INothing(Interface):
pass
@@ -30,11 +30,11 @@ class WGSIAppPlusBFGViewTests(unittest.TestCase):
self.assertEqual(result, '123')
def test_scanned(self):
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.tests import test_integration
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.configuration import Configurator
+ from pyramid.tests import test_integration
config = Configurator()
config.scan(test_integration)
reg = config.registry
@@ -70,7 +70,7 @@ class TwillBase(unittest.TestCase):
def setUp(self):
import sys
import twill
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
config = Configurator(root_factory=self.root_factory)
config.load_zcml(self.config)
twill.add_wsgi_intercept('localhost', 6543, config.make_wsgi_app)
@@ -90,7 +90,7 @@ class TwillBase(unittest.TestCase):
testing.tearDown()
class TestFixtureApp(TwillBase):
- config = 'repoze.bfg.tests.fixtureapp:configure.zcml'
+ config = 'pyramid.tests.fixtureapp:configure.zcml'
def test_it(self):
import twill.commands
browser = twill.commands.get_browser()
@@ -111,7 +111,7 @@ class TestFixtureApp(TwillBase):
class TestCCBug(TwillBase):
# "unordered" as reported in IRC by author of
# http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/
- config = 'repoze.bfg.tests.ccbugapp:configure.zcml'
+ config = 'pyramid.tests.ccbugapp:configure.zcml'
def test_it(self):
import twill.commands
browser = twill.commands.get_browser()
@@ -126,7 +126,7 @@ class TestHybridApp(TwillBase):
# make sure views registered for a route "win" over views registered
# without one, even though the context of the non-route view may
# be more specific than the route view.
- config = 'repoze.bfg.tests.hybridapp:configure.zcml'
+ config = 'pyramid.tests.hybridapp:configure.zcml'
def test_it(self):
import twill.commands
browser = twill.commands.get_browser()
@@ -161,7 +161,7 @@ class TestHybridApp(TwillBase):
class TestRestBugApp(TwillBase):
# test bug reported by delijati 2010/2/3 (http://pastebin.com/d4cc15515)
- config = 'repoze.bfg.tests.restbugapp:configure.zcml'
+ config = 'pyramid.tests.restbugapp:configure.zcml'
def test_it(self):
import twill.commands
browser = twill.commands.get_browser()
@@ -170,7 +170,7 @@ class TestRestBugApp(TwillBase):
self.assertEqual(browser.get_html(), 'gotten')
class TestViewDecoratorApp(TwillBase):
- config = 'repoze.bfg.tests.viewdecoratorapp:configure.zcml'
+ config = 'pyramid.tests.viewdecoratorapp:configure.zcml'
def test_it(self):
import twill.commands
browser = twill.commands.get_browser()
@@ -186,12 +186,12 @@ class TestViewDecoratorApp(TwillBase):
self.assertEqual(browser.get_code(), 200)
self.failUnless('OK3' in browser.get_html())
-from repoze.bfg.tests.exceptionviewapp.models import AnException, NotAnException
+from pyramid.tests.exceptionviewapp.models import AnException, NotAnException
excroot = {'anexception':AnException(),
'notanexception':NotAnException()}
class TestExceptionViewsApp(TwillBase):
- config = 'repoze.bfg.tests.exceptionviewapp:configure.zcml'
+ config = 'pyramid.tests.exceptionviewapp:configure.zcml'
root_factory = lambda *arg: excroot
def test_it(self):
import twill.commands
diff --git a/pyramid/tests/test_location.py b/pyramid/tests/test_location.py
index 9b8360f8b..3d30c9954 100644
--- a/pyramid/tests/test_location.py
+++ b/pyramid/tests/test_location.py
@@ -2,7 +2,7 @@ import unittest
class TestInside(unittest.TestCase):
def _callFUT(self, one, two):
- from repoze.bfg.location import inside
+ from pyramid.location import inside
return inside(one, two)
def test_inside(self):
@@ -20,7 +20,7 @@ class TestInside(unittest.TestCase):
class TestLineage(unittest.TestCase):
def _callFUT(self, context):
- from repoze.bfg.location import lineage
+ from pyramid.location import lineage
return lineage(context)
def test_lineage(self):
@@ -33,7 +33,7 @@ class TestLineage(unittest.TestCase):
result = list(self._callFUT(o1))
self.assertEqual(result, [o1])
-from repoze.bfg.interfaces import ILocation
+from pyramid.interfaces import ILocation
from zope.interface import implements
class Location(object):
implements(ILocation)
diff --git a/pyramid/tests/test_log.py b/pyramid/tests/test_log.py
index 4cc8d12a0..63add76ef 100644
--- a/pyramid/tests/test_log.py
+++ b/pyramid/tests/test_log.py
@@ -2,7 +2,7 @@ import unittest
class TestFunctions(unittest.TestCase):
def test_make_stream_logger(self):
- from repoze.bfg.log import make_stream_logger
+ from pyramid.log import make_stream_logger
import logging
import sys
logger = make_stream_logger('foo', sys.stderr, levelname='DEBUG',
diff --git a/pyramid/tests/test_paster.py b/pyramid/tests/test_paster.py
index 43837b5f0..69976e3b8 100644
--- a/pyramid/tests/test_paster.py
+++ b/pyramid/tests/test_paster.py
@@ -2,7 +2,7 @@ import unittest
class TestBFGShellCommand(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.paster import BFGShellCommand
+ from pyramid.paster import BFGShellCommand
return BFGShellCommand
def _makeOne(self):
@@ -109,7 +109,7 @@ class TestBFGShellCommand(unittest.TestCase):
class TestGetApp(unittest.TestCase):
def _callFUT(self, config_file, section_name, loadapp):
- from repoze.bfg.paster import get_app
+ from pyramid.paster import get_app
return get_app(config_file, section_name, loadapp)
def test_it(self):
diff --git a/pyramid/tests/test_path.py b/pyramid/tests/test_path.py
index 8ee0474f9..21e7bffe2 100644
--- a/pyramid/tests/test_path.py
+++ b/pyramid/tests/test_path.py
@@ -2,12 +2,12 @@ import unittest
class TestCallerPath(unittest.TestCase):
def tearDown(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
if hasattr(test_path, '__bfg_abspath__'):
del test_path.__bfg_abspath__
def _callFUT(self, path, level=2):
- from repoze.bfg.path import caller_path
+ from pyramid.path import caller_path
return caller_path(path, level)
def test_isabs(self):
@@ -22,7 +22,7 @@ class TestCallerPath(unittest.TestCase):
def test_memoization_has_bfg_abspath(self):
import os
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
test_path.__bfg_abspath__ = '/foo/bar'
result = self._callFUT('a/b/c')
self.assertEqual(result, os.path.join('/foo/bar', 'a/b/c'))
@@ -30,43 +30,43 @@ class TestCallerPath(unittest.TestCase):
def test_memoization_success(self):
import os
here = os.path.abspath(os.path.dirname(__file__))
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
result = self._callFUT('a/b/c')
self.assertEqual(result, os.path.join(here, 'a/b/c'))
self.assertEqual(test_path.__bfg_abspath__, here)
class TestCallerModule(unittest.TestCase):
def _callFUT(self, level=2):
- from repoze.bfg.path import caller_module
+ from pyramid.path import caller_module
return caller_module(level)
def test_it_level_1(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
result = self._callFUT(1)
self.assertEqual(result, test_path)
def test_it_level_2(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
result = self._callFUT(2)
self.assertEqual(result, test_path)
def test_it_level_3(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
result = self._callFUT(3)
self.failIfEqual(result, test_path)
class TestCallerPackage(unittest.TestCase):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.path import caller_package
+ from pyramid.path import caller_package
return caller_package(*arg, **kw)
def test_it_level_1(self):
- from repoze.bfg import tests
+ from pyramid import tests
result = self._callFUT(1)
self.assertEqual(result, tests)
def test_it_level_2(self):
- from repoze.bfg import tests
+ from pyramid import tests
result = self._callFUT(2)
self.assertEqual(result, tests)
@@ -76,37 +76,37 @@ class TestCallerPackage(unittest.TestCase):
self.assertEqual(result, unittest)
def test_it_package(self):
- import repoze.bfg.tests
+ import pyramid.tests
def dummy_caller_module(*arg):
- return repoze.bfg.tests
+ return pyramid.tests
result = self._callFUT(1, caller_module=dummy_caller_module)
- self.assertEqual(result, repoze.bfg.tests)
+ self.assertEqual(result, pyramid.tests)
class TestPackagePath(unittest.TestCase):
def _callFUT(self, package):
- from repoze.bfg.path import package_path
+ from pyramid.path import package_path
return package_path(package)
def test_it_package(self):
- from repoze.bfg import tests
+ from pyramid import tests
package = DummyPackageOrModule(tests)
result = self._callFUT(package)
self.assertEqual(result, package.package_path)
def test_it_module(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
module = DummyPackageOrModule(test_path)
result = self._callFUT(module)
self.assertEqual(result, module.package_path)
def test_memoization_success(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
module = DummyPackageOrModule(test_path)
self._callFUT(module)
self.assertEqual(module.__bfg_abspath__, module.package_path)
def test_memoization_fail(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
module = DummyPackageOrModule(test_path, raise_exc=TypeError)
result = self._callFUT(module)
self.failIf(hasattr(module, '__bfg_abspath__'))
@@ -114,38 +114,38 @@ class TestPackagePath(unittest.TestCase):
class TestPackageOf(unittest.TestCase):
def _callFUT(self, package):
- from repoze.bfg.path import package_of
+ from pyramid.path import package_of
return package_of(package)
def test_it_package(self):
- from repoze.bfg import tests
+ from pyramid import tests
package = DummyPackageOrModule(tests)
result = self._callFUT(package)
self.assertEqual(result, tests)
def test_it_module(self):
- import repoze.bfg.tests.test_configuration
- from repoze.bfg import tests
- package = DummyPackageOrModule(repoze.bfg.tests.test_configuration)
+ import pyramid.tests.test_configuration
+ from pyramid import tests
+ package = DummyPackageOrModule(pyramid.tests.test_configuration)
result = self._callFUT(package)
self.assertEqual(result, tests)
class TestPackageName(unittest.TestCase):
def _callFUT(self, package):
- from repoze.bfg.path import package_name
+ from pyramid.path import package_name
return package_name(package)
def test_it_package(self):
- from repoze.bfg import tests
+ from pyramid import tests
package = DummyPackageOrModule(tests)
result = self._callFUT(package)
- self.assertEqual(result, 'repoze.bfg.tests')
+ self.assertEqual(result, 'pyramid.tests')
def test_it_module(self):
- from repoze.bfg.tests import test_path
+ from pyramid.tests import test_path
module = DummyPackageOrModule(test_path)
result = self._callFUT(module)
- self.assertEqual(result, 'repoze.bfg.tests')
+ self.assertEqual(result, 'pyramid.tests')
def test_it_None(self):
result = self._callFUT(None)
diff --git a/pyramid/tests/test_registry.py b/pyramid/tests/test_registry.py
index b6185964a..7e6d1b67f 100644
--- a/pyramid/tests/test_registry.py
+++ b/pyramid/tests/test_registry.py
@@ -2,7 +2,7 @@ import unittest
class TestRegistry(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
return Registry
def _makeOne(self):
diff --git a/pyramid/tests/test_renderers.py b/pyramid/tests/test_renderers.py
index 264b4a547..7f4d893e8 100644
--- a/pyramid/tests/test_renderers.py
+++ b/pyramid/tests/test_renderers.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.testing import cleanUp
-from repoze.bfg import testing
+from pyramid.testing import cleanUp
+from pyramid import testing
class TestTemplateRendererFactory(unittest.TestCase):
def setUp(self):
@@ -11,17 +11,17 @@ class TestTemplateRendererFactory(unittest.TestCase):
cleanUp()
def _callFUT(self, path, factory):
- from repoze.bfg.renderers import template_renderer_factory
+ from pyramid.renderers import template_renderer_factory
return template_renderer_factory(path, factory)
def test_abspath_notfound(self):
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
abspath = '/wont/exist'
testing.registerUtility({}, ITemplateRenderer, name=abspath)
self.assertRaises(ValueError, self._callFUT, abspath, None)
def test_abspath_alreadyregistered(self):
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
import os
abspath = os.path.abspath(__file__)
renderer = {}
@@ -30,7 +30,7 @@ class TestTemplateRendererFactory(unittest.TestCase):
self.failUnless(result is renderer)
def test_abspath_notyetregistered(self):
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
import os
abspath = os.path.abspath(__file__)
renderer = {}
@@ -40,25 +40,25 @@ class TestTemplateRendererFactory(unittest.TestCase):
def test_relpath_path_registered(self):
renderer = {}
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
testing.registerUtility(renderer, ITemplateRenderer, name='foo/bar')
result = self._callFUT('foo/bar', None)
self.failUnless(renderer is result)
def test_relpath_is_package_registered(self):
renderer = {}
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
testing.registerUtility(renderer, ITemplateRenderer, name='foo:bar/baz')
result = self._callFUT('foo:bar/baz', None)
self.failUnless(renderer is result)
def test_spec_notfound(self):
self.assertRaises(ValueError, self._callFUT,
- 'repoze.bfg.tests:wont/exist', None)
+ 'pyramid.tests:wont/exist', None)
def test_spec_alreadyregistered(self):
- from repoze.bfg.interfaces import ITemplateRenderer
- from repoze.bfg import tests
+ from pyramid.interfaces import ITemplateRenderer
+ from pyramid import tests
module_name = tests.__name__
relpath = 'test_renderers.py'
spec = '%s:%s' % (module_name, relpath)
@@ -69,7 +69,7 @@ class TestTemplateRendererFactory(unittest.TestCase):
def test_spec_notyetregistered(self):
import os
- from repoze.bfg import tests
+ from pyramid import tests
module_name = tests.__name__
relpath = 'test_renderers.py'
renderer = {}
@@ -84,31 +84,31 @@ class TestTemplateRendererFactory(unittest.TestCase):
self.assertEqual(factory.kw, {})
def test_reload_resources_true(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ISettings
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ISettings
+ from pyramid.interfaces import ITemplateRenderer
settings = {'reload_resources':True}
testing.registerUtility(settings, ISettings)
renderer = {}
factory = DummyFactory(renderer)
- result = self._callFUT('repoze.bfg.tests:test_renderers.py', factory)
+ result = self._callFUT('pyramid.tests:test_renderers.py', factory)
self.failUnless(result is renderer)
- spec = '%s:%s' % ('repoze.bfg.tests', 'test_renderers.py')
+ spec = '%s:%s' % ('pyramid.tests', 'test_renderers.py')
reg = get_current_registry()
self.assertEqual(reg.queryUtility(ITemplateRenderer, name=spec),
None)
def test_reload_resources_false(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ISettings
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ISettings
+ from pyramid.interfaces import ITemplateRenderer
settings = {'reload_resources':False}
testing.registerUtility(settings, ISettings)
renderer = {}
factory = DummyFactory(renderer)
- result = self._callFUT('repoze.bfg.tests:test_renderers.py', factory)
+ result = self._callFUT('pyramid.tests:test_renderers.py', factory)
self.failUnless(result is renderer)
- spec = '%s:%s' % ('repoze.bfg.tests', 'test_renderers.py')
+ spec = '%s:%s' % ('pyramid.tests', 'test_renderers.py')
reg = get_current_registry()
self.assertNotEqual(reg.queryUtility(ITemplateRenderer, name=spec),
None)
@@ -121,11 +121,11 @@ class TestRendererFromName(unittest.TestCase):
cleanUp()
def _callFUT(self, path, package=None):
- from repoze.bfg.renderers import renderer_from_name
+ from pyramid.renderers import renderer_from_name
return renderer_from_name(path, package)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
import os
here = os.path.dirname(os.path.abspath(__file__))
fixture = os.path.join(here, 'fixtures/minimal.pt')
@@ -136,13 +136,13 @@ class TestRendererFromName(unittest.TestCase):
self.assertEqual(result, fixture)
def test_with_package(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
def factory(path, **kw):
return path
testing.registerUtility(factory, IRendererFactory, name='.pt')
- import repoze.bfg.tests
- result = self._callFUT('fixtures/minimal.pt', repoze.bfg.tests)
- self.assertEqual(result, 'repoze.bfg.tests:fixtures/minimal.pt')
+ import pyramid.tests
+ result = self._callFUT('fixtures/minimal.pt', pyramid.tests)
+ self.assertEqual(result, 'pyramid.tests:fixtures/minimal.pt')
def test_it_no_renderer(self):
self.assertRaises(ValueError, self._callFUT, 'foo')
@@ -150,7 +150,7 @@ class TestRendererFromName(unittest.TestCase):
class Test_json_renderer_factory(unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.renderers import json_renderer_factory
+ from pyramid.renderers import json_renderer_factory
return json_renderer_factory(name)
def test_it(self):
@@ -173,7 +173,7 @@ class Test_json_renderer_factory(unittest.TestCase):
class Test_string_renderer_factory(unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.renderers import string_renderer_factory
+ from pyramid.renderers import string_renderer_factory
return string_renderer_factory(name)
def test_it_unicode(self):
@@ -220,7 +220,7 @@ class Test_rendered_response(unittest.TestCase):
def _callFUT(self, renderer, response, view=None,
context=None, request=None, renderer_name=None):
- from repoze.bfg.renderers import rendered_response
+ from pyramid.renderers import rendered_response
if request is None:
request = testing.DummyRequest()
return rendered_response(renderer, response, view,
@@ -252,11 +252,11 @@ class TestRendererHelper(unittest.TestCase):
cleanUp()
def _makeOne(self, *arg, **kw):
- from repoze.bfg.renderers import RendererHelper
+ from pyramid.renderers import RendererHelper
return RendererHelper(*arg, **kw)
def _registerRendererFactory(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
def renderer(*arg):
def respond(*arg):
return arg
@@ -277,13 +277,13 @@ class TestRendererHelper(unittest.TestCase):
def test_resolve_spec_absolute(self):
helper = self._makeOne('loo.foo')
- result = helper.resolve_spec('repoze.bfg:flub')
- self.assertEqual(result, 'repoze.bfg:flub')
+ result = helper.resolve_spec('pyramid:flub')
+ self.assertEqual(result, 'pyramid:flub')
def test_resolve_spec_relative(self):
- helper = self._makeOne('loo.foo', package='repoze.bfg')
+ helper = self._makeOne('loo.foo', package='pyramid')
result = helper.resolve_spec('flub')
- self.assertEqual(result, 'repoze.bfg:flub')
+ self.assertEqual(result, 'pyramid:flub')
def test_render_to_response(self):
self._registerRendererFactory()
@@ -320,7 +320,7 @@ class TestRendererHelper(unittest.TestCase):
def test_render_renderer_globals_factory_active(self):
self._registerRendererFactory()
- from repoze.bfg.interfaces import IRendererGlobalsFactory
+ from pyramid.interfaces import IRendererGlobalsFactory
def rg(system):
return {'a':1}
self.config.registry.registerUtility(rg, IRendererGlobalsFactory)
@@ -376,7 +376,7 @@ class TestRendererHelper(unittest.TestCase):
self.assertEqual(response.cache_control.max_age, 100)
def test_with_alternate_response_factory(self):
- from repoze.bfg.interfaces import IResponseFactory
+ from pyramid.interfaces import IResponseFactory
class ResponseFactory(object):
def __init__(self, result):
self.result = result
@@ -389,7 +389,7 @@ class TestRendererHelper(unittest.TestCase):
def test__make_response_with_real_request(self):
# functional
- from repoze.bfg.request import Request
+ from pyramid.request import Request
request = Request({})
attrs = {'response_status':'406 You Lose'}
request.__dict__.update(attrs)
@@ -406,12 +406,12 @@ class Test_render(unittest.TestCase):
testing.tearDown()
def _callFUT(self, renderer_name, value, request=None, package=None):
- from repoze.bfg.renderers import render
+ from pyramid.renderers import render
return render(renderer_name, value, request=request, package=package)
def test_it_no_request(self):
renderer = self.config.testing_add_renderer(
- 'repoze.bfg.tests:abc/def.pt')
+ 'pyramid.tests:abc/def.pt')
renderer.string_response = 'abc'
result = self._callFUT('abc/def.pt', dict(a=1))
self.assertEqual(result, 'abc')
@@ -420,7 +420,7 @@ class Test_render(unittest.TestCase):
def test_it_with_request(self):
renderer = self.config.testing_add_renderer(
- 'repoze.bfg.tests:abc/def.pt')
+ 'pyramid.tests:abc/def.pt')
renderer.string_response = 'abc'
request = testing.DummyRequest()
result = self._callFUT('abc/def.pt',
@@ -437,13 +437,13 @@ class Test_render_to_response(unittest.TestCase):
testing.tearDown()
def _callFUT(self, renderer_name, value, request=None, package=None):
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
return render_to_response(renderer_name, value, request=request,
package=package)
def test_it_no_request(self):
renderer = self.config.testing_add_renderer(
- 'repoze.bfg.tests:abc/def.pt')
+ 'pyramid.tests:abc/def.pt')
renderer.string_response = 'abc'
response = self._callFUT('abc/def.pt', dict(a=1))
self.assertEqual(response.body, 'abc')
@@ -452,7 +452,7 @@ class Test_render_to_response(unittest.TestCase):
def test_it_with_request(self):
renderer = self.config.testing_add_renderer(
- 'repoze.bfg.tests:abc/def.pt')
+ 'pyramid.tests:abc/def.pt')
renderer.string_response = 'abc'
request = testing.DummyRequest()
response = self._callFUT('abc/def.pt',
@@ -469,12 +469,12 @@ class Test_get_renderer(unittest.TestCase):
testing.tearDown()
def _callFUT(self, renderer_name, **kw):
- from repoze.bfg.renderers import get_renderer
+ from pyramid.renderers import get_renderer
return get_renderer(renderer_name)
def test_it(self):
renderer = self.config.testing_add_renderer(
- 'repoze.bfg.tests:abc/def.pt')
+ 'pyramid.tests:abc/def.pt')
result = self._callFUT('abc/def.pt')
self.assertEqual(result, renderer)
diff --git a/pyramid/tests/test_request.py b/pyramid/tests/test_request.py
index f1874d60a..92edf2a51 100644
--- a/pyramid/tests/test_request.py
+++ b/pyramid/tests/test_request.py
@@ -5,7 +5,7 @@ class TestRequest(unittest.TestCase):
return self._getTargetClass()(environ)
def _getTargetClass(self):
- from repoze.bfg.request import Request
+ from pyramid.request import Request
return Request
def test_charset_defaults_to_utf8(self):
@@ -26,12 +26,12 @@ class TestRequest(unittest.TestCase):
self.assertEqual(request.GET['la'], u'La Pe\xf1a')
def test_class_implements(self):
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
klass = self._getTargetClass()
self.assertTrue(IRequest.implementedBy(klass))
def test_instance_provides(self):
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
inst = self._makeOne({})
self.assertTrue(IRequest.providedBy(inst))
@@ -193,7 +193,7 @@ class TestRequest(unittest.TestCase):
class Test_route_request_iface(unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.request import route_request_iface
+ from pyramid.request import route_request_iface
return route_request_iface(name)
def test_it(self):
@@ -204,7 +204,7 @@ class Test_route_request_iface(unittest.TestCase):
class Test_add_global_response_headers(unittest.TestCase):
def _callFUT(self, request, headerlist):
- from repoze.bfg.request import add_global_response_headers
+ from pyramid.request import add_global_response_headers
return add_global_response_headers(request, headerlist)
def test_it(self):
diff --git a/pyramid/tests/test_resource.py b/pyramid/tests/test_resource.py
index 191d72c8b..f71102de9 100644
--- a/pyramid/tests/test_resource.py
+++ b/pyramid/tests/test_resource.py
@@ -1,5 +1,5 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestOverrideProvider(unittest.TestCase):
def setUp(self):
@@ -9,24 +9,24 @@ class TestOverrideProvider(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.resource import OverrideProvider
+ from pyramid.resource import OverrideProvider
return OverrideProvider
def _makeOne(self, module):
klass = self._getTargetClass()
return klass(module)
- def _registerOverrides(self, overrides, name='repoze.bfg.tests'):
- from repoze.bfg.interfaces import IPackageOverrides
- from repoze.bfg.threadlocal import get_current_registry
+ def _registerOverrides(self, overrides, name='pyramid.tests'):
+ from pyramid.interfaces import IPackageOverrides
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
reg.registerUtility(overrides, IPackageOverrides, name=name)
def test_get_resource_filename_no_overrides(self):
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = os.path.join(here, resource_name)
result = provider.get_resource_filename(None, resource_name)
@@ -35,8 +35,8 @@ class TestOverrideProvider(unittest.TestCase):
def test_get_resource_stream_no_overrides(self):
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = open(os.path.join(here, resource_name)).read()
result = provider.get_resource_stream(None, resource_name)
@@ -45,8 +45,8 @@ class TestOverrideProvider(unittest.TestCase):
def test_get_resource_string_no_overrides(self):
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = open(os.path.join(here, resource_name)).read()
result = provider.get_resource_string(None, resource_name)
@@ -54,16 +54,16 @@ class TestOverrideProvider(unittest.TestCase):
def test_has_resource_no_overrides(self):
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.has_resource(resource_name)
self.assertEqual(result, True)
def test_resource_isdir_no_overrides(self):
file_resource_name = 'test_resource.py'
directory_resource_name = 'fixtures'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_isdir(file_resource_name)
self.assertEqual(result, False)
result = provider.resource_isdir(directory_resource_name)
@@ -71,8 +71,8 @@ class TestOverrideProvider(unittest.TestCase):
def test_resource_listdir_no_overrides(self):
resource_name = 'fixtures'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_isdir(resource_name)
self.failUnless(result)
@@ -81,8 +81,8 @@ class TestOverrideProvider(unittest.TestCase):
self._registerOverrides(overrides)
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = os.path.join(here, resource_name)
result = provider.get_resource_filename(None, resource_name)
@@ -93,8 +93,8 @@ class TestOverrideProvider(unittest.TestCase):
self._registerOverrides(overrides)
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = os.path.join(here, resource_name)
result = provider.get_resource_filename(None, resource_name)
@@ -105,8 +105,8 @@ class TestOverrideProvider(unittest.TestCase):
self._registerOverrides(overrides)
import os
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
here = os.path.dirname(os.path.abspath(__file__))
expected = os.path.join(here, resource_name)
result = provider.get_resource_filename(None, resource_name)
@@ -116,8 +116,8 @@ class TestOverrideProvider(unittest.TestCase):
overrides = DummyOverrides(None)
self._registerOverrides(overrides)
resource_name = 'test_resource.py'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.has_resource(resource_name)
self.assertEqual(result, True)
@@ -125,8 +125,8 @@ class TestOverrideProvider(unittest.TestCase):
overrides = DummyOverrides(None)
self._registerOverrides(overrides)
resource_name = 'fixtures'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_isdir(resource_name)
self.assertEqual(result, True)
@@ -134,62 +134,62 @@ class TestOverrideProvider(unittest.TestCase):
overrides = DummyOverrides(None)
self._registerOverrides(overrides)
resource_name = 'fixtures'
- import repoze.bfg.tests
- provider = self._makeOne(repoze.bfg.tests)
+ import pyramid.tests
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_listdir(resource_name)
self.failUnless(result)
def test_get_resource_filename_override_returns_value(self):
overrides = DummyOverrides('value')
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.get_resource_filename(None, 'test_resource.py')
self.assertEqual(result, 'value')
def test_get_resource_stream_override_returns_value(self):
overrides = DummyOverrides('value')
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.get_resource_stream(None, 'test_resource.py')
self.assertEqual(result, 'value')
def test_get_resource_string_override_returns_value(self):
overrides = DummyOverrides('value')
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.get_resource_string(None, 'test_resource.py')
self.assertEqual(result, 'value')
def test_has_resource_override_returns_True(self):
overrides = DummyOverrides(True)
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.has_resource('test_resource.py')
self.assertEqual(result, True)
def test_resource_isdir_override_returns_False(self):
overrides = DummyOverrides(False)
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_isdir('fixtures')
self.assertEqual(result, False)
def test_resource_listdir_override_returns_values(self):
overrides = DummyOverrides(['a'])
- import repoze.bfg.tests
+ import pyramid.tests
self._registerOverrides(overrides)
- provider = self._makeOne(repoze.bfg.tests)
+ provider = self._makeOne(pyramid.tests)
result = provider.resource_listdir('fixtures')
self.assertEqual(result, ['a'])
class TestPackageOverrides(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.resource import PackageOverrides
+ from pyramid.resource import PackageOverrides
return PackageOverrides
def _makeOne(self, package, pkg_resources=None):
@@ -215,7 +215,7 @@ class TestPackageOverrides(unittest.TestCase):
self.assertEqual(package.__loader__, po)
def test_ctor_registers_loader_type(self):
- from repoze.bfg.resource import OverrideProvider
+ from pyramid.resource import OverrideProvider
dummy_pkg_resources = DummyPkgResources()
package = DummyPackage('package')
po = self._makeOne(package, dummy_pkg_resources)
@@ -229,7 +229,7 @@ class TestPackageOverrides(unittest.TestCase):
self.assertEqual(po.overridden_package_name, 'package')
def test_insert_directory(self):
- from repoze.bfg.resource import DirectoryOverride
+ from pyramid.resource import DirectoryOverride
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= [None]
@@ -239,7 +239,7 @@ class TestPackageOverrides(unittest.TestCase):
self.assertEqual(override.__class__, DirectoryOverride)
def test_insert_file(self):
- from repoze.bfg.resource import FileOverride
+ from pyramid.resource import FileOverride
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= [None]
@@ -259,7 +259,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_get_filename(self):
import os
overrides = [ DummyOverride(None), DummyOverride(
- ('repoze.bfg.tests', 'test_resource.py'))]
+ ('pyramid.tests', 'test_resource.py'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -270,7 +270,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_get_stream(self):
import os
overrides = [ DummyOverride(None), DummyOverride(
- ('repoze.bfg.tests', 'test_resource.py'))]
+ ('pyramid.tests', 'test_resource.py'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -281,7 +281,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_get_string(self):
import os
overrides = [ DummyOverride(None), DummyOverride(
- ('repoze.bfg.tests', 'test_resource.py'))]
+ ('pyramid.tests', 'test_resource.py'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -291,7 +291,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_has_resource(self):
overrides = [ DummyOverride(None), DummyOverride(
- ('repoze.bfg.tests', 'test_resource.py'))]
+ ('pyramid.tests', 'test_resource.py'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -299,7 +299,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_isdir_false(self):
overrides = [ DummyOverride(
- ('repoze.bfg.tests', 'test_resource.py'))]
+ ('pyramid.tests', 'test_resource.py'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -307,7 +307,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_isdir_true(self):
overrides = [ DummyOverride(
- ('repoze.bfg.tests', 'fixtures'))]
+ ('pyramid.tests', 'fixtures'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -315,7 +315,7 @@ class TestPackageOverrides(unittest.TestCase):
def test_listdir(self):
overrides = [ DummyOverride(
- ('repoze.bfg.tests', 'fixtures'))]
+ ('pyramid.tests', 'fixtures'))]
package = DummyPackage('package')
po = self._makeOne(package)
po.overrides= overrides
@@ -323,7 +323,7 @@ class TestPackageOverrides(unittest.TestCase):
class TestDirectoryOverride(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.resource import DirectoryOverride
+ from pyramid.resource import DirectoryOverride
return DirectoryOverride
def _makeOne(self, path, package, prefix):
@@ -342,7 +342,7 @@ class TestDirectoryOverride(unittest.TestCase):
class Test_resolve_resource_spec(unittest.TestCase):
def _callFUT(self, spec, package_name='__main__'):
- from repoze.bfg.resource import resolve_resource_spec
+ from pyramid.resource import resolve_resource_spec
return resolve_resource_spec(spec, package_name)
def test_abspath(self):
@@ -354,17 +354,17 @@ class Test_resolve_resource_spec(unittest.TestCase):
self.assertEqual(package_name, None)
def test_rel_spec(self):
- pkg = 'repoze.bfg.tests'
+ pkg = 'pyramid.tests'
path = 'test_resource.py'
package_name, filename = self._callFUT(path, pkg)
- self.assertEqual(package_name, 'repoze.bfg.tests')
+ self.assertEqual(package_name, 'pyramid.tests')
self.assertEqual(filename, 'test_resource.py')
def test_abs_spec(self):
- pkg = 'repoze.bfg.tests'
- path = 'repoze.bfg.nottests:test_resource.py'
+ pkg = 'pyramid.tests'
+ path = 'pyramid.nottests:test_resource.py'
package_name, filename = self._callFUT(path, pkg)
- self.assertEqual(package_name, 'repoze.bfg.nottests')
+ self.assertEqual(package_name, 'pyramid.nottests')
self.assertEqual(filename, 'test_resource.py')
def test_package_name_is_None(self):
@@ -375,17 +375,17 @@ class Test_resolve_resource_spec(unittest.TestCase):
self.assertEqual(filename, 'test_resource.py')
def test_package_name_is_package_object(self):
- import repoze.bfg.tests
- pkg = repoze.bfg.tests
+ import pyramid.tests
+ pkg = pyramid.tests
path = 'test_resource.py'
package_name, filename = self._callFUT(path, pkg)
- self.assertEqual(package_name, 'repoze.bfg.tests')
+ self.assertEqual(package_name, 'pyramid.tests')
self.assertEqual(filename, 'test_resource.py')
class TestFileOverride(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.resource import FileOverride
+ from pyramid.resource import FileOverride
return FileOverride
def _makeOne(self, path, package, prefix):
diff --git a/pyramid/tests/test_router.py b/pyramid/tests/test_router.py
index fade0679b..84ac18f53 100644
--- a/pyramid/tests/test_router.py
+++ b/pyramid/tests/test_router.py
@@ -1,26 +1,26 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class TestRouter(unittest.TestCase):
def setUp(self):
testing.setUp()
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
self.registry = get_current_registry()
def tearDown(self):
testing.tearDown()
def _registerRouteRequest(self, name):
- from repoze.bfg.interfaces import IRouteRequest
- from repoze.bfg.request import route_request_iface
+ from pyramid.interfaces import IRouteRequest
+ from pyramid.request import route_request_iface
iface = route_request_iface(name)
self.registry.registerUtility(iface, IRouteRequest, name=name)
return iface
def _connectRoute(self, name, path, factory=None):
- from repoze.bfg.interfaces import IRoutesMapper
- from repoze.bfg.urldispatch import RoutesMapper
+ from pyramid.interfaces import IRoutesMapper
+ from pyramid.urldispatch import RoutesMapper
mapper = self.registry.queryUtility(IRoutesMapper)
if mapper is None:
mapper = RoutesMapper()
@@ -28,13 +28,13 @@ class TestRouter(unittest.TestCase):
mapper.connect(name, path, factory)
def _registerLogger(self):
- from repoze.bfg.interfaces import IDebugLogger
+ from pyramid.interfaces import IDebugLogger
logger = DummyLogger()
self.registry.registerUtility(logger, IDebugLogger)
return logger
def _registerSettings(self, **kw):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
settings = {'debug_authorization':False, 'debug_notfound':False}
settings.update(kw)
self.registry.registerUtility(settings, ISettings)
@@ -43,7 +43,7 @@ class TestRouter(unittest.TestCase):
traversed=None, virtual_root=None,
virtual_root_path=None, raise_error=None,
**kw):
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
if virtual_root is None:
virtual_root = context
@@ -75,7 +75,7 @@ class TestRouter(unittest.TestCase):
ITraverser, name='')
def _registerView(self, app, name, classifier, req_iface, ctx_iface):
- from repoze.bfg.interfaces import IView
+ from pyramid.interfaces import IView
self.registry.registerAdapter(
app, (classifier, req_iface, ctx_iface), IView, name)
@@ -88,12 +88,12 @@ class TestRouter(unittest.TestCase):
def _registerRootFactory(self, val):
rootfactory = DummyRootFactory(val)
- from repoze.bfg.interfaces import IRootFactory
+ from pyramid.interfaces import IRootFactory
self.registry.registerUtility(rootfactory, IRootFactory)
return rootfactory
def _getTargetClass(self):
- from repoze.bfg.router import Router
+ from pyramid.router import Router
return Router
def _makeOne(self):
@@ -119,7 +119,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(router.root_policy, rootfactory)
def test_request_factory(self):
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.interfaces import IRequestFactory
class DummyRequestFactory(object):
pass
self.registry.registerUtility(DummyRequestFactory, IRequestFactory)
@@ -127,7 +127,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(router.request_factory, DummyRequestFactory)
def test_call_traverser_default(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
logger = self._registerLogger()
router = self._makeOne()
@@ -138,7 +138,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(len(logger.messages), 0)
def test_traverser_raises_notfound_class(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context, raise_error=NotFound)
@@ -147,7 +147,7 @@ class TestRouter(unittest.TestCase):
self.assertRaises(NotFound, router, environ, start_response)
def test_traverser_raises_notfound_instance(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context, raise_error=NotFound('foo'))
@@ -157,7 +157,7 @@ class TestRouter(unittest.TestCase):
self.failUnless('foo' in why[0], why)
def test_traverser_raises_forbidden_class(self):
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.exceptions import Forbidden
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context, raise_error=Forbidden)
@@ -166,7 +166,7 @@ class TestRouter(unittest.TestCase):
self.assertRaises(Forbidden, router, environ, start_response)
def test_traverser_raises_forbidden_instance(self):
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.exceptions import Forbidden
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context, raise_error=Forbidden('foo'))
@@ -176,7 +176,7 @@ class TestRouter(unittest.TestCase):
self.failUnless('foo' in why[0], why)
def test_call_no_view_registered_no_isettings(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context)
@@ -189,7 +189,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(len(logger.messages), 0)
def test_call_no_view_registered_debug_notfound_false(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context)
@@ -203,7 +203,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(len(logger.messages), 0)
def test_call_no_view_registered_debug_notfound_true(self):
- from repoze.bfg.exceptions import NotFound
+ from pyramid.exceptions import NotFound
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context)
@@ -227,7 +227,7 @@ class TestRouter(unittest.TestCase):
self.failUnless("subpath: []" in message)
def test_call_view_returns_nonresponse(self):
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
self._registerTraverserFactory(context)
environ = self._makeEnviron()
@@ -238,7 +238,7 @@ class TestRouter(unittest.TestCase):
self.assertRaises(ValueError, router, environ, start_response)
def test_call_view_registered_nonspecific_default_path(self):
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
self._registerTraverserFactory(context)
response = DummyResponse()
@@ -260,7 +260,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(request.root, context)
def test_call_view_registered_nonspecific_nondefault_path_and_subpath(self):
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
self._registerTraverserFactory(context, view_name='foo',
subpath=['bar'],
@@ -288,8 +288,8 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context)
@@ -314,13 +314,13 @@ class TestRouter(unittest.TestCase):
def test_call_view_registered_specific_fail(self):
from zope.interface import Interface
from zope.interface import directlyProvides
- from repoze.bfg.exceptions import NotFound
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.exceptions import NotFound
+ from pyramid.interfaces import IViewClassifier
class IContext(Interface):
pass
class INotContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
context = DummyContext()
directlyProvides(context, INotContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -335,11 +335,11 @@ class TestRouter(unittest.TestCase):
def test_call_view_raises_forbidden(self):
from zope.interface import Interface
from zope.interface import directlyProvides
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.exceptions import Forbidden
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -357,9 +357,9 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.exceptions import NotFound
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.exceptions import NotFound
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -377,8 +377,8 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -400,8 +400,8 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -423,8 +423,8 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
directlyProvides(context, IContext)
self._registerTraverserFactory(context, subpath=[''])
@@ -451,10 +451,10 @@ class TestRouter(unittest.TestCase):
exc_raised(NotImplementedError, router, environ, start_response)
def test_call_eventsends(self):
- from repoze.bfg.interfaces import INewRequest
- from repoze.bfg.interfaces import INewResponse
- from repoze.bfg.interfaces import IContextFound
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import INewRequest
+ from pyramid.interfaces import INewResponse
+ from pyramid.interfaces import IContextFound
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
self._registerTraverserFactory(context)
response = DummyResponse()
@@ -477,7 +477,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, response.app_iter)
def test_call_pushes_and_pops_threadlocal_manager(self):
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IViewClassifier
context = DummyContext()
self._registerTraverserFactory(context)
response = DummyResponse()
@@ -493,7 +493,7 @@ class TestRouter(unittest.TestCase):
self.assertEqual(len(router.threadlocal_manager.popped), 1)
def test_call_route_matches_and_has_factory(self):
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IViewClassifier
self._registerRouteRequest('foo')
root = object()
def factory(request):
@@ -525,8 +525,8 @@ class TestRouter(unittest.TestCase):
self.assertEqual(request.matched_route.name, 'foo')
def test_call_route_matches_doesnt_overwrite_subscriber_iface(self):
- from repoze.bfg.interfaces import INewRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import INewRequest
+ from pyramid.interfaces import IViewClassifier
from zope.interface import alsoProvides
from zope.interface import Interface
self._registerRouteRequest('foo')
@@ -566,8 +566,8 @@ class TestRouter(unittest.TestCase):
self.failUnless(IFoo.providedBy(request))
def test_root_factory_raises_notfound(self):
- from repoze.bfg.interfaces import IRootFactory
- from repoze.bfg.exceptions import NotFound
+ from pyramid.interfaces import IRootFactory
+ from pyramid.exceptions import NotFound
from zope.interface import Interface
from zope.interface import directlyProvides
def rootfactory(request):
@@ -584,8 +584,8 @@ class TestRouter(unittest.TestCase):
self.failUnless('from root factory' in why[0])
def test_root_factory_raises_forbidden(self):
- from repoze.bfg.interfaces import IRootFactory
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.interfaces import IRootFactory
+ from pyramid.exceptions import Forbidden
from zope.interface import Interface
from zope.interface import directlyProvides
def rootfactory(request):
@@ -602,7 +602,7 @@ class TestRouter(unittest.TestCase):
self.failUnless('from root factory' in why[0])
def test_root_factory_exception_propagating(self):
- from repoze.bfg.interfaces import IRootFactory
+ from pyramid.interfaces import IRootFactory
from zope.interface import Interface
from zope.interface import directlyProvides
def rootfactory(request):
@@ -630,13 +630,13 @@ class TestRouter(unittest.TestCase):
from zope.interface import directlyProvides
class IContext(Interface):
pass
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequestFactory
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequestFactory
def rfactory(environ):
return request
self.registry.registerUtility(rfactory, IRequestFactory)
- from repoze.bfg.request import Request
+ from pyramid.request import Request
request = Request.blank('/')
context = DummyContext()
directlyProvides(context, IContext)
@@ -653,9 +653,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(request.exception.__class__, RuntimeError)
def test_call_view_raises_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
response = DummyResponse()
exception_response = DummyResponse()
exception_response.app_iter = ["Hello, world"]
@@ -672,9 +672,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(view.request.exception.__class__, RuntimeError)
def test_call_view_raises_super_exception_sub_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class SuperException(Exception):
pass
class SubException(SuperException):
@@ -693,9 +693,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(SuperException, router, environ, start_response)
def test_call_view_raises_sub_exception_super_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class SuperException(Exception):
pass
class SubException(SuperException):
@@ -715,9 +715,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, world"])
def test_call_view_raises_exception_another_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class MyException(Exception):
pass
class AnotherException(Exception):
@@ -736,9 +736,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(MyException, router, environ, start_response)
def test_root_factory_raises_exception_view(self):
- from repoze.bfg.interfaces import IRootFactory
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRootFactory
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IExceptionViewClassifier
def rootfactory(request):
raise RuntimeError()
self.registry.registerUtility(rootfactory, IRootFactory)
@@ -754,8 +754,8 @@ class TestRouter(unittest.TestCase):
self.assertEqual(app_iter, ["Hello, world"])
def test_traverser_raises_exception_view(self):
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IExceptionViewClassifier
environ = self._makeEnviron()
context = DummyContext()
self._registerTraverserFactory(context, raise_error=RuntimeError())
@@ -770,9 +770,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, world"])
def test_exception_view_returns_non_response(self):
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
environ = self._makeEnviron()
response = DummyResponse()
view = DummyView(response, raise_exception=RuntimeError)
@@ -785,8 +785,8 @@ class TestRouter(unittest.TestCase):
self.assertRaises(ValueError, router, environ, start_response)
def test_call_route_raises_route_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
req_iface = self._registerRouteRequest('foo')
self._connectRoute('foo', 'archives/:action/:article', None)
view = DummyView(DummyResponse(), raise_exception=RuntimeError)
@@ -803,9 +803,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, world"])
def test_call_view_raises_exception_route_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
req_iface = self._registerRouteRequest('foo')
self._connectRoute('foo', 'archives/:action/:article', None)
view = DummyView(DummyResponse(), raise_exception=RuntimeError)
@@ -821,9 +821,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(RuntimeError, router, environ, start_response)
def test_call_route_raises_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
req_iface = self._registerRouteRequest('foo')
self._connectRoute('foo', 'archives/:action/:article', None)
view = DummyView(DummyResponse(), raise_exception=RuntimeError)
@@ -840,9 +840,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, world"])
def test_call_route_raises_super_exception_sub_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class SuperException(Exception):
pass
class SubException(SuperException):
@@ -862,9 +862,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(SuperException, router, environ, start_response)
def test_call_route_raises_sub_exception_super_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class SuperException(Exception):
pass
class SubException(SuperException):
@@ -885,9 +885,9 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, world"])
def test_call_route_raises_exception_another_exception_view(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
class MyException(Exception):
pass
class AnotherException(Exception):
@@ -907,9 +907,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(MyException, router, environ, start_response)
def test_call_route_raises_exception_view_specializing(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
req_iface = self._registerRouteRequest('foo')
self._connectRoute('foo', 'archives/:action/:article', None)
view = DummyView(DummyResponse(), raise_exception=RuntimeError)
@@ -931,8 +931,8 @@ class TestRouter(unittest.TestCase):
self.assertEqual(result, ["Hello, special world"])
def test_call_route_raises_exception_view_another_route(self):
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
req_iface = self._registerRouteRequest('foo')
another_req_iface = self._registerRouteRequest('bar')
self._connectRoute('foo', 'archives/:action/:article', None)
@@ -949,9 +949,9 @@ class TestRouter(unittest.TestCase):
self.assertRaises(RuntimeError, router, environ, start_response)
def test_call_view_raises_exception_view_route(self):
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IExceptionViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IExceptionViewClassifier
req_iface = self._registerRouteRequest('foo')
response = DummyResponse()
exception_response = DummyResponse()
diff --git a/pyramid/tests/test_scripting.py b/pyramid/tests/test_scripting.py
index 2663c4a0f..d2139b7db 100644
--- a/pyramid/tests/test_scripting.py
+++ b/pyramid/tests/test_scripting.py
@@ -2,7 +2,7 @@ import unittest
class TestGetRoot(unittest.TestCase):
def _callFUT(self, app, request=None):
- from repoze.bfg.paster import get_root
+ from pyramid.paster import get_root
return get_root(app, request)
def test_it_norequest(self):
diff --git a/pyramid/tests/test_security.py b/pyramid/tests/test_security.py
index 13a0e2d9b..dd9d48f45 100644
--- a/pyramid/tests/test_security.py
+++ b/pyramid/tests/test_security.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestAllPermissionsList(unittest.TestCase):
@@ -11,7 +11,7 @@ class TestAllPermissionsList(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.security import AllPermissionsList
+ from pyramid.security import AllPermissionsList
return AllPermissionsList
def _makeOne(self):
@@ -24,12 +24,12 @@ class TestAllPermissionsList(unittest.TestCase):
self.failUnless('anything' in thing)
def test_singleton(self):
- from repoze.bfg.security import ALL_PERMISSIONS
+ from pyramid.security import ALL_PERMISSIONS
self.assertEqual(ALL_PERMISSIONS.__class__, self._getTargetClass())
class TestAllowed(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.security import Allowed
+ from pyramid.security import Allowed
return Allowed
def _makeOne(self, *arg, **kw):
@@ -47,7 +47,7 @@ class TestAllowed(unittest.TestCase):
class TestDenied(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.security import Denied
+ from pyramid.security import Denied
return Denied
def _makeOne(self, *arg, **kw):
@@ -65,7 +65,7 @@ class TestDenied(unittest.TestCase):
class TestACLAllowed(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.security import ACLAllowed
+ from pyramid.security import ACLAllowed
return ACLAllowed
def _makeOne(self, *arg, **kw):
@@ -85,7 +85,7 @@ class TestACLAllowed(unittest.TestCase):
class TestACLDenied(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.security import ACLDenied
+ from pyramid.security import ACLDenied
return ACLDenied
def _makeOne(self, *arg, **kw):
@@ -111,14 +111,14 @@ class TestViewExecutionPermitted(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.security import view_execution_permitted
+ from pyramid.security import view_execution_permitted
return view_execution_permitted(*arg, **kw)
def _registerSecuredView(self, view_name, allow=True):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
from zope.interface import Interface
- from repoze.bfg.interfaces import ISecuredView
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import ISecuredView
+ from pyramid.interfaces import IViewClassifier
class Checker(object):
def __permitted__(self, context, request):
self.context = context
@@ -131,8 +131,8 @@ class TestViewExecutionPermitted(unittest.TestCase):
return checker
def test_no_permission(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import ISettings
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import ISettings
settings = dict(debug_authorization=True)
reg = get_current_registry()
reg.registerUtility(settings, ISettings)
@@ -147,7 +147,7 @@ class TestViewExecutionPermitted(unittest.TestCase):
def test_with_permission(self):
from zope.interface import Interface
from zope.interface import directlyProvides
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
class IContext(Interface):
pass
context = DummyContext()
@@ -166,7 +166,7 @@ class TestHasPermission(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg):
- from repoze.bfg.security import has_permission
+ from pyramid.security import has_permission
return has_permission(*arg)
def test_no_authentication_policy(self):
@@ -187,7 +187,7 @@ class TestHasPermission(unittest.TestCase):
self.assertEqual(self._callFUT('view', None, request), 'yo')
def test_no_registry_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
request = DummyRequest({})
registry = get_current_registry()
_registerAuthenticationPolicy(registry, None)
@@ -202,7 +202,7 @@ class TestAuthenticatedUserId(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.security import authenticated_userid
+ from pyramid.security import authenticated_userid
return authenticated_userid(request)
def test_no_authentication_policy(self):
@@ -217,7 +217,7 @@ class TestAuthenticatedUserId(unittest.TestCase):
self.assertEqual(result, 'yo')
def test_with_authentication_policy_no_reg_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
request = DummyRequest({})
registry = get_current_registry()
_registerAuthenticationPolicy(registry, 'yo')
@@ -232,7 +232,7 @@ class TestEffectivePrincipals(unittest.TestCase):
cleanUp()
def _callFUT(self, request):
- from repoze.bfg.security import effective_principals
+ from pyramid.security import effective_principals
return effective_principals(request)
def test_no_authentication_policy(self):
@@ -247,7 +247,7 @@ class TestEffectivePrincipals(unittest.TestCase):
self.assertEqual(result, 'yo')
def test_with_authentication_policy_no_reg_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
request = DummyRequest({})
_registerAuthenticationPolicy(registry, 'yo')
@@ -262,17 +262,17 @@ class TestPrincipalsAllowedByPermission(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg):
- from repoze.bfg.security import principals_allowed_by_permission
+ from pyramid.security import principals_allowed_by_permission
return principals_allowed_by_permission(*arg)
def test_no_authorization_policy(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
context = DummyContext()
result = self._callFUT(context, 'view')
self.assertEqual(result, [Everyone])
def test_with_authorization_policy(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
_registerAuthorizationPolicy(registry, 'yo')
context = DummyContext()
@@ -287,7 +287,7 @@ class TestRemember(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg):
- from repoze.bfg.security import remember
+ from pyramid.security import remember
return remember(*arg)
def test_no_authentication_policy(self):
@@ -303,7 +303,7 @@ class TestRemember(unittest.TestCase):
self.assertEqual(result, 'yo')
def test_with_authentication_policy_no_reg_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
request = DummyRequest({})
_registerAuthenticationPolicy(registry, 'yo')
@@ -318,7 +318,7 @@ class TestForget(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg):
- from repoze.bfg.security import forget
+ from pyramid.security import forget
return forget(*arg)
def test_no_authentication_policy(self):
@@ -333,7 +333,7 @@ class TestForget(unittest.TestCase):
self.assertEqual(result, 'yo')
def test_with_authentication_policy_no_reg_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
registry = get_current_registry()
request = DummyRequest({})
_registerAuthenticationPolicy(registry, 'yo')
@@ -375,19 +375,19 @@ class DummyAuthorizationPolicy:
return self.result
def _registerAuthenticationPolicy(reg, result):
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
policy = DummyAuthenticationPolicy(result)
reg.registerUtility(policy, IAuthenticationPolicy)
return policy
def _registerAuthorizationPolicy(reg, result):
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
policy = DummyAuthorizationPolicy(result)
reg.registerUtility(policy, IAuthorizationPolicy)
return policy
def _makeRequest():
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
request = DummyRequest({})
request.registry = Registry()
return request
diff --git a/pyramid/tests/test_settings.py b/pyramid/tests/test_settings.py
index be73f9dce..0689a0835 100644
--- a/pyramid/tests/test_settings.py
+++ b/pyramid/tests/test_settings.py
@@ -2,7 +2,7 @@ import unittest
class TestSettings(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.settings import Settings
+ from pyramid.settings import Settings
return Settings
def _makeOne(self, d=None, environ=None):
@@ -179,8 +179,8 @@ class TestSettings(unittest.TestCase):
class TestGetSettings(unittest.TestCase):
def setUp(self):
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.registry import Registry
+ from pyramid.configuration import Configurator
+ from pyramid.registry import Registry
registry = Registry('testing')
self.config = Configurator(registry=registry)
self.config.begin()
@@ -189,14 +189,14 @@ class TestGetSettings(unittest.TestCase):
self.config.end()
def _callFUT(self):
- from repoze.bfg.settings import get_settings
+ from pyramid.settings import get_settings
return get_settings()
def test_it_nosettings(self):
self.assertEqual(self._callFUT(), None)
def test_it_withsettings(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
settings = {'a':1}
self.config.registry.registerUtility(settings, ISettings)
self.assertEqual(self._callFUT(), settings)
diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py
index 449860883..bd910cb66 100644
--- a/pyramid/tests/test_static.py
+++ b/pyramid/tests/test_static.py
@@ -1,9 +1,9 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestPackageURLParser(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.static import PackageURLParser
+ from pyramid.static import PackageURLParser
return PackageURLParser
def _makeOne(self, *arg, **kw):
@@ -40,7 +40,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_call_adds_slash_path_info_empty(self):
environ = self._makeEnviron(PATH_INFO='')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -49,7 +49,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_path_info_slash_means_index_html(self):
environ = self._makeEnviron()
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -57,7 +57,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_out_of_bounds(self):
environ = self._makeEnviron()
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
inst.root_resource = 'abcdef'
sr = DummyStartResponse()
response = inst(environ, sr)
@@ -67,7 +67,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_doesnt_exist(self):
environ = self._makeEnviron(PATH_INFO='/notthere')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -76,7 +76,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_isdir(self):
environ = self._makeEnviron(PATH_INFO='/subdir/')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -84,7 +84,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_is_file(self):
environ = self._makeEnviron(PATH_INFO='/index.html')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -92,7 +92,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_is_file_with_cache_max_age(self):
environ = self._makeEnviron(PATH_INFO='/index.html')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static',
+ inst = self._makeOne('pyramid.tests', 'fixtures/static',
cache_max_age=600)
sr = DummyStartResponse()
response = inst(environ, sr)
@@ -108,7 +108,7 @@ class TestPackageURLParser(unittest.TestCase):
def test_resource_is_file_with_no_cache_max_age(self):
environ = self._makeEnviron(PATH_INFO='/index.html')
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
body = response[0]
@@ -126,7 +126,7 @@ class TestPackageURLParser(unittest.TestCase):
return True
dummy_eq = DummyEq()
environ = self._makeEnviron(HTTP_IF_NONE_MATCH=dummy_eq)
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
sr = DummyStartResponse()
response = inst(environ, sr)
self.assertEqual(len(sr.headerlist), 1)
@@ -135,13 +135,13 @@ class TestPackageURLParser(unittest.TestCase):
self.assertEqual(response[0], '')
def test_repr(self):
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
self.failUnless(
repr(inst).startswith(
- '<PackageURLParser repoze.bfg.tests:fixtures/static at'))
+ '<PackageURLParser pyramid.tests:fixtures/static at'))
def test_not_found(self):
- inst = self._makeOne('repoze.bfg.tests', 'fixtures/static')
+ inst = self._makeOne('pyramid.tests', 'fixtures/static')
environ = self._makeEnviron()
sr = DummyStartResponse()
response = inst.not_found(environ, sr, 'debug_message')
@@ -157,7 +157,7 @@ class TestStaticView(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.view import static
+ from pyramid.view import static
return static
def _makeOne(self, path, package_name=None):
@@ -197,7 +197,7 @@ class TestStaticView(unittest.TestCase):
self.assertEqual(request.copied, True)
self.assertEqual(response.root_resource, 'fixtures')
self.assertEqual(response.resource_name, 'fixtures')
- self.assertEqual(response.package_name, 'repoze.bfg.tests')
+ self.assertEqual(response.package_name, 'pyramid.tests')
self.assertEqual(response.cache_max_age, 3600)
def test_relpath_withpackage(self):
@@ -228,19 +228,19 @@ class TestStaticView(unittest.TestCase):
class TestStaticURLInfo(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.static import StaticURLInfo
+ from pyramid.static import StaticURLInfo
return StaticURLInfo
def _makeOne(self, config):
return self._getTargetClass()(config)
def test_verifyClass(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
from zope.interface.verify import verifyClass
verifyClass(IStaticURLInfo, self._getTargetClass())
def test_verifyObject(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
from zope.interface.verify import verifyObject
verifyObject(IStaticURLInfo, self._makeOne(None))
@@ -301,7 +301,7 @@ class TestStaticURLInfo(unittest.TestCase):
self.assertEqual(inst.registrations, expected)
def test_add_viewname(self):
- from repoze.bfg.static import static_view
+ from pyramid.static import static_view
class Config:
def add_route(self, *arg, **kw):
self.arg = arg
diff --git a/pyramid/tests/test_testing.py b/pyramid/tests/test_testing.py
index b900a44a4..b43fea597 100644
--- a/pyramid/tests/test_testing.py
+++ b/pyramid/tests/test_testing.py
@@ -3,8 +3,8 @@ import unittest
class TestBase(unittest.TestCase):
def setUp(self):
- from repoze.bfg.threadlocal import manager
- from repoze.bfg.registry import Registry
+ from pyramid.threadlocal import manager
+ from pyramid.registry import Registry
manager.clear()
registry = Registry('testing')
self.registry = registry
@@ -13,20 +13,20 @@ class TestBase(unittest.TestCase):
__show__.off()
def tearDown(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
manager.clear()
from zope.deprecation import __show__
__show__.on()
class Test_registerDummySecurityPolicy(TestBase):
def test_registerDummySecurityPolicy(self):
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerDummySecurityPolicy('user', ('group1', 'group2'),
permissive=False)
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
ut = self.registry.getUtility(IAuthenticationPolicy)
- from repoze.bfg.testing import DummySecurityPolicy
+ from pyramid.testing import DummySecurityPolicy
self.failUnless(isinstance(ut, DummySecurityPolicy))
ut = self.registry.getUtility(IAuthorizationPolicy)
self.assertEqual(ut.userid, 'user')
@@ -38,9 +38,9 @@ class Test_registerModels(TestBase):
ob1 = object()
ob2 = object()
models = {'/ob1':ob1, '/ob2':ob2}
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerModels(models)
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
adapter = self.registry.getAdapter(None, ITraverser)
result = adapter({'PATH_INFO':'/ob1'})
self.assertEqual(result['context'], ob1)
@@ -57,31 +57,31 @@ class Test_registerModels(TestBase):
self.assertEqual(result['virtual_root'], ob2)
self.assertEqual(result['virtual_root_path'], ())
self.assertRaises(KeyError, adapter, {'PATH_INFO':'/ob3'})
- from repoze.bfg.traversal import find_model
+ from pyramid.traversal import find_model
self.assertEqual(find_model(None, '/ob1'), ob1)
class Test_registerTemplateRenderer(TestBase):
def test_registerTemplateRenderer(self):
- from repoze.bfg import testing
+ from pyramid import testing
renderer = testing.registerTemplateRenderer('templates/foo')
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
self.failUnless(isinstance(renderer, DummyTemplateRenderer))
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
render_to_response('templates/foo', dict(foo=1, bar=2))
renderer.assert_(foo=1)
renderer.assert_(bar=2)
def test_registerTemplateRenderer_explicitrenderer(self):
- from repoze.bfg import testing
+ from pyramid import testing
def renderer(kw, system):
self.assertEqual(kw, {'foo':1, 'bar':2})
renderer = testing.registerTemplateRenderer('templates/foo', renderer)
- from repoze.bfg.renderers import render_to_response
+ from pyramid.renderers import render_to_response
render_to_response('templates/foo', dict(foo=1, bar=2))
class Test_registerEventListener(TestBase):
def test_registerEventListener_single(self):
- from repoze.bfg import testing
+ from pyramid import testing
L = testing.registerEventListener(IDummy)
event = DummyEvent()
self.registry.notify(event)
@@ -91,7 +91,7 @@ class Test_registerEventListener(TestBase):
self.assertEqual(len(L), 1)
def test_registerEventListener_multiple(self):
- from repoze.bfg import testing
+ from pyramid import testing
L = testing.registerEventListener((Interface, IDummy))
event = DummyEvent()
event.object = 'foo'
@@ -102,7 +102,7 @@ class Test_registerEventListener(TestBase):
self.assertEqual(L[1], event)
def test_registerEventListener_defaults(self):
- from repoze.bfg import testing
+ from pyramid import testing
L = testing.registerEventListener()
event = object()
self.registry.notify(event)
@@ -113,59 +113,59 @@ class Test_registerEventListener(TestBase):
class Test_registerView(TestBase):
def test_registerView_defaults(self):
- from repoze.bfg import testing
+ from pyramid import testing
view = testing.registerView('moo.html')
import types
self.failUnless(isinstance(view, types.FunctionType))
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
request = DummyRequest()
request.registry = self.registry
response = render_view_to_response(None, request, 'moo.html')
self.assertEqual(view(None, None).body, response.body)
def test_registerView_withresult(self):
- from repoze.bfg import testing
+ from pyramid import testing
view = testing.registerView('moo.html', 'yo')
import types
self.failUnless(isinstance(view, types.FunctionType))
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
request = DummyRequest()
request.registry = self.registry
response = render_view_to_response(None, request, 'moo.html')
self.assertEqual(response.body, 'yo')
def test_registerView_custom(self):
- from repoze.bfg import testing
+ from pyramid import testing
def view(context, request):
from webob import Response
return Response('123')
view = testing.registerView('moo.html', view=view)
import types
self.failUnless(isinstance(view, types.FunctionType))
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
request = DummyRequest()
request.registry = self.registry
response = render_view_to_response(None, request, 'moo.html')
self.assertEqual(response.body, '123')
def test_registerView_with_permission_denying(self):
- from repoze.bfg import testing
- from repoze.bfg.exceptions import Forbidden
+ from pyramid import testing
+ from pyramid.exceptions import Forbidden
def view(context, request):
""" """
view = testing.registerView('moo.html', view=view, permission='bar')
testing.registerDummySecurityPolicy(permissive=False)
import types
self.failUnless(isinstance(view, types.FunctionType))
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
request = DummyRequest()
request.registry = self.registry
self.assertRaises(Forbidden, render_view_to_response,
None, request, 'moo.html')
def test_registerView_with_permission_denying2(self):
- from repoze.bfg import testing
- from repoze.bfg.security import view_execution_permitted
+ from pyramid import testing
+ from pyramid.security import view_execution_permitted
def view(context, request):
""" """
view = testing.registerView('moo.html', view=view, permission='bar')
@@ -176,7 +176,7 @@ class Test_registerView(TestBase):
self.assertEqual(result, False)
def test_registerView_with_permission_allowing(self):
- from repoze.bfg import testing
+ from pyramid import testing
def view(context, request):
from webob import Response
return Response('123')
@@ -184,7 +184,7 @@ class Test_registerView(TestBase):
testing.registerDummySecurityPolicy(permissive=True)
import types
self.failUnless(isinstance(view, types.FunctionType))
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
request = DummyRequest()
request.registry = self.registry
result = render_view_to_response(None, request, 'moo.html')
@@ -192,8 +192,8 @@ class Test_registerView(TestBase):
def test_registerViewPermission_defaults(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IViewPermission
- from repoze.bfg import testing
+ from pyramid.interfaces import IViewPermission
+ from pyramid import testing
testing.registerViewPermission('moo.html')
result = self.registry.getMultiAdapter(
(Interface, Interface), IViewPermission, 'moo.html')
@@ -201,8 +201,8 @@ class Test_registerView(TestBase):
def test_registerViewPermission_denying(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IViewPermission
- from repoze.bfg import testing
+ from pyramid.interfaces import IViewPermission
+ from pyramid import testing
testing.registerViewPermission('moo.html', result=False)
result = self.registry.getMultiAdapter(
(Interface, Interface), IViewPermission, 'moo.html')
@@ -210,10 +210,10 @@ class Test_registerView(TestBase):
def test_registerViewPermission_custom(self):
from zope.interface import Interface
- from repoze.bfg.interfaces import IViewPermission
+ from pyramid.interfaces import IViewPermission
def viewperm(context, request):
return True
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerViewPermission('moo.html', viewpermission=viewperm)
result = self.registry.getMultiAdapter(
(Interface, Interface), IViewPermission, 'moo.html')
@@ -228,7 +228,7 @@ class Test_registerAdapter(TestBase):
pass
class for_(Interface):
pass
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerAdapter(Provider, (for_, for_), provides, name='foo')
adapter = self.registry.adapters.lookup(
(for_, for_), provides, name='foo')
@@ -242,7 +242,7 @@ class Test_registerAdapter(TestBase):
pass
class for_(Interface):
pass
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerAdapter(Provider, for_, provides, name='foo')
adapter = self.registry.adapters.lookup(
(for_,), provides, name='foo')
@@ -259,13 +259,13 @@ class Test_registerUtility(TestBase):
def __call__(self):
return 'foo'
utility = impl()
- from repoze.bfg import testing
+ from pyramid import testing
testing.registerUtility(utility, iface, name='mudge')
self.assertEqual(self.registry.getUtility(iface, name='mudge')(), 'foo')
class Test_registerSubscriber(TestBase):
def test_it(self):
- from repoze.bfg import testing
+ from pyramid import testing
L = []
def subscriber(event):
L.append(event)
@@ -279,9 +279,9 @@ class Test_registerSubscriber(TestBase):
class Test_registerRoute(TestBase):
def test_registerRoute(self):
- from repoze.bfg.url import route_url
- from repoze.bfg.interfaces import IRoutesMapper
- from repoze.bfg.testing import registerRoute
+ from pyramid.url import route_url
+ from pyramid.interfaces import IRoutesMapper
+ from pyramid.testing import registerRoute
registerRoute(':pagename', 'home', DummyFactory)
mapper = self.registry.getUtility(IRoutesMapper)
self.assertEqual(len(mapper.routelist), 1)
@@ -291,16 +291,16 @@ class Test_registerRoute(TestBase):
class Test_registerRoutesMapper(TestBase):
def test_registerRoutesMapper(self):
- from repoze.bfg.interfaces import IRoutesMapper
- from repoze.bfg.testing import registerRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
+ from pyramid.testing import registerRoutesMapper
result = registerRoutesMapper()
mapper = self.registry.getUtility(IRoutesMapper)
self.assertEqual(result, mapper)
class Test_registerSettings(TestBase):
def test_registerSettings(self):
- from repoze.bfg.interfaces import ISettings
- from repoze.bfg.testing import registerSettings
+ from pyramid.interfaces import ISettings
+ from pyramid.testing import registerSettings
registerSettings({'a':1, 'b':2})
settings = self.registry.getUtility(ISettings)
self.assertEqual(settings['a'], 1)
@@ -313,7 +313,7 @@ class Test_registerSettings(TestBase):
class TestDummyRootFactory(unittest.TestCase):
def _makeOne(self, environ):
- from repoze.bfg.testing import DummyRootFactory
+ from pyramid.testing import DummyRootFactory
return DummyRootFactory(environ)
def test_it(self):
@@ -323,7 +323,7 @@ class TestDummyRootFactory(unittest.TestCase):
class TestDummySecurityPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.testing import DummySecurityPolicy
+ from pyramid.testing import DummySecurityPolicy
return DummySecurityPolicy
def _makeOne(self, userid=None, groupids=(), permissive=True):
@@ -336,14 +336,14 @@ class TestDummySecurityPolicy(unittest.TestCase):
def test_effective_principals_userid(self):
policy = self._makeOne('user', ('group1',))
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
self.assertEqual(policy.effective_principals(None),
[Everyone, Authenticated, 'user', 'group1'])
def test_effective_principals_nouserid(self):
policy = self._makeOne()
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
self.assertEqual(policy.effective_principals(None), [Everyone])
def test_permits(self):
@@ -352,8 +352,8 @@ class TestDummySecurityPolicy(unittest.TestCase):
def test_principals_allowed_by_permission(self):
policy = self._makeOne('user', ('group1',))
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
result = policy.principals_allowed_by_permission(None, None)
self.assertEqual(result, [Everyone, Authenticated, 'user', 'group1'])
@@ -369,7 +369,7 @@ class TestDummySecurityPolicy(unittest.TestCase):
class TestDummyModel(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.testing import DummyModel
+ from pyramid.testing import DummyModel
return DummyModel
def _makeOne(self, name=None, parent=None, **kw):
@@ -426,7 +426,7 @@ class TestDummyModel(unittest.TestCase):
class TestDummyRequest(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.testing import DummyRequest
+ from pyramid.testing import DummyRequest
return DummyRequest
def _makeOne(self, *arg, **kw):
@@ -444,7 +444,7 @@ class TestDummyRequest(unittest.TestCase):
self.assertEqual(request.environ['PATH_INFO'], '/foo')
def test_defaults(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
request = self._makeOne()
self.assertEqual(request.method, 'GET')
self.assertEqual(request.application_url, 'http://example.com')
@@ -522,7 +522,7 @@ class TestDummyRequest(unittest.TestCase):
class TestDummyTemplateRenderer(unittest.TestCase):
def _getTargetClass(self, ):
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
return DummyTemplateRenderer
def _makeOne(self, string_response=''):
@@ -555,13 +555,13 @@ class TestDummyTemplateRenderer(unittest.TestCase):
class Test_setUp(unittest.TestCase):
def _callFUT(self, **kw):
- from repoze.bfg.testing import setUp
+ from pyramid.testing import setUp
return setUp(**kw)
def test_it_defaults(self):
- from repoze.bfg.threadlocal import manager
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.registry import Registry
+ from pyramid.threadlocal import manager
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.registry import Registry
from zope.component import getSiteManager
old = True
manager.push(old)
@@ -580,7 +580,7 @@ class Test_setUp(unittest.TestCase):
def test_it_with_registry(self):
from zope.component import getSiteManager
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
registry = object()
try:
self._callFUT(registry=registry)
@@ -592,7 +592,7 @@ class Test_setUp(unittest.TestCase):
def test_it_with_request(self):
from zope.component import getSiteManager
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
request = object()
try:
self._callFUT(request=request)
@@ -604,7 +604,7 @@ class Test_setUp(unittest.TestCase):
def test_it_with_hook_zca_false(self):
from zope.component import getSiteManager
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
registry = object()
try:
self._callFUT(registry=registry, hook_zca=False)
@@ -616,16 +616,16 @@ class Test_setUp(unittest.TestCase):
class Test_cleanUp(Test_setUp):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.testing import cleanUp
+ from pyramid.testing import cleanUp
return cleanUp(*arg, **kw)
class Test_tearDown(unittest.TestCase):
def _callFUT(self, **kw):
- from repoze.bfg.testing import tearDown
+ from pyramid.testing import tearDown
return tearDown(**kw)
def test_defaults(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
from zope.component import getSiteManager
registry = DummyRegistry()
old = {'registry':registry}
@@ -644,7 +644,7 @@ class Test_tearDown(unittest.TestCase):
manager.clear()
def test_registry_cannot_be_inited(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
registry = DummyRegistry()
def raiseit(name):
raise TypeError
@@ -660,7 +660,7 @@ class Test_tearDown(unittest.TestCase):
manager.clear()
def test_unhook_zc_false(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
from zope.component import getSiteManager
hook = lambda *arg: None
try:
@@ -674,7 +674,7 @@ class Test_tearDown(unittest.TestCase):
class TestDummyRendererFactory(unittest.TestCase):
def _makeOne(self, name, factory):
- from repoze.bfg.testing import DummyRendererFactory
+ from pyramid.testing import DummyRendererFactory
return DummyRendererFactory(name, factory)
def test_add_no_colon(self):
@@ -710,7 +710,7 @@ class TestDummyRendererFactory(unittest.TestCase):
class TestMockTemplate(unittest.TestCase):
def _makeOne(self, response):
- from repoze.bfg.testing import MockTemplate
+ from pyramid.testing import MockTemplate
return MockTemplate(response)
def test_getattr(self):
diff --git a/pyramid/tests/test_threadlocal.py b/pyramid/tests/test_threadlocal.py
index 6bb18c4ff..088156507 100644
--- a/pyramid/tests/test_threadlocal.py
+++ b/pyramid/tests/test_threadlocal.py
@@ -1,4 +1,4 @@
-from repoze.bfg import testing
+from pyramid import testing
import unittest
class TestThreadLocalManager(unittest.TestCase):
@@ -9,7 +9,7 @@ class TestThreadLocalManager(unittest.TestCase):
testing.tearDown()
def _getTargetClass(self):
- from repoze.bfg.threadlocal import ThreadLocalManager
+ from pyramid.threadlocal import ThreadLocalManager
return ThreadLocalManager
def _makeOne(self, default=lambda *x: 1):
@@ -48,7 +48,7 @@ class TestThreadLocalManager(unittest.TestCase):
class TestGetCurrentRequest(unittest.TestCase):
def _callFUT(self):
- from repoze.bfg.threadlocal import get_current_request
+ from pyramid.threadlocal import get_current_request
return get_current_request()
def test_it_None(self):
@@ -56,7 +56,7 @@ class TestGetCurrentRequest(unittest.TestCase):
self.assertEqual(request, None)
def test_it(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
request = object()
try:
manager.push({'request':request})
@@ -73,11 +73,11 @@ class GetCurrentRegistryTests(unittest.TestCase):
testing.tearDown()
def _callFUT(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
return get_current_registry()
def test_it(self):
- from repoze.bfg.threadlocal import manager
+ from pyramid.threadlocal import manager
try:
manager.push({'registry':123})
self.assertEqual(self._callFUT(), 123)
@@ -86,10 +86,10 @@ class GetCurrentRegistryTests(unittest.TestCase):
class GetCurrentRegistryWithoutTestingRegistry(unittest.TestCase):
def _callFUT(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
return get_current_registry()
def test_it(self):
- from repoze.bfg.registry import global_registry
+ from pyramid.registry import global_registry
self.assertEqual(self._callFUT(), global_registry)
diff --git a/pyramid/tests/test_traversal.py b/pyramid/tests/test_traversal.py
index 1cae0a05f..7083775a8 100644
--- a/pyramid/tests/test_traversal.py
+++ b/pyramid/tests/test_traversal.py
@@ -1,10 +1,10 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TraversalPathTests(unittest.TestCase):
def _callFUT(self, path):
- from repoze.bfg.traversal import traversal_path
+ from pyramid.traversal import traversal_path
return traversal_path(path)
def test_path_startswith_endswith(self):
@@ -43,7 +43,7 @@ class TraversalPathTests(unittest.TestCase):
self.assertEqual(self._callFUT(path), (decoded, decoded))
def test_utf16(self):
- from repoze.bfg.exceptions import URLDecodeError
+ from pyramid.exceptions import URLDecodeError
import urllib
la = unicode('La Pe\xc3\xb1a', 'utf-8').encode('utf-16')
encoded = urllib.quote(la)
@@ -70,7 +70,7 @@ class ModelGraphTraverserTests(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.traversal import ModelGraphTraverser
+ from pyramid.traversal import ModelGraphTraverser
return ModelGraphTraverser
def _makeOne(self, *arg, **kw):
@@ -84,12 +84,12 @@ class ModelGraphTraverserTests(unittest.TestCase):
def test_class_conforms_to_ITraverser(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
verifyClass(ITraverser, self._getTargetClass())
def test_instance_conforms_to_ITraverser(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
context = DummyContext()
verifyObject(ITraverser, self._makeOne(context))
@@ -259,7 +259,7 @@ class ModelGraphTraverserTests(unittest.TestCase):
policy = self._makeOne(root)
segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
environ = self._getEnviron(PATH_INFO='/%s' % segment)
- from repoze.bfg.exceptions import URLDecodeError
+ from pyramid.exceptions import URLDecodeError
self.assertRaises(URLDecodeError, policy, environ)
def test_non_utf8_path_segment_settings_unicode_path_segments_fails(self):
@@ -268,7 +268,7 @@ class ModelGraphTraverserTests(unittest.TestCase):
policy = self._makeOne(root)
segment = unicode('LaPe\xc3\xb1a', 'utf-8').encode('utf-16')
environ = self._getEnviron(PATH_INFO='/%s' % segment)
- from repoze.bfg.exceptions import URLDecodeError
+ from pyramid.exceptions import URLDecodeError
self.assertRaises(URLDecodeError, policy, environ)
def test_withroute_nothingfancy(self):
@@ -338,7 +338,7 @@ class ModelGraphTraverserTests(unittest.TestCase):
class FindInterfaceTests(unittest.TestCase):
def _callFUT(self, context, iface):
- from repoze.bfg.traversal import find_interface
+ from pyramid.traversal import find_interface
return find_interface(context, iface)
def test_it_interface(self):
@@ -383,7 +383,7 @@ class FindInterfaceTests(unittest.TestCase):
class FindRootTests(unittest.TestCase):
def _callFUT(self, context):
- from repoze.bfg.traversal import find_root
+ from pyramid.traversal import find_root
return find_root(context)
def test_it(self):
@@ -398,13 +398,13 @@ class FindRootTests(unittest.TestCase):
class FindModelTests(unittest.TestCase):
def _callFUT(self, context, name):
- from repoze.bfg.traversal import find_model
+ from pyramid.traversal import find_model
return find_model(context, name)
def _registerTraverser(self, traverser):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
from zope.interface import Interface
reg.registerAdapter(traverser, (Interface,), ITraverser)
@@ -525,7 +525,7 @@ class FindModelTests(unittest.TestCase):
class ModelPathTests(unittest.TestCase):
def _callFUT(self, model, *elements):
- from repoze.bfg.traversal import model_path
+ from pyramid.traversal import model_path
return model_path(model, *elements)
def test_it(self):
@@ -600,7 +600,7 @@ class ModelPathTests(unittest.TestCase):
class ModelPathTupleTests(unittest.TestCase):
def _callFUT(self, model, *elements):
- from repoze.bfg.traversal import model_path_tuple
+ from pyramid.traversal import model_path_tuple
return model_path_tuple(model, *elements)
def test_it(self):
@@ -652,7 +652,7 @@ class ModelPathTupleTests(unittest.TestCase):
class QuotePathSegmentTests(unittest.TestCase):
def _callFUT(self, s):
- from repoze.bfg.traversal import quote_path_segment
+ from pyramid.traversal import quote_path_segment
return quote_path_segment(s)
def test_unicode(self):
@@ -670,24 +670,24 @@ class TraversalContextURLTests(unittest.TestCase):
return self._getTargetClass()(context, url)
def _getTargetClass(self):
- from repoze.bfg.traversal import TraversalContextURL
+ from pyramid.traversal import TraversalContextURL
return TraversalContextURL
def _registerTraverser(self, traverser):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
from zope.interface import Interface
reg.registerAdapter(traverser, (Interface,), ITraverser)
def test_class_conforms_to_IContextURL(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IContextURL
+ from pyramid.interfaces import IContextURL
verifyClass(IContextURL, self._getTargetClass())
def test_instance_conforms_to_IContextURL(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IContextURL
+ from pyramid.interfaces import IContextURL
context = DummyContext()
request = DummyRequest()
verifyObject(IContextURL, self._makeOne(context, request))
@@ -736,7 +736,7 @@ class TraversalContextURLTests(unittest.TestCase):
'http://example.com:5432/La%20Pe%C3%B1a/La%20Pe%C3%B1a/')
def test_call_with_virtual_root_path(self):
- from repoze.bfg.interfaces import VH_ROOT_KEY
+ from pyramid.interfaces import VH_ROOT_KEY
root = DummyContext()
root.__parent__ = None
root.__name__ = None
@@ -776,7 +776,7 @@ class TraversalContextURLTests(unittest.TestCase):
self.assertEqual(context_url.virtual_root(), request.root)
def test_virtual_root_with_virtual_root_path(self):
- from repoze.bfg.interfaces import VH_ROOT_KEY
+ from pyramid.interfaces import VH_ROOT_KEY
context = DummyContext()
context.__parent__ = None
traversed_to = DummyContext()
@@ -811,11 +811,11 @@ class TestVirtualRoot(unittest.TestCase):
cleanUp()
def _callFUT(self, model, request):
- from repoze.bfg.traversal import virtual_root
+ from pyramid.traversal import virtual_root
return virtual_root(model, request)
def test_registered(self):
- from repoze.bfg.interfaces import IContextURL
+ from pyramid.interfaces import IContextURL
from zope.interface import Interface
request = _makeRequest()
request.registry.registerAdapter(DummyContextURL, (Interface,Interface),
@@ -847,18 +847,18 @@ class TraverseTests(unittest.TestCase):
cleanUp()
def _callFUT(self, context, name):
- from repoze.bfg.traversal import traverse
+ from pyramid.traversal import traverse
return traverse(context, name)
def _registerTraverser(self, traverser):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
- from repoze.bfg.interfaces import ITraverser
+ from pyramid.interfaces import ITraverser
from zope.interface import Interface
reg.registerAdapter(traverser, (Interface,), ITraverser)
def test_request_has_registry(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
model = DummyContext()
traverser = make_traverser({'context':model, 'view_name':''})
self._registerTraverser(traverser)
@@ -951,9 +951,9 @@ class TraverseTests(unittest.TestCase):
self.assertEqual(result['context'], model)
def test_requestfactory_overridden(self):
- from repoze.bfg.interfaces import IRequestFactory
- from repoze.bfg.request import Request
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.interfaces import IRequestFactory
+ from pyramid.request import Request
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
class MyRequest(Request):
pass
@@ -966,7 +966,7 @@ class TraverseTests(unittest.TestCase):
class TestDefaultRootFactory(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.traversal import DefaultRootFactory
+ from pyramid.traversal import DefaultRootFactory
return DefaultRootFactory
def _makeOne(self, environ):
@@ -1027,7 +1027,7 @@ class DummyContextURL:
return '123'
def _makeRequest(environ=None):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
request = DummyRequest()
request.registry = Registry()
return request
diff --git a/pyramid/tests/test_url.py b/pyramid/tests/test_url.py
index 1b6f7814c..332ff3f11 100644
--- a/pyramid/tests/test_url.py
+++ b/pyramid/tests/test_url.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class ModelURLTests(unittest.TestCase):
def setUp(self):
@@ -10,11 +10,11 @@ class ModelURLTests(unittest.TestCase):
cleanUp()
def _callFUT(self, model, request, *elements, **kw):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
return model_url(model, request, *elements, **kw)
def _registerContextURL(self, reg):
- from repoze.bfg.interfaces import IContextURL
+ from pyramid.interfaces import IContextURL
from zope.interface import Interface
class DummyContextURL(object):
def __init__(self, context, request):
@@ -128,7 +128,7 @@ class ModelURLTests(unittest.TestCase):
self.assertEqual(result, 'http://example.com:5432/')
def test_no_registry_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
request = DummyRequest()
self._registerContextURL(reg)
@@ -144,11 +144,11 @@ class TestRouteUrl(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.url import route_url
+ from pyramid.url import route_url
return route_url(*arg, **kw)
def test_with_elements(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
request = _makeRequest()
mapper = DummyRoutesMapper(route=DummyRoute('/1/2/3'))
request.registry.registerUtility(mapper, IRoutesMapper)
@@ -159,7 +159,7 @@ class TestRouteUrl(unittest.TestCase):
'http://example.com:5432/1/2/3/extra1/extra2?a=1#foo')
def test_no_elements(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
request = _makeRequest()
mapper = DummyRoutesMapper(route=DummyRoute('/1/2/3'))
request.registry.registerUtility(mapper, IRoutesMapper)
@@ -169,7 +169,7 @@ class TestRouteUrl(unittest.TestCase):
'http://example.com:5432/1/2/3?a=1#foo')
def test_it_generation_error(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
request = _makeRequest()
mapper = DummyRoutesMapper(raise_exc=KeyError)
request.registry.registerUtility(mapper, IRoutesMapper)
@@ -177,7 +177,7 @@ class TestRouteUrl(unittest.TestCase):
self.assertRaises(KeyError, self._callFUT, 'flub', request, a=1)
def test_generate_doesnt_receive_query_or_anchor(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
route = DummyRoute(result='')
mapper = DummyRoutesMapper(route=route)
from zope.component import getSiteManager
@@ -189,7 +189,7 @@ class TestRouteUrl(unittest.TestCase):
self.assertEqual(result, 'http://example.com:5432?name=some_name')
def test_with_app_url(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
request = _makeRequest()
mapper = DummyRoutesMapper(route=DummyRoute(result='/1/2/3'))
request.registry.registerUtility(mapper, IRoutesMapper)
@@ -197,7 +197,7 @@ class TestRouteUrl(unittest.TestCase):
self.assertEqual(result, 'http://example2.com/1/2/3')
def test_with_pregenerator(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
request = _makeRequest()
route = DummyRoute(result='/1/2/3')
def pregenerator(request, elements, kw):
@@ -217,7 +217,7 @@ class TestStaticUrl(unittest.TestCase):
cleanUp()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.url import static_url
+ from pyramid.url import static_url
return static_url(*arg, **kw)
def test_staticurlinfo_notfound(self):
@@ -229,36 +229,36 @@ class TestStaticUrl(unittest.TestCase):
self.assertRaises(ValueError, self._callFUT, '/static/foo.css', request)
def test_found_rel(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
request = _makeRequest()
info = DummyStaticURLInfo('abc')
request.registry.registerUtility(info, IStaticURLInfo)
result = self._callFUT('static/foo.css', request)
self.assertEqual(result, 'abc')
self.assertEqual(info.args,
- ('repoze.bfg.tests:static/foo.css', request, {}) )
+ ('pyramid.tests:static/foo.css', request, {}) )
def test_found_abs(self):
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.interfaces import IStaticURLInfo
request = _makeRequest()
info = DummyStaticURLInfo('abc')
request.registry.registerUtility(info, IStaticURLInfo)
- result = self._callFUT('repoze.bfg.tests:static/foo.css', request)
+ result = self._callFUT('pyramid.tests:static/foo.css', request)
self.assertEqual(result, 'abc')
self.assertEqual(info.args,
- ('repoze.bfg.tests:static/foo.css', request, {}) )
+ ('pyramid.tests:static/foo.css', request, {}) )
def test_found_abs_no_registry_on_request(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IStaticURLInfo
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IStaticURLInfo
request = DummyRequest()
registry = get_current_registry()
info = DummyStaticURLInfo('abc')
registry.registerUtility(info, IStaticURLInfo)
- result = self._callFUT('repoze.bfg.tests:static/foo.css', request)
+ result = self._callFUT('pyramid.tests:static/foo.css', request)
self.assertEqual(result, 'abc')
self.assertEqual(info.args,
- ('repoze.bfg.tests:static/foo.css', request, {}) )
+ ('pyramid.tests:static/foo.css', request, {}) )
class DummyContext(object):
def __init__(self, next=None):
@@ -289,7 +289,7 @@ class DummyRoute:
return self.result
def _makeRequest(environ=None):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
request = DummyRequest(environ)
request.registry = Registry()
return request
diff --git a/pyramid/tests/test_urldispatch.py b/pyramid/tests/test_urldispatch.py
index bf43750ea..799f4986f 100644
--- a/pyramid/tests/test_urldispatch.py
+++ b/pyramid/tests/test_urldispatch.py
@@ -1,16 +1,16 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class TestRoute(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.urldispatch import Route
+ from pyramid.urldispatch import Route
return Route
def _makeOne(self, *arg):
return self._getTargetClass()(*arg)
def test_provides_IRoute(self):
- from repoze.bfg.interfaces import IRoute
+ from pyramid.interfaces import IRoute
from zope.interface.verify import verifyObject
verifyObject(IRoute, self._makeOne('name', 'pattern'))
@@ -50,7 +50,7 @@ class RoutesMapperTests(unittest.TestCase):
testing.tearDown()
def _getRequest(self, **kw):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
environ = {'SERVER_NAME':'localhost',
'wsgi.url_scheme':'http'}
environ.update(kw)
@@ -60,7 +60,7 @@ class RoutesMapperTests(unittest.TestCase):
return request
def _getTargetClass(self):
- from repoze.bfg.urldispatch import RoutesMapper
+ from pyramid.urldispatch import RoutesMapper
return RoutesMapper
def _makeOne(self):
@@ -68,7 +68,7 @@ class RoutesMapperTests(unittest.TestCase):
return klass()
def test_provides_IRoutesMapper(self):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
from zope.interface.verify import verifyObject
verifyObject(IRoutesMapper, self._makeOne())
@@ -190,7 +190,7 @@ class RoutesMapperTests(unittest.TestCase):
self.assertEqual(mapper.has_routes(), True)
def test_get_routes(self):
- from repoze.bfg.urldispatch import Route
+ from pyramid.urldispatch import Route
mapper = self._makeOne()
self.assertEqual(mapper.get_routes(), [])
mapper.connect('whatever', 'archives/:action/:article')
@@ -219,7 +219,7 @@ class RoutesMapperTests(unittest.TestCase):
class TestCompileRoute(unittest.TestCase):
def _callFUT(self, pattern):
- from repoze.bfg.urldispatch import _compile_route
+ from pyramid.urldispatch import _compile_route
return _compile_route(pattern)
def test_no_star(self):
@@ -248,19 +248,19 @@ class TestCompileRoute(unittest.TestCase):
self.assertEqual(generator({'baz':1, 'buz':2}), '/foo/1/biz/2/bar')
def test_url_decode_error(self):
- from repoze.bfg.exceptions import URLDecodeError
+ from pyramid.exceptions import URLDecodeError
matcher, generator = self._callFUT('/:foo')
self.assertRaises(URLDecodeError, matcher, '/%FF%FE%8B%00')
class TestCompileRouteMatchFunctional(unittest.TestCase):
def matches(self, pattern, path, expected):
- from repoze.bfg.urldispatch import _compile_route
+ from pyramid.urldispatch import _compile_route
matcher = _compile_route(pattern)[0]
result = matcher(path)
self.assertEqual(result, expected)
def generates(self, pattern, dict, result):
- from repoze.bfg.urldispatch import _compile_route
+ from pyramid.urldispatch import _compile_route
self.assertEqual(_compile_route(pattern)[1](dict), result)
def test_matcher_functional(self):
diff --git a/pyramid/tests/test_view.py b/pyramid/tests/test_view.py
index e5adc8de1..095ece18e 100644
--- a/pyramid/tests/test_view.py
+++ b/pyramid/tests/test_view.py
@@ -1,7 +1,7 @@
import unittest
import sys
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class BaseTest(object):
def setUp(self):
@@ -11,10 +11,10 @@ class BaseTest(object):
cleanUp()
def _registerView(self, reg, app, name):
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IViewClassifier
for_ = (IViewClassifier, IRequest, IContext)
- from repoze.bfg.interfaces import IView
+ from pyramid.interfaces import IView
reg.registerAdapter(app, for_, IView, name)
def _makeEnviron(self, **extras):
@@ -29,10 +29,10 @@ class BaseTest(object):
return environ
def _makeRequest(self, **environ):
- from repoze.bfg.interfaces import IRequest
+ from pyramid.interfaces import IRequest
from zope.interface import directlyProvides
from webob import Request
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
environ = self._makeEnviron(**environ)
request = Request(environ)
request.registry = Registry()
@@ -48,7 +48,7 @@ class BaseTest(object):
class RenderViewToResponseTests(BaseTest, unittest.TestCase):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.view import render_view_to_response
+ from pyramid.view import render_view_to_response
return render_view_to_response(*arg, **kw)
def test_call_no_view_registered(self):
@@ -100,7 +100,7 @@ class RenderViewToResponseTests(BaseTest, unittest.TestCase):
class RenderViewToIterableTests(BaseTest, unittest.TestCase):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.view import render_view_to_iterable
+ from pyramid.view import render_view_to_iterable
return render_view_to_iterable(*arg, **kw)
def test_call_no_view_registered(self):
@@ -144,7 +144,7 @@ class RenderViewToIterableTests(BaseTest, unittest.TestCase):
class RenderViewTests(BaseTest, unittest.TestCase):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.view import render_view
+ from pyramid.view import render_view
return render_view(*arg, **kw)
def test_call_no_view_registered(self):
@@ -185,7 +185,7 @@ class RenderViewTests(BaseTest, unittest.TestCase):
class TestIsResponse(unittest.TestCase):
def _callFUT(self, *arg, **kw):
- from repoze.bfg.view import is_response
+ from pyramid.view import is_response
return is_response(*arg, **kw)
def test_is(self):
@@ -214,7 +214,7 @@ class TestBFGViewDecorator(unittest.TestCase):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.view import bfg_view
+ from pyramid.view import bfg_view
return bfg_view
def _makeOne(self, *arg, **kw):
@@ -327,11 +327,11 @@ class TestBFGViewDecorator(unittest.TestCase):
settings = call_venusian(venusian)
self.assertEqual(len(settings), 1)
self.assertEqual(settings[0]['renderer'],
- 'repoze.bfg.tests:fixtures/minimal.pt')
+ 'pyramid.tests:fixtures/minimal.pt')
def test_call_with_renderer_pkgpath(self):
decorator = self._makeOne(
- renderer='repoze.bfg.tests:fixtures/minimal.pt')
+ renderer='pyramid.tests:fixtures/minimal.pt')
venusian = DummyVenusian()
decorator.venusian = venusian
def foo(): pass
@@ -340,15 +340,15 @@ class TestBFGViewDecorator(unittest.TestCase):
settings = call_venusian(venusian)
self.assertEqual(len(settings), 1)
self.assertEqual(settings[0]['renderer'],
- 'repoze.bfg.tests:fixtures/minimal.pt')
+ 'pyramid.tests:fixtures/minimal.pt')
class Test_append_slash_notfound_view(BaseTest, unittest.TestCase):
def _callFUT(self, context, request):
- from repoze.bfg.view import append_slash_notfound_view
+ from pyramid.view import append_slash_notfound_view
return append_slash_notfound_view(context, request)
def _registerMapper(self, reg, match=True):
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.interfaces import IRoutesMapper
class DummyRoute(object):
def __init__(self, val):
self.val = val
@@ -401,7 +401,7 @@ class Test_append_slash_notfound_view(BaseTest, unittest.TestCase):
class TestAppendSlashNotFoundViewFactory(BaseTest, unittest.TestCase):
def _makeOne(self, notfound_view):
- from repoze.bfg.view import AppendSlashNotFoundViewFactory
+ from pyramid.view import AppendSlashNotFoundViewFactory
return AppendSlashNotFoundViewFactory(notfound_view)
def test_custom_notfound_view(self):
@@ -415,7 +415,7 @@ class TestAppendSlashNotFoundViewFactory(BaseTest, unittest.TestCase):
class Test_default_exceptionresponse_view(unittest.TestCase):
def _callFUT(self, context, request):
- from repoze.bfg.view import default_exceptionresponse_view
+ from pyramid.view import default_exceptionresponse_view
return default_exceptionresponse_view(context, request)
def test_is_exception(self):
@@ -467,7 +467,7 @@ class IContext(Interface):
class DummyVenusianInfo(object):
scope = 'notaclass'
- module = sys.modules['repoze.bfg.tests']
+ module = sys.modules['pyramid.tests']
class DummyVenusian(object):
def __init__(self, info=None):
diff --git a/pyramid/tests/test_wsgi.py b/pyramid/tests/test_wsgi.py
index 5d3ec1faa..f1bc2f35c 100644
--- a/pyramid/tests/test_wsgi.py
+++ b/pyramid/tests/test_wsgi.py
@@ -2,7 +2,7 @@ import unittest
class WSGIAppTests(unittest.TestCase):
def _callFUT(self, app):
- from repoze.bfg.wsgi import wsgiapp
+ from pyramid.wsgi import wsgiapp
return wsgiapp(app)
def test_decorator(self):
@@ -14,7 +14,7 @@ class WSGIAppTests(unittest.TestCase):
class WSGIApp2Tests(unittest.TestCase):
def _callFUT(self, app):
- from repoze.bfg.wsgi import wsgiapp2
+ from pyramid.wsgi import wsgiapp2
return wsgiapp2(app)
def test_decorator_with_subpath_and_view_name(self):
diff --git a/pyramid/tests/test_zcml.py b/pyramid/tests/test_zcml.py
index 131122d7b..9ceec9953 100644
--- a/pyramid/tests/test_zcml.py
+++ b/pyramid/tests/test_zcml.py
@@ -4,7 +4,7 @@ logging.basicConfig()
import unittest
-from repoze.bfg import testing
+from pyramid import testing
from zope.interface import Interface
from zope.interface import implements
@@ -17,14 +17,14 @@ class TestViewDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import view
+ from pyramid.zcml import view
return view(*arg, **kw)
def test_request_type_ashttpmethod(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
context = DummyContext()
view = lambda *arg: None
self._callFUT(context, 'repoze.view', IDummy, view=view,
@@ -48,10 +48,10 @@ class TestViewDirective(unittest.TestCase):
def test_request_type_asinterfacestring(self):
from zope.interface import directlyProvides
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
context = DummyContext(IDummy)
view = lambda *arg: 'OK'
self._callFUT(context, 'repoze.view', IDummy, view=view,
@@ -74,7 +74,7 @@ class TestViewDirective(unittest.TestCase):
self.failIf(hasattr(view, '__call_permissive__'))
def test_request_type_asnoninterfacestring(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
context = DummyContext('notaninterface')
view = lambda *arg: 'OK'
self.assertRaises(ConfigurationError,
@@ -83,11 +83,11 @@ class TestViewDirective(unittest.TestCase):
request_type='whatever')
def test_with_dotted_renderer(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRendererFactory
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRendererFactory
+ from pyramid.interfaces import IRequest
context = DummyContext()
reg = get_current_registry()
def factory(path):
@@ -110,10 +110,10 @@ class TestViewDirective(unittest.TestCase):
self.assertEqual(regview(None, None).body, 'OK')
def test_with_custom_predicates(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
context = DummyContext()
reg = get_current_registry()
view = lambda *arg: 'OK'
@@ -137,10 +137,10 @@ class TestViewDirective(unittest.TestCase):
self.assertEqual(regview(None, None), 'OK')
def test_context_trumps_for(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
context = DummyContext()
reg = get_current_registry()
view = lambda *arg: 'OK'
@@ -160,10 +160,10 @@ class TestViewDirective(unittest.TestCase):
self.assertEqual(regview(None, None), 'OK')
def test_with_for(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRequest
context = DummyContext()
reg = get_current_registry()
view = lambda *arg: 'OK'
@@ -189,16 +189,16 @@ class TestNotFoundDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, view, **kw):
- from repoze.bfg.zcml import notfound
+ from pyramid.zcml import notfound
return notfound(context, view, **kw)
def test_it(self):
from zope.interface import implementedBy
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.exceptions import NotFound
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.exceptions import NotFound
context = DummyContext()
def view(request):
@@ -224,12 +224,12 @@ class TestNotFoundDirective(unittest.TestCase):
def test_it_with_dotted_renderer(self):
from zope.interface import implementedBy
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.exceptions import NotFound
- from repoze.bfg.configuration import Configurator
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.exceptions import NotFound
+ from pyramid.configuration import Configurator
context = DummyContext()
reg = get_current_registry()
config = Configurator(reg)
@@ -258,16 +258,16 @@ class TestForbiddenDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, view, **kw):
- from repoze.bfg.zcml import forbidden
+ from pyramid.zcml import forbidden
return forbidden(context, view, **kw)
def test_it(self):
from zope.interface import implementedBy
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.exceptions import Forbidden
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.exceptions import Forbidden
context = DummyContext()
def view(request):
return 'OK'
@@ -293,12 +293,12 @@ class TestForbiddenDirective(unittest.TestCase):
def test_it_with_dotted_renderer(self):
from zope.interface import implementedBy
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRequest
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.exceptions import Forbidden
- from repoze.bfg.configuration import Configurator
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.exceptions import Forbidden
+ from pyramid.configuration import Configurator
context = DummyContext()
reg = get_current_registry()
config = Configurator(reg)
@@ -327,13 +327,13 @@ class TestRepozeWho1AuthenticationPolicyDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, **kw):
- from repoze.bfg.zcml import repozewho1authenticationpolicy
+ from pyramid.zcml import repozewho1authenticationpolicy
return repozewho1authenticationpolicy(context, **kw)
def test_it_defaults(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
context = DummyContext()
self._callFUT(context)
actions = context.actions
@@ -347,9 +347,9 @@ class TestRepozeWho1AuthenticationPolicyDirective(unittest.TestCase):
self.assertEqual(policy.identifier_name, 'auth_tkt')
def test_it(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
context = DummyContext()
def callback(identity, request):
""" """
@@ -372,12 +372,12 @@ class TestRemoteUserAuthenticationPolicyDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, **kw):
- from repoze.bfg.zcml import remoteuserauthenticationpolicy
+ from pyramid.zcml import remoteuserauthenticationpolicy
return remoteuserauthenticationpolicy(context, **kw)
def test_defaults(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
context = DummyContext()
def callback(identity, request):
@@ -394,8 +394,8 @@ class TestRemoteUserAuthenticationPolicyDirective(unittest.TestCase):
self.assertEqual(policy.callback, None)
def test_it(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.threadlocal import get_current_registry
context = DummyContext()
def callback(identity, request):
""" """
@@ -419,12 +419,12 @@ class TestAuthTktAuthenticationPolicyDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, secret, **kw):
- from repoze.bfg.zcml import authtktauthenticationpolicy
+ from pyramid.zcml import authtktauthenticationpolicy
return authtktauthenticationpolicy(context, secret, **kw)
def test_it_defaults(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
context = DummyContext()
self._callFUT(context, 'sosecret')
@@ -439,8 +439,8 @@ class TestAuthTktAuthenticationPolicyDirective(unittest.TestCase):
self.assertEqual(policy.callback, None)
def test_it_noconfigerror(self):
- from repoze.bfg.interfaces import IAuthenticationPolicy
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.interfaces import IAuthenticationPolicy
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
context = DummyContext()
def callback(identity, request):
@@ -462,7 +462,7 @@ class TestAuthTktAuthenticationPolicyDirective(unittest.TestCase):
self.assertEqual(policy.callback, callback)
def test_it_configerror(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
context = DummyContext()
def callback(identity, request):
""" """
@@ -482,13 +482,13 @@ class TestACLAuthorizationPolicyDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, **kw):
- from repoze.bfg.zcml import aclauthorizationpolicy
+ from pyramid.zcml import aclauthorizationpolicy
return aclauthorizationpolicy(context, **kw)
def test_it(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.authorization import ACLAuthorizationPolicy
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.authorization import ACLAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
reg = get_current_registry()
context = DummyContext()
def callback(identity, request):
@@ -511,12 +511,12 @@ class TestRouteDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import route
+ from pyramid.zcml import route
return route(*arg, **kw)
def _assertRoute(self, name, pattern, num_predicates=0):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRoutesMapper
reg = get_current_registry()
mapper = reg.getUtility(IRoutesMapper)
routes = mapper.get_routes()
@@ -528,11 +528,11 @@ class TestRouteDirective(unittest.TestCase):
return route
def test_with_view(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
from zope.interface import Interface
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRouteRequest
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRouteRequest
context = DummyContext()
view = lambda *arg: 'OK'
self._callFUT(context, 'name', 'pattern', view=view)
@@ -557,10 +557,10 @@ class TestRouteDirective(unittest.TestCase):
self.failUnless(wrapped)
def test_with_view_and_view_context(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRouteRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRouteRequest
context = DummyContext()
view = lambda *arg: 'OK'
self._callFUT(context, 'name', 'pattern', view=view,
@@ -586,10 +586,10 @@ class TestRouteDirective(unittest.TestCase):
self.failUnless(wrapped)
def test_with_view_context_trumps_view_for(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRouteRequest
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRouteRequest
context = DummyContext()
view = lambda *arg: 'OK'
class Foo:
@@ -618,12 +618,12 @@ class TestRouteDirective(unittest.TestCase):
def test_with_dotted_renderer(self):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
from zope.interface import Interface
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRouteRequest
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRouteRequest
+ from pyramid.interfaces import IRendererFactory
reg = get_current_registry()
def renderer(path):
return lambda *arg: 'OK'
@@ -702,7 +702,7 @@ class TestRouteDirective(unittest.TestCase):
def test_with_neither_path_nor_pattern(self):
- from repoze.bfg.exceptions import ConfigurationError
+ from pyramid.exceptions import ConfigurationError
context = DummyContext()
self.assertRaises(ConfigurationError, self._callFUT, context, 'name')
@@ -714,18 +714,18 @@ class TestStaticDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import static
+ from pyramid.zcml import static
return static(*arg, **kw)
def test_it_with_slash(self):
- from repoze.bfg.static import PackageURLParser
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.static import PackageURLParser
+ from pyramid.threadlocal import get_current_registry
from zope.interface import implementedBy
- from repoze.bfg.static import StaticURLInfo
- from repoze.bfg.interfaces import IView
- from repoze.bfg.interfaces import IViewClassifier
- from repoze.bfg.interfaces import IRouteRequest
- from repoze.bfg.interfaces import IRoutesMapper
+ from pyramid.static import StaticURLInfo
+ from pyramid.interfaces import IView
+ from pyramid.interfaces import IViewClassifier
+ from pyramid.interfaces import IRouteRequest
+ from pyramid.interfaces import IRoutesMapper
context = DummyContext()
self._callFUT(context, 'name', 'fixtures/static')
actions = context.actions
@@ -762,11 +762,11 @@ class TestResourceDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import resource
+ from pyramid.zcml import resource
return resource(*arg, **kw)
def test_it(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
context = DummyContext()
self._callFUT(context, 'a', 'b')
actions = context.actions
@@ -786,12 +786,12 @@ class TestRendererDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import renderer
+ from pyramid.zcml import renderer
return renderer(*arg, **kw)
def test_it(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IRendererFactory
context = DummyContext()
renderer = lambda *arg, **kw: None
self._callFUT(context, renderer, 'r')
@@ -805,7 +805,7 @@ class TestRendererDirective(unittest.TestCase):
class TestZCMLConfigure(unittest.TestCase):
i = 0
def _callFUT(self, path, package):
- from repoze.bfg.zcml import zcml_configure
+ from pyramid.zcml import zcml_configure
return zcml_configure(path, package)
def setUp(self):
@@ -814,8 +814,8 @@ class TestZCMLConfigure(unittest.TestCase):
import sys
import os
import tempfile
- from repoze.bfg.path import package_path
- from repoze.bfg.tests import fixtureapp as package
+ from pyramid.path import package_path
+ from pyramid.tests import fixtureapp as package
import shutil
tempdir = tempfile.mkdtemp()
modname = 'myfixture%s' % self.i
@@ -856,11 +856,11 @@ class TestZCMLScanDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, package):
- from repoze.bfg.zcml import scan
+ from pyramid.zcml import scan
return scan(context, package)
def test_it(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
dummy_module = DummyModule()
context = DummyContext()
self._callFUT(context, dummy_module)
@@ -879,7 +879,7 @@ class TestAdapterDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import adapter
+ from pyramid.zcml import adapter
return adapter(*arg, **kw)
def test_for_is_None_no_adaptedBy(self):
@@ -896,7 +896,7 @@ class TestAdapterDirective(unittest.TestCase):
provides=None, for_=None)
def test_for_is_None_adaptedBy_set(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
factory = DummyFactory()
factory.__component_adapts__ = (IDummy,)
@@ -917,7 +917,7 @@ class TestAdapterDirective(unittest.TestCase):
provides=None, for_=(IDummy,))
def test_provides_obtained_via_implementedBy(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
self._callFUT(context, [DummyFactory], for_=(IDummy,))
regadapt = context.actions[0]
@@ -944,7 +944,7 @@ class TestAdapterDirective(unittest.TestCase):
for_=(IDummy, IDummy))
def test_rolled_up_factories(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
factory = DummyFactory()
self._callFUT(context,
@@ -956,7 +956,7 @@ class TestAdapterDirective(unittest.TestCase):
('adapter', (IDummy,), IFactory, ''))
self.assertEqual(regadapt['callable'].im_func,
Registry.registerAdapter.im_func)
- self.assertEqual(regadapt['args'][0].__module__, 'repoze.bfg.zcml')
+ self.assertEqual(regadapt['args'][0].__module__, 'pyramid.zcml')
class TestSubscriberDirective(unittest.TestCase):
def setUp(self):
@@ -966,7 +966,7 @@ class TestSubscriberDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import subscriber
+ from pyramid.zcml import subscriber
return subscriber(*arg, **kw)
def test_no_factory_no_handler(self):
@@ -1002,7 +1002,7 @@ class TestSubscriberDirective(unittest.TestCase):
factory=factory, handler=None, provides=IFactory)
def test_register_with_factory(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
factory = DummyFactory()
self._callFUT(context, for_=(IDummy,),
@@ -1016,7 +1016,7 @@ class TestSubscriberDirective(unittest.TestCase):
(factory, (IDummy,), IFactory, None, None) )
def test_register_with_handler(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
context = DummyContext()
factory = DummyFactory()
self._callFUT(context, for_=(IDummy,),
@@ -1036,7 +1036,7 @@ class TestUtilityDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import utility
+ from pyramid.zcml import utility
return utility(*arg, **kw)
def test_factory_and_component(self):
@@ -1049,7 +1049,7 @@ class TestUtilityDirective(unittest.TestCase):
self.assertRaises(TypeError, self._callFUT, context, provides=None)
def test_provides_from_factory_implements(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
self._callFUT(context, factory=DummyFactory)
self.assertEqual(len(context.actions), 1)
@@ -1061,7 +1061,7 @@ class TestUtilityDirective(unittest.TestCase):
self.assertEqual(utility['kw'], {'factory':DummyFactory})
def test_provides_from_component_provides(self):
- from repoze.bfg.registry import Registry
+ from pyramid.registry import Registry
context = DummyContext()
component = DummyFactory()
self._callFUT(context, component=component)
@@ -1081,13 +1081,13 @@ class TestTranslationDirDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import translationdir
+ from pyramid.zcml import translationdir
return translationdir(*arg, **kw)
def test_it(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
context = DummyContext()
- tdir = 'repoze.bfg.tests.localeapp:locale'
+ tdir = 'pyramid.tests.localeapp:locale'
self._callFUT(context, tdir)
actions = context.actions
self.assertEqual(len(actions), 1)
@@ -1106,11 +1106,11 @@ class TestLocaleNegotiatorDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, *arg, **kw):
- from repoze.bfg.zcml import localenegotiator
+ from pyramid.zcml import localenegotiator
return localenegotiator(*arg, **kw)
def test_it(self):
- from repoze.bfg.configuration import Configurator
+ from pyramid.configuration import Configurator
context = DummyContext()
dummy_negotiator = object()
self._callFUT(context, dummy_negotiator)
@@ -1131,12 +1131,12 @@ class TestDefaultPermissionDirective(unittest.TestCase):
testing.tearDown()
def _callFUT(self, context, name):
- from repoze.bfg.zcml import default_permission
+ from pyramid.zcml import default_permission
return default_permission(context, name)
def test_it(self):
- from repoze.bfg.threadlocal import get_current_registry
- from repoze.bfg.interfaces import IDefaultPermission
+ from pyramid.threadlocal import get_current_registry
+ from pyramid.interfaces import IDefaultPermission
reg = get_current_registry()
context = DummyContext()
self._callFUT(context, 'view')
@@ -1156,12 +1156,12 @@ class TestLoadZCML(unittest.TestCase):
def test_it(self):
from zope.configuration import xmlconfig
- import repoze.bfg.includes
- xmlconfig.file('configure.zcml', package=repoze.bfg.includes)
+ import pyramid.includes
+ xmlconfig.file('configure.zcml', package=pyramid.includes)
class TestRolledUpFactory(unittest.TestCase):
def _callFUT(self, *factories):
- from repoze.bfg.zcml import _rolledUpFactory
+ from pyramid.zcml import _rolledUpFactory
return _rolledUpFactory(factories)
def test_it(self):
@@ -1173,7 +1173,7 @@ class TestRolledUpFactory(unittest.TestCase):
class Test_path_spec(unittest.TestCase):
def _callFUT(self, context, path):
- from repoze.bfg.zcml import path_spec
+ from pyramid.zcml import path_spec
return path_spec(context, path)
def test_no_package_attr(self):
@@ -1191,7 +1191,7 @@ class Test_path_spec(unittest.TestCase):
def test_package_path_doesnt_start_with_abspath(self):
context = DummyContext()
- context.package = DummyPackage('repoze.bfg.tests')
+ context.package = DummyPackage('pyramid.tests')
path = '/thepath'
result = self._callFUT(context, path)
self.assertEqual(result, path)
@@ -1200,12 +1200,12 @@ class Test_path_spec(unittest.TestCase):
import pkg_resources
import os
context = DummyContext()
- package = DummyPackage('repoze.bfg.tests')
- package_path = pkg_resources.resource_filename('repoze.bfg.tests', '')
+ package = DummyPackage('pyramid.tests')
+ package_path = pkg_resources.resource_filename('pyramid.tests', '')
template_path = os.path.join(package_path, 'templates/foo.pt')
context.package = package
result = self._callFUT(context, template_path)
- self.assertEqual(result, 'repoze.bfg.tests:templates/foo.pt')
+ self.assertEqual(result, 'pyramid.tests:templates/foo.pt')
def test_package_name_is___main__(self):
context = DummyContext()
@@ -1216,8 +1216,8 @@ class Test_path_spec(unittest.TestCase):
def test_path_is_already_resource_spec(self):
context = DummyContext()
- result = self._callFUT(context, 'repoze.bfg.tests:foo.pt')
- self.assertEqual(result, 'repoze.bfg.tests:foo.pt')
+ result = self._callFUT(context, 'pyramid.tests:foo.pt')
+ self.assertEqual(result, 'pyramid.tests:foo.pt')
class IDummy(Interface):
pass
diff --git a/pyramid/tests/viewdecoratorapp/configure.zcml b/pyramid/tests/viewdecoratorapp/configure.zcml
index 6867046df..34b81285d 100644
--- a/pyramid/tests/viewdecoratorapp/configure.zcml
+++ b/pyramid/tests/viewdecoratorapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<scan package="."/>
</configure>
diff --git a/pyramid/tests/viewdecoratorapp/views/views.py b/pyramid/tests/viewdecoratorapp/views/views.py
index 29f8c7fd4..15b3e63c3 100644
--- a/pyramid/tests/viewdecoratorapp/views/views.py
+++ b/pyramid/tests/viewdecoratorapp/views/views.py
@@ -1,11 +1,11 @@
import os
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(renderer='templates/foo.pt', name='first')
def first(request):
return {'result':'OK1'}
-@bfg_view(renderer='repoze.bfg.tests.viewdecoratorapp.views:templates/foo.pt',
+@bfg_view(renderer='pyramid.tests.viewdecoratorapp.views:templates/foo.pt',
name='second')
def second(request):
return {'result':'OK2'}
diff --git a/pyramid/threadlocal.py b/pyramid/threadlocal.py
index 631cca62a..f08057453 100644
--- a/pyramid/threadlocal.py
+++ b/pyramid/threadlocal.py
@@ -1,6 +1,6 @@
import threading
-from repoze.bfg.registry import global_registry
+from pyramid.registry import global_registry
class ThreadLocalManager(threading.local):
def __init__(self, default=None):
diff --git a/pyramid/traversal.py b/pyramid/traversal.py
index 84365e2ff..03c7292cf 100644
--- a/pyramid/traversal.py
+++ b/pyramid/traversal.py
@@ -5,16 +5,16 @@ from zope.interface.interfaces import IInterface
from repoze.lru import lru_cache
-from repoze.bfg.interfaces import IContextURL
-from repoze.bfg.interfaces import IRequestFactory
-from repoze.bfg.interfaces import ITraverser
-from repoze.bfg.interfaces import VH_ROOT_KEY
-
-from repoze.bfg.encode import url_quote
-from repoze.bfg.exceptions import URLDecodeError
-from repoze.bfg.location import lineage
-from repoze.bfg.request import Request
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.interfaces import IContextURL
+from pyramid.interfaces import IRequestFactory
+from pyramid.interfaces import ITraverser
+from pyramid.interfaces import VH_ROOT_KEY
+
+from pyramid.encode import url_quote
+from pyramid.exceptions import URLDecodeError
+from pyramid.location import lineage
+from pyramid.request import Request
+from pyramid.threadlocal import get_current_registry
def find_root(model):
""" Find the root node in the graph to which ``model``
diff --git a/pyramid/url.py b/pyramid/url.py
index d1532f7ef..8dca12c0c 100644
--- a/pyramid/url.py
+++ b/pyramid/url.py
@@ -4,15 +4,15 @@ import os
from repoze.lru import lru_cache
-from repoze.bfg.interfaces import IContextURL
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import IStaticURLInfo
-
-from repoze.bfg.encode import urlencode
-from repoze.bfg.path import caller_package
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.traversal import TraversalContextURL
-from repoze.bfg.traversal import quote_path_segment
+from pyramid.interfaces import IContextURL
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import IStaticURLInfo
+
+from pyramid.encode import urlencode
+from pyramid.path import caller_package
+from pyramid.threadlocal import get_current_registry
+from pyramid.traversal import TraversalContextURL
+from pyramid.traversal import quote_path_segment
def route_url(route_name, request, *elements, **kw):
"""Generates a fully qualified URL for a named :mod:`repoze.bfg`
diff --git a/pyramid/urldispatch.py b/pyramid/urldispatch.py
index 8aca2c421..aa0bddfe9 100644
--- a/pyramid/urldispatch.py
+++ b/pyramid/urldispatch.py
@@ -2,14 +2,14 @@ import re
from urllib import unquote
from zope.interface import implements
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import IRoute
-
-from repoze.bfg.compat import all
-from repoze.bfg.encode import url_quote
-from repoze.bfg.exceptions import URLDecodeError
-from repoze.bfg.traversal import traversal_path
-from repoze.bfg.traversal import quote_path_segment
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import IRoute
+
+from pyramid.compat import all
+from pyramid.encode import url_quote
+from pyramid.exceptions import URLDecodeError
+from pyramid.traversal import traversal_path
+from pyramid.traversal import quote_path_segment
_marker = object()
diff --git a/pyramid/view.py b/pyramid/view.py
index c5fd60623..fb4e21b41 100644
--- a/pyramid/view.py
+++ b/pyramid/view.py
@@ -18,17 +18,17 @@ import venusian
from zope.deprecation import deprecated
from zope.interface import providedBy
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
-from repoze.bfg.path import package_path
-from repoze.bfg.resource import resource_spec_from_abspath
-from repoze.bfg.static import static_view as static # B/C
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.path import package_path
+from pyramid.resource import resource_spec_from_abspath
+from pyramid.static import static_view as static # B/C
+from pyramid.threadlocal import get_current_registry
# b/c imports
-from repoze.bfg.security import view_execution_permitted
+from pyramid.security import view_execution_permitted
view_execution_permitted # prevent PyFlakes from complaining
diff --git a/pyramid/wsgi.py b/pyramid/wsgi.py
index c576253b3..152e3a72b 100644
--- a/pyramid/wsgi.py
+++ b/pyramid/wsgi.py
@@ -1,5 +1,5 @@
-from repoze.bfg.compat import wraps
-from repoze.bfg.traversal import quote_path_segment
+from pyramid.compat import wraps
+from pyramid.traversal import quote_path_segment
def wsgiapp(wrapped):
""" Decorator to turn a WSGI application into a :mod:`repoze.bfg`
diff --git a/pyramid/zcml.py b/pyramid/zcml.py
index 2bf394eb8..561beb857 100644
--- a/pyramid/zcml.py
+++ b/pyramid/zcml.py
@@ -16,25 +16,25 @@ from zope.schema import Bool
from zope.schema import Int
from zope.schema import TextLine
-from repoze.bfg.interfaces import IAuthenticationPolicy
-from repoze.bfg.interfaces import IAuthorizationPolicy
-from repoze.bfg.interfaces import IDefaultPermission
-from repoze.bfg.interfaces import IRendererFactory
-from repoze.bfg.interfaces import IRouteRequest
-from repoze.bfg.interfaces import IView
-
-from repoze.bfg.authentication import AuthTktAuthenticationPolicy
-from repoze.bfg.authentication import RemoteUserAuthenticationPolicy
-from repoze.bfg.authentication import RepozeWho1AuthenticationPolicy
-from repoze.bfg.authorization import ACLAuthorizationPolicy
-from repoze.bfg.configuration import Configurator
-from repoze.bfg.exceptions import ConfigurationError
-from repoze.bfg.exceptions import NotFound
-from repoze.bfg.exceptions import Forbidden
-from repoze.bfg.request import route_request_iface
-from repoze.bfg.resource import resource_spec_from_abspath
-from repoze.bfg.static import StaticURLInfo
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthorizationPolicy
+from pyramid.interfaces import IDefaultPermission
+from pyramid.interfaces import IRendererFactory
+from pyramid.interfaces import IRouteRequest
+from pyramid.interfaces import IView
+
+from pyramid.authentication import AuthTktAuthenticationPolicy
+from pyramid.authentication import RemoteUserAuthenticationPolicy
+from pyramid.authentication import RepozeWho1AuthenticationPolicy
+from pyramid.authorization import ACLAuthorizationPolicy
+from pyramid.configuration import Configurator
+from pyramid.exceptions import ConfigurationError
+from pyramid.exceptions import NotFound
+from pyramid.exceptions import Forbidden
+from pyramid.request import route_request_iface
+from pyramid.resource import resource_spec_from_abspath
+from pyramid.static import StaticURLInfo
+from pyramid.threadlocal import get_current_registry
###################### directives ##########################
diff --git a/setup.cfg b/setup.cfg
index 5b41e17e5..e28494286 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,11 +1,10 @@
[easy_install]
zip_ok = false
-index_url = http://dist.repoze.org/bfg/dev/simple
[nosetests]
match=^test
-where=repoze/bfg
+where=pyramid
nocapture=1
-cover-package=repoze.bfg
+cover-package=pyramid
cover-erase=1
diff --git a/setup.py b/setup.py
index df9ccc5d4..1dbabe5f4 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@
#
##############################################################################
-__version__ = '1.3a15'
+__version__ = '1.0a1'
import os
import platform
@@ -52,38 +52,37 @@ else:
if sys.version_info[:2] < (2, 6):
install_requires.append('simplejson')
-setup(name='repoze.bfg',
+setup(name='pyramid',
version=__version__,
- description='The repoze.bfg web application framework',
+ description='The Pyramid web application framework, a Pylons project',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python",
- "Framework :: BFG",
+ "Framework :: Pylons",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI",
"License :: Repoze Public License",
],
- keywords='web wsgi bfg',
+ keywords='web wsgi pylons pyramid bfg',
author="Chris McDonough, Agendaless Consulting",
author_email="repoze-dev@lists.repoze.org",
- url="http://bfg.repoze.org",
+ url="http://pylonshq.com",
license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
packages=find_packages(),
include_package_data=True,
- namespace_packages = ['repoze', 'repoze.bfg'],
zip_safe=False,
install_requires = install_requires,
tests_require = tests_require,
- test_suite="repoze.bfg.tests",
+ test_suite="pyramid.tests",
entry_points = """\
[paste.paster_create_template]
- bfg_starter=repoze.bfg.paster:StarterProjectTemplate
- bfg_zodb=repoze.bfg.paster:ZODBProjectTemplate
- bfg_routesalchemy=repoze.bfg.paster:RoutesAlchemyProjectTemplate
- bfg_alchemy=repoze.bfg.paster:AlchemyProjectTemplate
+ pyramid_starter=pyramid.paster:StarterProjectTemplate
+ pyramid_zodb=pyramid.paster:ZODBProjectTemplate
+ pyramid_routesalchemy=pyramid.paster:RoutesAlchemyProjectTemplate
+ pyramid_alchemy=pyramid.paster:AlchemyProjectTemplate
[paste.paster_command]
- bfgshell=repoze.bfg.paster:BFGShellCommand
+ pyramid_shell=pyramid.paster:BFGShellCommand
"""
)