Skip to content

Commit 1ec3493

Browse files
committed
Test insert function
1 parent e4b466c commit 1ec3493

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/test_ngtpy.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pytest
2+
3+
import ngtpy
4+
5+
6+
def new_index(path, dimension):
7+
path_str = str(path)
8+
index = ngtpy.create(path_str, dimension)
9+
return ngtpy.Index(path_str)
10+
11+
12+
def test_insert(tmp_path):
13+
index = new_index(tmp_path, dimension=3)
14+
15+
v = [2, 3, 5]
16+
v_id = index.insert(v)
17+
18+
result = index.get_object(v_id)
19+
20+
assert result == v

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tox]
2+
envlist = py39
3+
isolated_build = true
4+
5+
[testenv]
6+
deps = pytest
7+
commands =
8+
pytest

0 commit comments

Comments
 (0)