remove test index files and edit tests accordingly (#46)
parent
8e97a1ebe7
commit
27340e91bf
|
@ -1,7 +1,7 @@
|
||||||
import tantivy
|
import tantivy
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from tantivy import Document, Index, SchemaBuilder, Schema
|
from tantivy import Document, Index, SchemaBuilder
|
||||||
|
|
||||||
|
|
||||||
def schema():
|
def schema():
|
||||||
|
@ -228,18 +228,12 @@ class TestUpdateClass(object):
|
||||||
assert len(result.hits) == 0
|
assert len(result.hits) == 0
|
||||||
|
|
||||||
|
|
||||||
PATH_TO_INDEX = "tests/test_index/"
|
|
||||||
|
|
||||||
|
|
||||||
class TestFromDiskClass(object):
|
class TestFromDiskClass(object):
|
||||||
def test_exists(self):
|
def test_opens_from_dir_invalid_schema(self, dir_index):
|
||||||
# prefer to keep it separate in case anyone deletes this
|
invalid_schema = SchemaBuilder().add_text_field("🐱").build()
|
||||||
# runs from the root directory
|
index_dir, _ = dir_index
|
||||||
assert Index.exists(PATH_TO_INDEX)
|
|
||||||
|
|
||||||
def test_opens_from_dir_invalid_schema(self):
|
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
index = Index(schema(), PATH_TO_INDEX, reuse=True)
|
Index(invalid_schema, str(index_dir), reuse=True)
|
||||||
|
|
||||||
def test_opens_from_dir(self, dir_index):
|
def test_opens_from_dir(self, dir_index):
|
||||||
index_dir, _ = dir_index
|
index_dir, _ = dir_index
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
["1fc74026b3954090b69817d58bcce59a.fieldnorm","f79c6d0a68e04210a4d026ecf151a1e7.pos","1fc74026b3954090b69817d58bcce59a.store","meta.json","f79c6d0a68e04210a4d026ecf151a1e7.fieldnorm","8949f79450d349e2bd51d885f44c354f.fieldnorm","f79c6d0a68e04210a4d026ecf151a1e7.posidx","8949f79450d349e2bd51d885f44c354f.store","8949f79450d349e2bd51d885f44c354f.term","8949f79450d349e2bd51d885f44c354f.pos","1fc74026b3954090b69817d58bcce59a.posidx","1fc74026b3954090b69817d58bcce59a.pos","8949f79450d349e2bd51d885f44c354f.posidx","f79c6d0a68e04210a4d026ecf151a1e7.idx","1fc74026b3954090b69817d58bcce59a.fast","f79c6d0a68e04210a4d026ecf151a1e7.fast","f79c6d0a68e04210a4d026ecf151a1e7.term","1fc74026b3954090b69817d58bcce59a.term","8949f79450d349e2bd51d885f44c354f.idx","1fc74026b3954090b69817d58bcce59a.idx","f79c6d0a68e04210a4d026ecf151a1e7.store","8949f79450d349e2bd51d885f44c354f.fast"]
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,44 +0,0 @@
|
||||||
{
|
|
||||||
"segments": [
|
|
||||||
{
|
|
||||||
"segment_id": "1fc74026-b395-4090-b698-17d58bcce59a",
|
|
||||||
"max_doc": 1,
|
|
||||||
"deletes": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"segment_id": "8949f794-50d3-49e2-bd51-d885f44c354f",
|
|
||||||
"max_doc": 1,
|
|
||||||
"deletes": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"segment_id": "f79c6d0a-68e0-4210-a4d0-26ecf151a1e7",
|
|
||||||
"max_doc": 1,
|
|
||||||
"deletes": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"schema": [
|
|
||||||
{
|
|
||||||
"name": "title",
|
|
||||||
"type": "text",
|
|
||||||
"options": {
|
|
||||||
"indexing": {
|
|
||||||
"record": "position",
|
|
||||||
"tokenizer": "default"
|
|
||||||
},
|
|
||||||
"stored": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"type": "text",
|
|
||||||
"options": {
|
|
||||||
"indexing": {
|
|
||||||
"record": "position",
|
|
||||||
"tokenizer": "default"
|
|
||||||
},
|
|
||||||
"stored": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"opstamp": 6
|
|
||||||
}
|
|
Loading…
Reference in New Issue