Example #1
0
 def test_add_index_without_index_field(self):
     log_item = LogItem()
     doc = {"_id": 1, "_source": {}, "_type": "_doc"}
     DocLogItemConverter._add_index(doc, log_item)
     self.assertSetEqual(set(), set(log_item.contents))
Example #2
0
 def test_add_index(self):
     log_item = LogItem()
     doc = {"_index": "index1"}
     DocLogItemConverter._add_index(doc, log_item)
     self.assertSetEqual({("__tag__:__es_index__", "index1")},
                         set(log_item.contents))