pyramid/tests/pkgs/__init__.pycopy from pyramid/tests/viewdecoratorapp/views/__init__.py copy to pyramid/tests/pkgs/__init__.py
pyramid/tests/pkgs/ccbugapp/__init__.py
pyramid/tests/pkgs/conflictapp/__init__.py
File was renamed from pyramid/tests/conflictapp/__init__.py @@ -20,4 +20,4 @@ config.add_route('aroute', '/route') config.set_authentication_policy(AuthTktAuthenticationPolicy('seekri1t')) config.set_authorization_policy(ACLAuthorizationPolicy()) config.include('pyramid.tests.conflictapp.included') config.include('pyramid.tests.pkgs.conflictapp.included') pyramid/tests/pkgs/conflictapp/included.py
pyramid/tests/pkgs/defpermbugapp/__init__.py
File was renamed from pyramid/tests/defpermbugapp/__init__.py @@ -19,7 +19,7 @@ from pyramid.authentication import AuthTktAuthenticationPolicy authn_policy = AuthTktAuthenticationPolicy('seekt1t') authz_policy = ACLAuthorizationPolicy() config.scan('pyramid.tests.defpermbugapp') config.scan('pyramid.tests.pkgs.defpermbugapp') config._set_authentication_policy(authn_policy) config._set_authorization_policy(authz_policy) config.set_default_permission('private') pyramid/tests/pkgs/exceptionviewapp/__init__.py
pyramid/tests/pkgs/exceptionviewapp/models.py
pyramid/tests/pkgs/exceptionviewapp/views.py
pyramid/tests/pkgs/fixtureapp/__init__.py
pyramid/tests/pkgs/fixtureapp/models.py
pyramid/tests/pkgs/fixtureapp/subpackage/__init__.py
pyramid/tests/pkgs/fixtureapp/subpackage/templates/bar.pt
pyramid/tests/pkgs/fixtureapp/templates/fixture.pt
pyramid/tests/pkgs/fixtureapp/views.py
pyramid/tests/pkgs/forbiddenapp/__init__.py
pyramid/tests/pkgs/hybridapp/__init__.py
pyramid/tests/pkgs/hybridapp/views.py
pyramid/tests/pkgs/includeapp1/__init__.py
pyramid/tests/pkgs/includeapp1/root.py
File was renamed from pyramid/tests/includeapp1/root.py @@ -5,6 +5,6 @@ def configure(config): config.add_view(aview) config.include('pyramid.tests.includeapp1.two.configure') config.include('pyramid.tests.pkgs.includeapp1.two.configure') config.commit() pyramid/tests/pkgs/includeapp1/three.py
File was renamed from pyramid/tests/includeapp1/three.py @@ -5,6 +5,6 @@ def configure(config): config.add_view(aview, name='three') config.include('pyramid.tests.includeapp1.two.configure') # should not cycle config.include('pyramid.tests.pkgs.includeapp1.two.configure') # should not cycle config.add_view(aview) # will be overridden by root when resolved pyramid/tests/pkgs/includeapp1/two.py
File was renamed from pyramid/tests/includeapp1/two.py @@ -5,5 +5,5 @@ def configure(config): config.add_view(aview, name='two') config.include('pyramid.tests.includeapp1.three.configure') config.include('pyramid.tests.pkgs.includeapp1.three.configure') config.add_view(aview) # will be overridden by root when resolved pyramid/tests/pkgs/localeapp/__init__.py
pyramid/tests/pkgs/localeapp/locale/GARBAGE
pyramid/tests/pkgs/localeapp/locale/be/LC_MESSAGES
pyramid/tests/pkgs/localeapp/locale/de/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale/de/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/localeapp/locale/en/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale/en/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/localeapp/locale2/GARBAGE
pyramid/tests/pkgs/localeapp/locale2/be/LC_MESSAGES
pyramid/tests/pkgs/localeapp/locale2/de/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale2/de/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/localeapp/locale2/en/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale2/en/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/localeapp/locale3/GARBAGE
pyramid/tests/pkgs/localeapp/locale3/be/LC_MESSAGES
pyramid/tests/pkgs/localeapp/locale3/de/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale3/de/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/localeapp/locale3/en/LC_MESSAGES/deformsite.moBinary files differ
pyramid/tests/pkgs/localeapp/locale3/en/LC_MESSAGES/deformsite.po
pyramid/tests/pkgs/permbugapp/__init__.py
pyramid/tests/pkgs/rendererscanapp/__init__.py
pyramid/tests/pkgs/rendererscanapp/one.pt
pyramid/tests/pkgs/rendererscanapp/two/__init__.py
pyramid/tests/pkgs/rendererscanapp/two/two.pt
pyramid/tests/pkgs/restbugapp/__init__.py
pyramid/tests/pkgs/restbugapp/views.py
pyramid/tests/pkgs/staticpermapp/__init__.py
pyramid/tests/pkgs/viewdecoratorapp/__init__.py
New file @@ -0,0 +1,3 @@ def includeme(config): config.scan('pyramid.tests.pkgs.viewdecoratorapp') pyramid/tests/pkgs/viewdecoratorapp/views/__init__.py
pyramid/tests/pkgs/viewdecoratorapp/views/templates/foo.mak
pyramid/tests/pkgs/viewdecoratorapp/views/views.py
File was renamed from pyramid/tests/viewdecoratorapp/views/views.py @@ -4,7 +4,8 @@ def first(request): return {'result':'OK1'} @view_config(renderer='pyramid.tests.viewdecoratorapp.views:templates/foo.mak', @view_config( renderer='pyramid.tests.pkgs.viewdecoratorapp.views:templates/foo.mak', name='second') def second(request): return {'result':'OK2'} pyramid/tests/pkgs/wsgiapp2app/__init__.py
pyramid/tests/test_config/test_i18n.py
@@ -5,11 +5,11 @@ here = os.path.dirname(__file__) locale = os.path.abspath( os.path.join(here, '..', 'localeapp', 'locale')) os.path.join(here, '..', 'pkgs', 'localeapp', 'locale')) locale2 = os.path.abspath( os.path.join(here, '..', 'localeapp', 'locale2')) os.path.join(here, '..', 'pkgs', 'localeapp', 'locale2')) locale3 = os.path.abspath( os.path.join(here, '..', 'localeapp', 'locale3')) os.path.join(here, '..', 'pkgs', 'localeapp', 'locale3')) class TestI18NConfiguratorMixin(unittest.TestCase): def _makeOne(self, *arg, **kw): @@ -53,7 +53,7 @@ def test_add_translation_dirs_asset_spec(self): from pyramid.interfaces import ITranslationDirectories config = self._makeOne(autocommit=True) config.add_translation_dirs('pyramid.tests.localeapp:locale') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale') self.assertEqual(config.registry.getUtility(ITranslationDirectories), [locale]) @@ -62,24 +62,24 @@ config = self._makeOne(autocommit=True) directories = ['abc'] config.registry.registerUtility(directories, ITranslationDirectories) config.add_translation_dirs('pyramid.tests.localeapp:locale') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale') result = config.registry.getUtility(ITranslationDirectories) self.assertEqual(result, [locale, 'abc']) def test_add_translation_dirs_multiple_specs(self): from pyramid.interfaces import ITranslationDirectories config = self._makeOne(autocommit=True) config.add_translation_dirs('pyramid.tests.localeapp:locale', 'pyramid.tests.localeapp:locale2') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale', 'pyramid.tests.pkgs.localeapp:locale2') self.assertEqual(config.registry.getUtility(ITranslationDirectories), [locale, locale2]) def test_add_translation_dirs_multiple_specs_multiple_calls(self): from pyramid.interfaces import ITranslationDirectories config = self._makeOne(autocommit=True) config.add_translation_dirs('pyramid.tests.localeapp:locale', 'pyramid.tests.localeapp:locale2') config.add_translation_dirs('pyramid.tests.localeapp:locale3') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale', 'pyramid.tests.pkgs.localeapp:locale2') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale3') self.assertEqual(config.registry.getUtility(ITranslationDirectories), [locale3, locale, locale2]) @@ -90,7 +90,7 @@ config = self._makeOne(autocommit=True) manager.push({'request':request, 'registry':config.registry}) try: config.add_translation_dirs('pyramid.tests.localeapp:locale') config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale') translate = config.registry.getUtility(IChameleonTranslate) self.assertEqual(translate('Approve'), u'Approve') finally: pyramid/tests/test_config/test_views.py
@@ -3507,4 +3507,3 @@ def add(self, name, spec, **kw): self.added.append((name, spec, kw)) pyramid/tests/test_i18n.py
@@ -1,5 +1,9 @@ # -*- coding: utf-8 -*- # import os here = os.path.dirname(__file__) localedir = os.path.join(here, 'pkgs', 'localeapp', 'locale') import unittest from pyramid.testing import cleanUp @@ -176,10 +180,7 @@ return make_localizer(locale, tdirs) def test_locale_from_mo(self): import os from pyramid.i18n import Localizer here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') localedirs = [localedir] locale_name = 'de' result = self._callFUT(locale_name, localedirs) @@ -190,10 +191,7 @@ self.assertTrue(hasattr(result, 'pluralize')) def test_locale_from_mo_bad_mo(self): import os from pyramid.i18n import Localizer here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') localedirs = [localedir] locale_name = 'be' result = self._callFUT(locale_name, localedirs) @@ -202,10 +200,7 @@ 'Approve') def test_locale_from_mo_mo_isdir(self): import os from pyramid.i18n import Localizer here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') localedirs = [localedir] locale_name = 'gb' result = self._callFUT(locale_name, localedirs) @@ -214,10 +209,7 @@ 'Approve') def test_territory_fallback(self): import os from pyramid.i18n import Localizer here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') localedirs = [localedir] locale_name = 'de_DE' result = self._callFUT(locale_name, localedirs) @@ -270,13 +262,10 @@ self.assertEqual(result, 'abc') def test_locale_from_mo(self): import os 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') localedirs = [localedir] registry.registerUtility(localedirs, ITranslationDirectories) request = DummyRequest() @@ -289,13 +278,10 @@ self.assertTrue(hasattr(result, 'pluralize')) def test_locale_from_mo_bad_mo(self): import os 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') localedirs = [localedir] registry.registerUtility(localedirs, ITranslationDirectories) request = DummyRequest() @@ -367,36 +353,24 @@ def test_load_locales_None(self): import gettext import os here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') klass = self._getTargetClass() result = klass.load(localedir, None, domain=None) self.assertEqual(result.__class__, gettext.NullTranslations) def test_load_domain_None(self): import gettext import os here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') locales = ['de', 'en'] klass = self._getTargetClass() result = klass.load(localedir, locales, domain=None) self.assertEqual(result.__class__, gettext.NullTranslations) def test_load_found_locale_and_domain(self): import os here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') locales = ['de', 'en'] klass = self._getTargetClass() result = klass.load(localedir, locales, domain='deformsite') self.assertEqual(result.__class__, klass) def test_load_found_locale_and_domain_locale_is_string(self): import os here = os.path.dirname(__file__) localedir = os.path.join(here, 'localeapp', 'locale') locales = 'de' klass = self._getTargetClass() result = klass.load(localedir, locales, domain='deformsite') pyramid/tests/test_integration.py
@@ -138,7 +138,7 @@ self.config.end() class TestFixtureApp(IntegrationBase): package = 'pyramid.tests.fixtureapp' package = 'pyramid.tests.pkgs.fixtureapp' def test_another(self): res = self.testapp.get('/another.html', status=200) self.assertEqual(res.body, 'fixture') @@ -158,8 +158,8 @@ self.testapp.get('/protected.html', status=403) class TestStaticPermApp(IntegrationBase): package = 'pyramid.tests.staticpermapp' root_factory = 'pyramid.tests.staticpermapp:RootFactory' package = 'pyramid.tests.pkgs.staticpermapp' root_factory = 'pyramid.tests.pkgs.staticpermapp:RootFactory' def test_allowed(self): result = self.testapp.get('/allowed/index.html', status=200) self.assertEqual( @@ -191,7 +191,7 @@ class TestCCBug(IntegrationBase): # "unordered" as reported in IRC by author of # http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/ package = 'pyramid.tests.ccbugapp' package = 'pyramid.tests.pkgs.ccbugapp' def test_rdf(self): res = self.testapp.get('/licenses/1/v1/rdf', status=200) self.assertEqual(res.body, 'rdf') @@ -204,7 +204,7 @@ # 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. package = 'pyramid.tests.hybridapp' package = 'pyramid.tests.pkgs.hybridapp' def test_root(self): res = self.testapp.get('/', status=200) self.assertEqual(res.body, 'global') @@ -245,14 +245,14 @@ class TestRestBugApp(IntegrationBase): # test bug reported by delijati 2010/2/3 (http://pastebin.com/d4cc15515) package = 'pyramid.tests.restbugapp' package = 'pyramid.tests.pkgs.restbugapp' def test_it(self): res = self.testapp.get('/pet', status=200) self.assertEqual(res.body, 'gotten') class TestForbiddenAppHasResult(IntegrationBase): # test that forbidden exception has ACLDenied result attached package = 'pyramid.tests.forbiddenapp' package = 'pyramid.tests.pkgs.forbiddenapp' def test_it(self): res = self.testapp.get('/x', status=403) message, result = [x.strip() for x in res.body.split('\n')] @@ -266,9 +266,11 @@ result.endswith("for principals ['system.Everyone']")) class TestViewDecoratorApp(IntegrationBase): package = 'pyramid.tests.viewdecoratorapp' package = 'pyramid.tests.pkgs.viewdecoratorapp' def _configure_mako(self): tmpldir = os.path.join(os.path.dirname(__file__), 'viewdecoratorapp', tmpldir = os.path.join(os.path.dirname(__file__), 'pkgs', 'viewdecoratorapp', 'views') self.config.registry.settings['mako.directories'] = tmpldir @@ -286,7 +288,7 @@ class TestViewPermissionBug(IntegrationBase): # view_execution_permitted bug as reported by Shane at http://lists.repoze.org/pipermail/repoze-dev/2010-October/003603.html package = 'pyramid.tests.permbugapp' package = 'pyramid.tests.pkgs.permbugapp' def test_test(self): res = self.testapp.get('/test', status=200) self.assertTrue('ACLDenied' in res.body) @@ -296,7 +298,7 @@ class TestDefaultViewPermissionBug(IntegrationBase): # default_view_permission bug as reported by Wiggy at http://lists.repoze.org/pipermail/repoze-dev/2010-October/003602.html package = 'pyramid.tests.defpermbugapp' package = 'pyramid.tests.pkgs.defpermbugapp' def test_x(self): res = self.testapp.get('/x', status=403) self.assertTrue('failed permission check' in res.body) @@ -309,12 +311,13 @@ res = self.testapp.get('/z', status=200) self.assertTrue('public' in res.body) from pyramid.tests.exceptionviewapp.models import AnException, NotAnException from pyramid.tests.pkgs.exceptionviewapp.models import \ AnException, NotAnException excroot = {'anexception':AnException(), 'notanexception':NotAnException()} class TestExceptionViewsApp(IntegrationBase): package = 'pyramid.tests.exceptionviewapp' package = 'pyramid.tests.pkgs.exceptionviewapp' root_factory = lambda *arg: excroot def test_root(self): res = self.testapp.get('/', status=200) @@ -345,7 +348,7 @@ self.assertTrue('whoa' in res.body) class TestConflictApp(unittest.TestCase): package = 'pyramid.tests.conflictapp' package = 'pyramid.tests.pkgs.conflictapp' def _makeConfig(self): from pyramid.config import Configurator config = Configurator() @@ -413,7 +416,7 @@ def setUp(self): from pyramid.config import Configurator config = Configurator() from pyramid.tests.includeapp1.root import configure from pyramid.tests.pkgs.includeapp1.root import configure configure(config) app = config.make_wsgi_app() from webtest import TestApp @@ -457,7 +460,7 @@ class WSGIApp2AppTest(unittest.TestCase): def setUp(self): from pyramid.tests.wsgiapp2app import main from pyramid.tests.pkgs.wsgiapp2app import main config = main() app = config.make_wsgi_app() from webtest import TestApp @@ -473,7 +476,7 @@ if os.name != 'java': # uses chameleon class RendererScanAppTest(IntegrationBase): package = 'pyramid.tests.rendererscanapp' package = 'pyramid.tests.pkgs.rendererscanapp' def test_root(self): res = self.testapp.get('/one', status=200) self.assertTrue('One!' in res.body) @@ -483,7 +486,7 @@ self.assertTrue('Two!' in res.body) def test_rescan(self): self.config.scan('pyramid.tests.rendererscanapp') self.config.scan('pyramid.tests.pkgs.rendererscanapp') app = self.config.make_wsgi_app() from webtest import TestApp testapp = TestApp(app) pyramid/tests/viewdecoratorapp/__init__.py
File was deleted