Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug in query with names are None

  • Loading branch information...
commit bfabbba68a79d9aff88b2c7f83a7368d1c31f4a9 1 parent d965904
@ebrehault ebrehault authored
View
5 CHANGES.txt
@@ -1,3 +1,8 @@
+0.8.3 (unreleased)
+==================
+
+- Fix bug in query with names are None [ebrehault].
+
0.8.2 (2012-04-15)
==================
View
2  repoze/catalog/query.py
@@ -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
View
6 repoze/catalog/tests/test_query.py
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.