mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-12-14 15:49:04 +00:00
Refactored unit tests
This commit is contained in:
21
test/test_Indexer.py
Normal file
21
test/test_Indexer.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from unittest import TestCase
|
||||
from indexer import Indexer
|
||||
|
||||
|
||||
class IndexerTest(TestCase):
|
||||
|
||||
def test_create_bulk_query(self):
|
||||
|
||||
docs = [{"name": "doc1"}, {"name": "doc2"}]
|
||||
|
||||
result = Indexer.create_bulk_index_string(docs, 1)
|
||||
|
||||
self.assertTrue(result == '{"index":{}}\n'
|
||||
'{"directory": 1, "name": "doc1"}\n'
|
||||
'{"index":{}}\n'
|
||||
'{"directory": 1, "name": "doc2"}\n'
|
||||
or result == '{"index":{}}\n'
|
||||
'{"name": "doc1", "directory": 1}\n'
|
||||
'{"index":{}}\n'
|
||||
'{"name": "doc2", "directory": 1}\n')
|
||||
|
||||
Reference in New Issue
Block a user