summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-08-05 23:58:32 -0400
committerChris McDonough <chrism@plope.com>2012-08-05 23:58:32 -0400
commitadf32395eaef658bc9053037a9bed4b182397faf (patch)
tree53d5bdd378106ad92266f88feb7bcd9ee3a4594c
parent9c8ec5c7b7f12abb741f9d4467bc85f15b893420 (diff)
downloadpyramid-adf32395eaef658bc9053037a9bed4b182397faf.tar.gz
pyramid-adf32395eaef658bc9053037a9bed4b182397faf.tar.bz2
pyramid-adf32395eaef658bc9053037a9bed4b182397faf.zip
add coverage, get rid of test that doesnt belong here
-rw-r--r--pyramid/tests/test_config/test_init.py3
-rw-r--r--pyramid/tests/test_config/test_util.py32
2 files changed, 23 insertions, 12 deletions
diff --git a/pyramid/tests/test_config/test_init.py b/pyramid/tests/test_config/test_init.py
index 3d952caf7..abe22400b 100644
--- a/pyramid/tests/test_config/test_init.py
+++ b/pyramid/tests/test_config/test_init.py
@@ -1994,6 +1994,3 @@ class DummyIntrospectable(object):
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
diff --git a/pyramid/tests/test_config/test_util.py b/pyramid/tests/test_config/test_util.py
index 310d04535..13cb27526 100644
--- a/pyramid/tests/test_config/test_util.py
+++ b/pyramid/tests/test_config/test_util.py
@@ -361,15 +361,10 @@ class TestPredicateList(unittest.TestCase):
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 @@ class TestTopologicalSorter(unittest.TestCase):
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()