diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-05-31 21:47:24 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-05-31 21:47:24 +0000 |
| commit | ae84c6b33efdcf37f453967384cacc264ec877d9 (patch) | |
| tree | 2c62f5b18042ce08d33709e289ce2f058ea4bf70 /repoze/bfg/tests/test_zcml.py | |
| parent | 59d1608a0613c6edc4123c6f0bda5b58a392a644 (diff) | |
| download | pyramid-ae84c6b33efdcf37f453967384cacc264ec877d9.tar.gz pyramid-ae84c6b33efdcf37f453967384cacc264ec877d9.tar.bz2 pyramid-ae84c6b33efdcf37f453967384cacc264ec877d9.zip | |
- The ``route`` ZCML directive now accepts ``request_type`` as an
alias for its ``condition_method`` argument for symmetry with the
``view`` directive.
Diffstat (limited to 'repoze/bfg/tests/test_zcml.py')
| -rw-r--r-- | repoze/bfg/tests/test_zcml.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_zcml.py b/repoze/bfg/tests/test_zcml.py index 0b24071e2..e35944add 100644 --- a/repoze/bfg/tests/test_zcml.py +++ b/repoze/bfg/tests/test_zcml.py @@ -415,6 +415,34 @@ class TestConnectRouteFunction(unittest.TestCase): 'conditions':{'method':'GET'} }) + def test_request_type(self): + mapper = self._registerRoutesMapper() + directive = DummyRouteDirective(static=True, explicit=True, + request_type='GET') + self._callFUT(directive) + self.assertEqual(len(mapper.connections), 1) + self.assertEqual(mapper.connections[0][1], + {'requirements': {}, + '_static':True, + '_explicit':True, + 'conditions':{'method':'GET'} + }) + + def test_condition_method_and_request_type(self): + mapper = self._registerRoutesMapper() + directive = DummyRouteDirective(static=True, explicit=True, + request_type='GET', + condition_method='POST') + self._callFUT(directive) + self.assertEqual(len(mapper.connections), 1) + self.assertEqual(mapper.connections[0][1], + {'requirements': {}, + '_static':True, + '_explicit':True, + 'conditions':{'method':'POST'} + }) + + def test_subdomains(self): mapper = self._registerRoutesMapper() directive = DummyRouteDirective(name='name', @@ -693,6 +721,7 @@ class DummyRouteDirective: parent_member_name = None parent_collection_name = None condition_method = None + request_type = None condition_subdomain = None condition_function = None subdomains = None |
