aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/cases/104_get_from.robot
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2019-01-16 15:07:34 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2019-01-17 11:32:00 +0300
commite481f8514ade0e8a3a5750c22c1fda9cffaea3fe (patch)
tree3c91e065fc9f6fb14b5b07e9650dbe66209b5f8c /test/functional/cases/104_get_from.robot
parentae8f1997198be36340efb8a1d291e0339b1486c3 (diff)
downloadrspamd-e481f8514ade0e8a3a5750c22c1fda9cffaea3fe.tar.gz
rspamd-e481f8514ade0e8a3a5750c22c1fda9cffaea3fe.zip
[Test] Add task:get_from(['mime']) test
Diffstat (limited to 'test/functional/cases/104_get_from.robot')
-rw-r--r--test/functional/cases/104_get_from.robot53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/functional/cases/104_get_from.robot b/test/functional/cases/104_get_from.robot
new file mode 100644
index 000000000..a81dec559
--- /dev/null
+++ b/test/functional/cases/104_get_from.robot
@@ -0,0 +1,53 @@
+*** Settings ***
+Suite Setup Generic Setup
+Suite Teardown Simple Teardown
+Library ${TESTDIR}/lib/rspamd.py
+Resource ${TESTDIR}/lib/rspamd.robot
+Variables ${TESTDIR}/lib/vars.py
+
+*** Variables ***
+${CONFIG} ${TESTDIR}/configs/lua_script.conf
+${LUA_SCRIPT} ${TESTDIR}/lua/get_from.lua
+${RSPAMD_SCOPE} Suite
+
+${SYMBOL} GET_FROM (0.00)
+${SYMBOL1} ${SYMBOL}[,user@example.org,user,example.org]
+${SYMBOL2} ${SYMBOL}[First Last,user@example.org,user,example.org]
+${SYMBOL3} ${SYMBOL}[First M. Last,user@example.org,user,example.org]
+
+*** Test Cases ***
+task:get_from('mime') - address only
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from.eml
+ Check Rspamc ${result} ${SYMBOL1}
+
+task:get_from('mime') - comment
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_comment.eml
+ Check Rspamc ${result} ${SYMBOL1}
+
+task:get_from('mime') - display name
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_dn.eml
+ Check Rspamc ${result} ${SYMBOL2}
+
+task:get_from('mime') - display name Base64
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_dn_base64.eml
+ Check Rspamc ${result} ${SYMBOL}[Кириллица,user@example.org,user,example.org]
+
+task:get_from('mime') - display name and comment
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_dn_comment.eml
+ Check Rspamc ${result} ${SYMBOL2}
+
+task:get_from('mime') - quoted display name
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_quoted_dn.eml
+ Check Rspamc ${result} ${SYMBOL3}
+
+task:get_from('mime') - quoted display name and comment
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_quoted_dn_comment.eml
+ Check Rspamc ${result} ${SYMBOL3}
+
+task:get_from('mime') - quoted in the middle of DN (outer spaces)
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_quoted_dn_middle.eml
+ Check Rspamc ${result} ${SYMBOL3}
+
+task:get_from('mime') - quoted in the middle of DN (inner spaces)
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/from/from_quoted_dn_middle_inner.eml
+ Check Rspamc ${result} ${SYMBOL3}