Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions perkeepy/index/sortedkv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .index import SortedKVIndex
28 changes: 28 additions & 0 deletions perkeepy/index/sortedkv/test_sortedkv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 The Perkeepy Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from perkeepy.index import Indexer
from perkeepy.index import test_index
from perkeepy.index.sortedkv import SortedKVIndex
from perkeepy.sortedkv.ordered_dict import OrderedDictSortedKV


def test_sortedkv() -> None:
def indexer_factory() -> Indexer:
sorted_kv_indexer: Indexer = SortedKVIndex(
sorted_kv=OrderedDictSortedKV(),
)
return sorted_kv_indexer

test_index.run_index_test(indexer_factory=indexer_factory)
26 changes: 26 additions & 0 deletions perkeepy/index/test_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2021 The Perkeepy Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Callable

from perkeepy.index import Indexer


def run_index_test(indexer_factory: Callable[[], Indexer]) -> None:
"""Suite of tests to validate an Indexer implementation"""

# Create and index a permanode
# TODO: Create a permanode using a schema builder

assert indexer_factory
2 changes: 2 additions & 0 deletions perkeepy/sortedkv/ordered_dict/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .ordered_dict import OrderedDictSortedKV