summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-04 07:59:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-04 07:59:09 +0000
commit51cc817f8e2bab01ee028fbc1a0029a3f314d576 (patch)
tree8a78c6318a6d1b513e41deb0e3b020e59dd55d6c /tests/conftest.py
parentReleasing debian version 1.11.1-2. (diff)
downloadiredis-51cc817f8e2bab01ee028fbc1a0029a3f314d576.tar.xz
iredis-51cc817f8e2bab01ee028fbc1a0029a3f314d576.zip
Merging upstream version 1.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 4d7d643..b70bf95 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,4 +1,5 @@
import os
+import re
import tempfile
from textwrap import dedent
@@ -18,6 +19,22 @@ HISTORY_FILE = ".iredis_history"
@pytest.fixture
+def token_should_match():
+ def match_func(token, tomatch):
+ assert re.fullmatch(token, tomatch) is not None
+
+ return match_func
+
+
+@pytest.fixture
+def token_should_not_match():
+ def match_func(token, tomatch):
+ assert re.fullmatch(token, tomatch) is None
+
+ return match_func
+
+
+@pytest.fixture
def judge_command():
def judge_command_func(input_text, expect):
if expect == "invalid":