summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-04 07:58:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-04 07:58:56 +0000
commita785d1c2de7d227674051b865935013bdd27e60f (patch)
treecf642e98373f0a1b8fbc5e772c30c334f2cd4d30 /tests/conftest.py
parentAdding upstream version 1.11.1. (diff)
downloadiredis-a785d1c2de7d227674051b865935013bdd27e60f.tar.xz
iredis-a785d1c2de7d227674051b865935013bdd27e60f.zip
Adding upstream version 1.12.0.upstream/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":