Skip to content

Commit

Permalink
Fix key-sequence matching if a key is "absent".
Browse files Browse the repository at this point in the history
  • Loading branch information
ajdavis committed Mar 23, 2015
1 parent 0c6bce2 commit 6822bf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mockupdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,9 @@ def matches(self, *args, **kwargs):
raise TypeError(
"Can't compare ordered and unordered document types:"
" %r, %r" % (doc, other_doc))
if not seq_match(list(doc.keys()), list(other_doc.keys())):
keys = [key for key, value in doc.items()
if value is not absent]
if not seq_match(keys, list(other_doc.keys())):
return False
return True

Expand Down

0 comments on commit 6822bf0

Please sign in to comment.