diff options
author | Andrew Lewis <nerf@judo.za.org> | 2020-09-07 15:14:22 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2020-09-07 15:14:22 +0200 |
commit | c07cb6a8c4f45d0cf35baacf539d5c78145fe1de (patch) | |
tree | b67b987e045203d927aa87c1982dc43ea6fda5e6 /test/functional/cases/109_composites.robot | |
parent | 27ad207da620685499aa04c8e9c7d4e4eafa11dc (diff) | |
download | rspamd-c07cb6a8c4f45d0cf35baacf539d5c78145fe1de.tar.gz rspamd-c07cb6a8c4f45d0cf35baacf539d5c78145fe1de.zip |
[Test] Use HTTP & simplified test style
Diffstat (limited to 'test/functional/cases/109_composites.robot')
-rw-r--r-- | test/functional/cases/109_composites.robot | 94 |
1 files changed, 48 insertions, 46 deletions
diff --git a/test/functional/cases/109_composites.robot b/test/functional/cases/109_composites.robot index 1216e4c88..47fc0c28e 100644 --- a/test/functional/cases/109_composites.robot +++ b/test/functional/cases/109_composites.robot @@ -13,73 +13,75 @@ ${RSPAMD_SCOPE} Suite *** Test Cases *** Composites - Score - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} ${SPACE}50.00 / 0.00 + Scan File ${MESSAGE} + Expect Score 50 + Expect Required Score To Be Null Composites - Expressions - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} EXPRESSIONS (5.00) - Should Contain ${result.stdout} EXPRESSIONS_B (0.00) + Scan File ${MESSAGE} + Expect Symbol With Score EXPRESSIONS 5 + Expect Symbol With Score EXPRESSIONS_B 0 Composites - Policy: remove_weight - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} ${SPACE}POLICY_REMOVE_WEIGHT (5.00) - Should Not Contain ${result.stdout} ${SPACE}POLICY_REMOVE_WEIGHT_A (1.00) - Should Contain ${result.stdout} ${SPACE}POLICY_REMOVE_WEIGHT_B (0.00) + Scan File ${MESSAGE} + Expect Symbol With Score POLICY_REMOVE_WEIGHT 5 + Expect Symbol With Score POLICY_REMOVE_WEIGHT_B 0 + Do Not Expect Symbol POLICY_REMOVE_WEIGHT_A Composites - Policy: force removing - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} ${SPACE}POLICY_FORCE_REMOVE (5.00) - Should Contain ${result.stdout} ${SPACE}POLICY_FORCE_REMOVE_A (1.00) - Should Not Contain ${result.stdout} ${SPACE}POLICY_FORCE_REMOVE_B + Scan File ${MESSAGE} + Expect Symbol With Score POLICY_FORCE_REMOVE 5.00 + Expect Symbol With Score POLICY_FORCE_REMOVE_A 1.00 + Do Not Expect Symbol POLICY_FORCE_REMOVE_B Composites - Policy: leave - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} ${SPACE}POLICY_LEAVE (5.00) - Should Not Contain ${result.stdout} ${SPACE}POLICY_LEAVE_A - Should Contain ${result.stdout} ${SPACE}POLICY_LEAVE_B (1.00) + Scan File ${MESSAGE} + Expect Symbol With Score POLICY_LEAVE 5.00 + Do Not Expect Symbol POLICY_LEAVE_A + Expect Symbol With Score POLICY_LEAVE_B 1.00 Composites - Default policy: remove_weight - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} DEFAULT_POLICY_REMOVE_WEIGHT (5.00) - Should Contain ${result.stdout} DEFAULT_POLICY_REMOVE_WEIGHT_A (0.00) - Should Contain ${result.stdout} DEFAULT_POLICY_REMOVE_WEIGHT_B (0.00) + Scan File ${MESSAGE} + Expect Symbol With Score DEFAULT_POLICY_REMOVE_WEIGHT 5.00 + Expect Symbol With Score DEFAULT_POLICY_REMOVE_WEIGHT_A 0.00 + Expect Symbol With Score DEFAULT_POLICY_REMOVE_WEIGHT_B 0.00 Composites - Default policy: remove_symbol - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} DEFAULT_POLICY_REMOVE_SYMBOL (5.00) - Should Not Contain ${result.stdout} DEFAULT_POLICY_REMOVE_SYMBOL_ + Scan File ${MESSAGE} + Expect Symbol With Score DEFAULT_POLICY_REMOVE_SYMBOL 5.00 + Do Not Expect Symbol DEFAULT_POLICY_REMOVE_SYMBOL_A + Do Not Expect Symbol DEFAULT_POLICY_REMOVE_SYMBOL_B Composites - Default policy: leave - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} DEFAULT_POLICY_LEAVE (5.00) - Should Contain ${result.stdout} DEFAULT_POLICY_LEAVE_A (1.00) - Should Contain ${result.stdout} DEFAULT_POLICY_LEAVE_B (1.00) + Scan File ${MESSAGE} + Expect Symbol With Score DEFAULT_POLICY_LEAVE 5.00 + Expect Symbol With Score DEFAULT_POLICY_LEAVE_A 1.00 + Expect Symbol With Score DEFAULT_POLICY_LEAVE_B 1.00 Composites - Symbol groups - ${result} = Scan Message With Rspamc ${MESSAGE} - Check Rspamc ${result} SYMBOL_GROUPS (5.00) - Should Contain ${result.stdout} POSITIVE_A (-1.00) - Should Contain ${result.stdout} ANY_A (-1.00) - Should Contain ${result.stdout} NEGATIVE_B (1.00) - Should Not Contain ${result.stdout} NEGATIVE_A + Scan File ${MESSAGE} + Expect Symbol With Score SYMBOL_GROUPS 5.00 + Expect Symbol With Score POSITIVE_A -1.00 + Expect Symbol With Score ANY_A -1.00 + Expect Symbol With Score NEGATIVE_B 1.00 + Do Not Expect Symbol NEGATIVE_A Composites - Opts Plain - ${result} = Scan Message With Rspamc ${MESSAGE} --header=opts:sym1 - Check Rspamc ${result} SYMOPTS1 (5.00) - Should Not Contain ${result.stdout} SYMOPTS2 + Scan File ${MESSAGE} opts=sym1 + Expect Symbol With Score SYMOPTS1 5.00 + Do Not Expect Symbol SYMOPTS2 Composites - Opts RE Miss one - ${result} = Scan Message With Rspamc ${MESSAGE} --header=opts:sym1,foo1 - Check Rspamc ${result} SYMOPTS1 (5.00) - Should Not Contain ${result.stdout} SYMOPTS2 + Scan File ${MESSAGE} opts=sym1,foo1 + Expect Symbol With Score SYMOPTS1 5.00 + Do Not Expect Symbol SYMOPTS2 Composites - Opts RE Miss both - ${result} = Scan Message With Rspamc ${MESSAGE} --header=opts:sym2 - Should Not Contain ${result.stdout} SYMOPTS1 - Should Not Contain ${result.stdout} SYMOPTS2 + Scan File ${MESSAGE} opts=sym2 + Do Not Expect Symbol SYMOPTS1 + Do Not Expect Symbol SYMOPTS2 Composites - Opts RE Hit - ${result} = Scan Message With Rspamc ${MESSAGE} --header=opts:sym2,foo1 - Check Rspamc ${result} SYMOPTS2 (6.00) - Should Not Contain ${result.stdout} SYMOPTS1
\ No newline at end of file + Scan File ${MESSAGE} opts=sym2,foo1 + Expect Symbol With Score SYMOPTS2 6.00 + Do Not Expect Symbol SYMOPTS1 |