summaryrefslogtreecommitdiffstats
path: root/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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":