Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Both check_docid_known() instance: assert that the value associated
Browse files Browse the repository at this point in the history
with the docid is greater than 0 too.
  • Loading branch information
Tim Peters committed May 16, 2002
1 parent 78d526a commit d944180
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/testIndex.py
Expand Up @@ -146,6 +146,7 @@ class CosineIndexTest(IndexTest):

def check_docid_known(self, docid):
self.assert_(self.index._docweight.has_key(docid))
self.assert_(self.index._docweight[docid] > 0)

def num_docs_known(self):
return len(self.index._docweight)
Expand All @@ -155,6 +156,7 @@ class OkapiIndexTest(IndexTest):

def check_docid_known(self, docid):
self.assert_(self.index._doclen.has_key(docid))
self.assert_(self.index._doclen[docid] > 0)

def num_docs_known(self):
return len(self.index._doclen)
Expand Down

0 comments on commit d944180

Please sign in to comment.