-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INDY-1138] Added get_equal_or_prev into parent class #570
[INDY-1138] Added get_equal_or_prev into parent class #570
Conversation
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
Signed-off-by: Andrew Nikitin <[email protected]>
@@ -23,3 +23,22 @@ def compare(a, b): | |||
def open(self): | |||
self._db = leveldb.LevelDB(self.db_path, comparator=( | |||
'IntegerComparator', self.compare)) | |||
|
|||
def get_equal_or_prev(self, key): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for this
storage/kv_store.py
Outdated
@@ -75,5 +75,8 @@ def _has_key(self, key): | |||
except KeyError: | |||
return False | |||
|
|||
def get_equal_or_prev(self, key): | |||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to either make it @AbstractMethod or raise NotImplementedException by default
Signed-off-by: Andrew Nikitin <[email protected]>
return storage, ts_list | ||
|
||
|
||
def test_none_if_key_less_then_minimal_key(storage_with_ts_root_hashes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may consider having the same tests for RocksDB implementation as well (adding parameters to the tests), but I think it can be done with RocksDB support.
storage/kv_store.py
Outdated
@@ -75,5 +75,8 @@ def _has_key(self, key): | |||
except KeyError: | |||
return False | |||
|
|||
def get_equal_or_prev(self, key): | |||
raise NotImplemented() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs to be NotImplementedError
Signed-off-by: Andrew Nikitin <[email protected]>
* [INDY-1138] Added get_equal_or_prev into KeyValue storages Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Added abstract method for get_equal_or_prev Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Remove @AbstractMethod decorator Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Move test for storage from indy-node Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Fix NotImplemented raise Signed-off-by: Andrew Nikitin <[email protected]>
* [INDY-1138] Added get_equal_or_prev into KeyValue storages Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Added abstract method for get_equal_or_prev Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Remove @AbstractMethod decorator Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Move test for storage from indy-node Signed-off-by: Andrew Nikitin <[email protected]> * [INDY-1138] Fix NotImplemented raise Signed-off-by: Andrew Nikitin <[email protected]>
No description provided.