Permalink
Browse files

Merge branch 'master' of github.com:repoze/repoze.catalog

  • Loading branch information...
2 parents 132f9ed + 17e7128 commit e6f07d49fe27257536d3ce889ddf37554ec66939 @tseaver tseaver committed Apr 26, 2013
Showing with 12 additions and 1 deletion.
  1. +5 −0 CHANGES.txt
  2. +1 −1 repoze/catalog/query.py
  3. +6 −0 repoze/catalog/tests/test_query.py
View
@@ -1,3 +1,8 @@
+0.8.3 (unreleased)
+==================
+
+- Fix bug in query with names are None [ebrehault].
+
0.8.2 (2012-04-15)
==================
View
@@ -69,7 +69,7 @@ def _get_value(self, names, value=_marker):
return tuple(self._get_value(names, child) for child in value)
elif isinstance(value, Name):
name = value.name
- if name not in names:
+ if not names or name not in names:
raise NameError("No value passed in for name: %s" % name)
return names[name]
return value
@@ -366,6 +366,12 @@ def test_apply_with_names(self):
self.assertEqual(result, ['one', 'two'])
self.assertEqual(catalog.index.any, ['one', 'two'])
+ def test_apply_with_names_none(self):
+ from repoze.catalog.query import Name
+ catalog = DummyCatalog()
+ inst = self._makeOne('index', [Name('foo'), Name('bar')])
+ self.assertRaises(NameError, inst._apply, catalog, None)
+
def test_apply_with_names_in_tuple(self):
from repoze.catalog.query import Name
catalog = DummyCatalog()

0 comments on commit e6f07d4

Please sign in to comment.