aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/lib
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2020-11-05 15:36:54 +0200
committerAndrew Lewis <nerf@judo.za.org>2020-11-05 15:36:54 +0200
commitf5b931b8146548f0ce6bac07734b014885ace29a (patch)
tree5eb58c424b99c681d7f1d2761be43aea88041624 /test/functional/lib
parentea6b7cea9d8909a7f161ae477b254dbe1a89b6d4 (diff)
downloadrspamd-f5b931b8146548f0ce6bac07734b014885ace29a.tar.gz
rspamd-f5b931b8146548f0ce6bac07734b014885ace29a.zip
[Test] Rework composites test
Diffstat (limited to 'test/functional/lib')
-rw-r--r--test/functional/lib/rspamd.robot23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/functional/lib/rspamd.robot b/test/functional/lib/rspamd.robot
index e310db4b5..6487a2e11 100644
--- a/test/functional/lib/rspamd.robot
+++ b/test/functional/lib/rspamd.robot
@@ -46,8 +46,15 @@ Check Rspamc Match String
Do Not Expect Symbol
[Arguments] ${symbol}
- ${passed} = Run Keyword And Return Status Expect Symbol ${symbol}
- Run Keyword If ${passed} Fail Unexpected symbol ${symbol} was found in result
+ Dictionary Should Not Contain Key ${SCAN_RESULT}[symbols] ${symbol}
+ ... msg=Symbol ${symbol} was not expected to be found in result
+
+Do Not Expect Symbols
+ [Arguments] @{symbols}
+ FOR ${symbol} IN @{symbols}
+ Dictionary Should Not Contain Key ${SCAN_RESULT}[symbols] ${symbol}
+ ... msg=Symbol ${symbol} was not expected to be found in result
+ END
Generic Setup
[Arguments] @{vargs} &{kwargs}
@@ -103,10 +110,20 @@ Expect Symbol With Option
Expect Symbol With Score
[Arguments] ${symbol} ${score}
- Expect Symbol ${symbol}
+ Dictionary Should Contain Key ${SCAN_RESULT}[symbols] ${symbol}
+ ... msg=Symbol ${symbol} wasn't found in result
Should Be Equal As Numbers ${SCAN_RESULT}[symbols][${symbol}][score] ${score}
... msg="Symbol ${symbol} has score of ${SCAN_RESULT}[symbols][${symbol}][score] but expected ${score}"
+Expect Symbols With Scores
+ [Arguments] &{symscores}
+ FOR ${key} ${value} IN &{symscores}
+ Dictionary Should Contain Key ${SCAN_RESULT}[symbols] ${key}
+ ... msg=Symbol ${key} wasn't found in result
+ Should Be Equal As Numbers ${SCAN_RESULT}[symbols][${key}][score] ${value}
+ ... msg="Symbol ${key} has score of ${SCAN_RESULT}[symbols][${key}][score] but expected ${value}"
+ END
+
Expect Symbol With Score And Exact Options
[Arguments] ${symbol} ${score} @{options}
Expect Symbol With Exact Options ${symbol} @{options}