Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohantyashish109 authored and Ashish Kumar Mohanty committed Sep 30, 2019
1 parent f56ec6a commit e576f2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_elasticmock.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ def test_should_index_document(self):
self.assertEqual(1, data.get('_version'))
self.assertEqual(self.index_name, data.get('_index'))

def test_should_index_document_without_doc_type(self):
data = self.es.index(index=self.index_name, body=self.body)

self.assertEqual('_doc', data.get('_type'))
self.assertTrue(data.get('created'))
self.assertEqual(1, data.get('_version'))
self.assertEqual(self.index_name, data.get('_index'))

def test_should_raise_notfounderror_when_nonindexed_id_is_used(self):
with self.assertRaises(NotFoundError):
self.es.get(index=self.index_name, id='1')
Expand Down

0 comments on commit e576f2c

Please sign in to comment.