Browse files

adding a test for exists method

  • Loading branch information...
1 parent 2bf96c2 commit 56aa9498d88214598949a22a2c9110bdf531956a @dblugeon committed Jun 9, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/test_indexing.py
View
6 tests/test_indexing.py
@@ -163,6 +163,12 @@ def testGetByID(self):
self.assertResultContains(result, {"name": "Joe Tester"})
self.assertResultContains(result._meta, {"index": "test-index",
"type": "test-type", "id": "1"})
+ def testExists(self):
+ self.conn.index({"name": "Joe Tester"}, self.index_name, self.document_type, 1)
+ self.conn.index({"name": "Bill Baloney"}, self.index_name, self.document_type, "http://example.com")
+ self.conn.refresh(self.index_name)
+ self.assertTrue(self.conn.exists(self.index_name, self.document_type, 1))
+ self.assertTrue(self.conn.exists(self.index_name, self.document_type, "http://example.com"))
def testMultiGet(self):
self.conn.index({"name": "Joe Tester"}, self.index_name, self.document_type, 1)

0 comments on commit 56aa949

Please sign in to comment.