diff options
| author | Chris McDonough <chrism@plope.com> | 2011-08-31 22:30:13 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-08-31 22:30:13 -0400 |
| commit | 03d3bc19f266d0b53484cf34d02f38af7bf0740c (patch) | |
| tree | 6801ae656f964ff0aaeaf9fe2c7e9cc6140f2799 | |
| parent | a0b2c6cf3c1585d89d15f8b919ed15410d8e6765 (diff) | |
| download | pyramid-03d3bc19f266d0b53484cf34d02f38af7bf0740c.tar.gz pyramid-03d3bc19f266d0b53484cf34d02f38af7bf0740c.tar.bz2 pyramid-03d3bc19f266d0b53484cf34d02f38af7bf0740c.zip | |
move inappropriately placed test
| -rw-r--r-- | pyramid/tests/test_config/test_init.py | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/pyramid/tests/test_config/test_init.py b/pyramid/tests/test_config/test_init.py index b955dae22..3f31c4242 100644 --- a/pyramid/tests/test_config/test_init.py +++ b/pyramid/tests/test_config/test_init.py @@ -1367,6 +1367,26 @@ pyramid.tests.test_config.dummy_include2""", self.assertTrue("@view_config(name='two', renderer='string')" in which) + def test_conflict_route_with_view(self): + from zope.configuration.config import ConfigurationConflictError + config = self._makeOne() + def view1(request): pass + def view2(request): pass + config.add_route('a', '/a', view=view1) + config.add_route('a', '/a', view=view2) + try: + config.commit() + except ConfigurationConflictError, why: + c1, c2, c3, c4, c5, c6 = self._conflictFunctions(why) + self.assertEqual(c1, 'test_conflict_route_with_view') + self.assertEqual(c2, 'test_conflict_route_with_view') + self.assertEqual(c3, 'test_conflict_route_with_view') + self.assertEqual(c4, 'test_conflict_route_with_view') + self.assertEqual(c5, 'test_conflict_route_with_view') + self.assertEqual(c6, 'test_conflict_route_with_view') + else: # pragma: no cover + raise AssertionError + def test_hook_zca(self): from zope.component import getSiteManager def foo(): @@ -1587,12 +1607,6 @@ class TestConfiguratorDeprecatedFeatures(unittest.TestCase): request.registry = config.registry return request - def _conflictFunctions(self, e): - conflicts = e._conflicts.values() - for conflict in conflicts: - for confinst in conflict: - yield confinst[2] - def test_add_route_with_view(self): from pyramid.renderers import null_renderer config = self._makeOne(autocommit=True) @@ -1727,27 +1741,6 @@ class TestConfiguratorDeprecatedFeatures(unittest.TestCase): self._assertRoute(config, 'name', 'path') self.assertTrue(hasattr(wrapper, '__call_permissive__')) - def test_conflict_route_with_view(self): - from zope.configuration.config import ConfigurationConflictError - config = self._makeOne() - def view1(request): pass - def view2(request): pass - config.add_route('a', '/a', view=view1) - config.add_route('a', '/a', view=view2) - try: - config.commit() - except ConfigurationConflictError, why: - c1, c2, c3, c4, c5, c6 = self._conflictFunctions(why) - self.assertEqual(c1, 'test_conflict_route_with_view') - self.assertEqual(c2, 'test_conflict_route_with_view') - self.assertEqual(c3, 'test_conflict_route_with_view') - self.assertEqual(c4, 'test_conflict_route_with_view') - self.assertEqual(c5, 'test_conflict_route_with_view') - self.assertEqual(c6, 'test_conflict_route_with_view') - else: # pragma: no cover - raise AssertionError - - class TestConfigurator_add_directive(unittest.TestCase): def setUp(self): |
