mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-15 04:17:56 +00:00
fix: mini test
This commit is contained in:
1 parent
72904b0b95
commit
1bf7380aa5
2 files changed
+49
-2
No files matched your search
@@ -86,6 +86,14 @@ class FakeRedis:
|
||||
def expire(self, key, ttl): # TTL is not simulated.
|
||||
return True
|
||||
|
||||
def eval(self, _script, _numkeys, key, expected):
|
||||
"""Model the broker's one Lua script: delete ``key`` iff it holds ``expected``."""
|
||||
with self._lock:
|
||||
if self.kv.get(key) != _b(expected):
|
||||
return 0
|
||||
del self.kv[key]
|
||||
return 1
|
||||
|
||||
# -- lists --------------------------------------------------------
|
||||
def llen(self, key):
|
||||
with self._lock:
|
||||
|
||||
Reference in new issue
Block a user