Skip to content
Browse files

add coverage, get rid of test that doesnt belong here

  • Loading branch information...
1 parent 9c8ec5c commit adf32395eaef658bc9053037a9bed4b182397faf @mcdonc mcdonc committed Aug 5, 2012
Showing with 23 additions and 12 deletions.
  1. +0 −3 pyramid/tests/test_config/test_init.py
  2. +23 −9 pyramid/tests/test_config/test_util.py
View
3 pyramid/tests/test_config/test_init.py
@@ -1994,6 +1994,3 @@ def __init__(self):
def register(self, introspector, action_info):
self.registered.append((introspector, action_info))
-class DummyPredicateList(object):
- def add(self, name, factory, weighs_more_than=None, weighs_less_than=None):
- pass
View
32 pyramid/tests/test_config/test_util.py
@@ -361,15 +361,10 @@ def test_request_method_ordering_hashes_same(self):
hash2, _, __= self._callFUT(request_method='GET')
self.assertEqual(hash1, hash2)
- def test_match_param_hashable(self):
- # https://github.com/Pylons/pyramid/issues/425
- import pyramid.testing
- def view(request): pass
- config = pyramid.testing.setUp(autocommit=False)
- config.add_route('foo', '/foo/{a}/{b}')
- config.add_view(view, route_name='foo', match_param='a=bar')
- config.add_view(view, route_name='foo', match_param=('a=bar', 'b=baz'))
- config.commit()
+ def test_unknown_predicate(self):
+ from pyramid.exceptions import ConfigurationError
+ self.assertRaises(ConfigurationError, self._callFUT, unknown=1)
+
class TestActionInfo(unittest.TestCase):
def _getTargetClass(self):
@@ -406,6 +401,25 @@ def _makeOne(self, *arg, **kw):
from pyramid.config.util import TopologicalSorter
return TopologicalSorter(*arg, **kw)
+ def test_remove(self):
+ inst = self._makeOne()
+ inst.names.append('name')
+ inst.name2val['name'] = 1
+ inst.req_after.add('name')
+ inst.req_before.add('name')
+ inst.name2after['name'] = ('bob',)
+ inst.name2before['name'] = ('fred',)
+ inst.order.append(('bob', 'name'))
+ inst.order.append(('name', 'fred'))
+ inst.remove('name')
+ self.assertFalse(inst.names)
+ self.assertFalse(inst.req_before)
+ self.assertFalse(inst.req_after)
+ self.assertFalse(inst.name2before)
+ self.assertFalse(inst.name2after)
+ self.assertFalse(inst.name2val)
+ self.assertFalse(inst.order)
+
def test_add(self):
from pyramid.config.util import LAST
sorter = self._makeOne()

0 comments on commit adf3239

Please sign in to comment.
Something went wrong with that request. Please try again.