summaryrefslogtreecommitdiffstatshomepage
path: root/tests/test_input.py
diff options
context:
space:
mode:
author苏向夜 <fu050409@163.com>2024-01-26 13:56:24 +0800
committer苏向夜 <fu050409@163.com>2024-01-26 13:56:24 +0800
commit0e8be9de58454de079d772dec6c0ef9c1774a775 (patch)
tree9e0d4863d87524c15c232bf5cbd555d98a90aa70 /tests/test_input.py
parent796455df18b87515a4f8a4933dd92d79bea58adf (diff)
downloadinfini-0e8be9de58454de079d772dec6c0ef9c1774a775.tar.gz
infini-0e8be9de58454de079d772dec6c0ef9c1774a775.zip
:recycle: refactor(infini): refacted infini as version 2.0.0-alpha.1
Diffstat (limited to 'tests/test_input.py')
-rw-r--r--tests/test_input.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_input.py b/tests/test_input.py
new file mode 100644
index 00000000..5f44ca1e
--- /dev/null
+++ b/tests/test_input.py
@@ -0,0 +1,16 @@
+from infini.input import Input
+
+
+def test_new_input_without_vars():
+ assert Input("test plain_str").plain_data == "test plain_str"
+ assert Input("test plain_str").get_plain_text() == "test plain_str"
+
+
+def test_new_input_with_session_id():
+ input = Input("test plain_str", variables={"session_id": "test"})
+ assert input.get_session_id() == "test"
+
+
+def test_new_input_without_session_id():
+ input = Input("test plain_str", variables={"user_id": "test"})
+ assert input.get_session_id() == "session_unknown_test"