diff --git a/plugins/redis/.CHECKSUM b/plugins/redis/.CHECKSUM index b998d6d30b..bfc99cdc7b 100644 --- a/plugins/redis/.CHECKSUM +++ b/plugins/redis/.CHECKSUM @@ -1,5 +1,5 @@ { - "spec": "e7f620b0384a972f398c48517675bb8b", + "spec": "d87af4a73af23e65eb280f06b17501b0", "manifest": "bcbee882883b3bbc53d23c28bd6b860d", "setup": "c8ba0398d017459776ab5d8547c2cec8", "schemas": [ diff --git a/plugins/redis/bin/komand_redis b/plugins/redis/bin/komand_redis index 9f80c260e6..8ea52d5522 100755 --- a/plugins/redis/bin/komand_redis +++ b/plugins/redis/bin/komand_redis @@ -23,8 +23,6 @@ def main(): monkey.patch_all() import insightconnect_plugin_runtime - import sys - sys.path.append(os.path.abspath("../")) from komand_redis import connection, actions, triggers, tasks class ICONRedis(insightconnect_plugin_runtime.Plugin): diff --git a/plugins/redis/plugin.spec.yaml b/plugins/redis/plugin.spec.yaml index b65ca71b83..012481cf25 100644 --- a/plugins/redis/plugin.spec.yaml +++ b/plugins/redis/plugin.spec.yaml @@ -34,7 +34,7 @@ hub_tags: keywords: [database, redis] features: [] version_history: - - "1.0.2 - Bumping requirements.txt | SDK bump to 6.2.0" + - "1.0.2 - Bumping requirements.txt | SDK bump to 6.2.0 | Added Unit Tests" - "1.0.1 - New spec and help.md format for the Extension Library" - "1.0.0 - Support web server mode | Add actions HMSET, HMGET and HINCRBY" - "0.1.2 - Update to new plugin architecture, fix action 'keys'" diff --git a/plugins/redis/unit_test/expected/hmget_exp.json.exp b/plugins/redis/unit_test/expected/hmget_exp.json.exp index e3291c2cc7..54bcdfb0fc 100644 --- a/plugins/redis/unit_test/expected/hmget_exp.json.exp +++ b/plugins/redis/unit_test/expected/hmget_exp.json.exp @@ -1,5 +1,6 @@ { "values": { - "login_count": "0" - } + "age": "20", + "name": "Test User" + } } \ No newline at end of file diff --git a/plugins/redis/unit_test/inputs/hmget.json.exp b/plugins/redis/unit_test/inputs/hmget.json.exp index e0abbf680b..3110f89575 100644 --- a/plugins/redis/unit_test/inputs/hmget.json.exp +++ b/plugins/redis/unit_test/inputs/hmget.json.exp @@ -1,9 +1,8 @@ { - "fields": - [ - "name", - "email" - ], - "get_all": true, - "key": "user:profile:123" + "fields": [ + "age", + "name" + ], + "get_all": false, + "key": "user:4567" } \ No newline at end of file diff --git a/plugins/redis/unit_test/util.py b/plugins/redis/unit_test/util.py index 62191a7d13..06db98b6df 100644 --- a/plugins/redis/unit_test/util.py +++ b/plugins/redis/unit_test/util.py @@ -5,8 +5,6 @@ sys.path.append(os.path.abspath("../")) from komand_redis.connection import Connection -from komand_redis.connection.schema import Input - class Util: @staticmethod @@ -34,6 +32,10 @@ def __init__(self): def delete(key_name: str): return 10 + @staticmethod + def hmget(key_name: str, fields: list): + return [b'20', b'Test User'] + @staticmethod def hgetall(key_name: str): return {b"age": b"20", b"email": b"Test@example.com", b"name": b"Test User"}