|
@@ -35,7 +35,6 @@ import io
|
35
|
35
|
import unittest
|
36
|
36
|
import unittest.mock
|
37
|
37
|
import tempfile
|
38
|
|
-from typing import Final
|
39
|
38
|
import contextlib
|
40
|
39
|
|
41
|
40
|
|
|
@@ -58,7 +57,7 @@ def storage2name(name):
|
58
|
57
|
return re.sub(r"[\.\- ]", "_", name)
|
59
|
58
|
|
60
|
59
|
|
61
|
|
-CONFIGS: Final = {
|
|
60
|
+CONFIGS = {
|
62
|
61
|
"actions": [
|
63
|
62
|
lambda data: """\
|
64
|
63
|
graph_title Rspamd actions
|
|
@@ -100,7 +99,7 @@ graph_args --base 1000 -l 0
|
100
|
99
|
graph_category antispam
|
101
|
100
|
graph_scale yes
|
102
|
101
|
spam.label Spams
|
103
|
|
-spam.draw STACK
|
|
102
|
+spam.draw AREA
|
104
|
103
|
ham.label Ham
|
105
|
104
|
ham.draw STACK""",
|
106
|
105
|
lambda data: """\
|
|
@@ -305,7 +304,7 @@ if __name__ == "__main__":
|
305
|
304
|
# Tests
|
306
|
305
|
#
|
307
|
306
|
|
308
|
|
-JSON: Final = r"""{\
|
|
307
|
+JSON = r"""{\
|
309
|
308
|
"version":"3.4","config_id":"1234","uptime":16991,"read_only":false,\
|
310
|
309
|
"scanned":43,"learned":43,"actions":\
|
311
|
310
|
{"reject":0,"soft reject":0,"rewrite subject":0,"add header":5,\
|
|
@@ -324,7 +323,7 @@ null,null,null,null,null,null,null,null,null,null,null,null,null\
|
324
|
323
|
"type":"redis","languages":0,"users":1}],\
|
325
|
324
|
"fuzzy_hashes":{"local":0,"rspamd.com":1872513971},"scan_time":0.02}"""
|
326
|
325
|
|
327
|
|
-EXPTS: Final = {
|
|
326
|
+EXPTS = {
|
328
|
327
|
"actions": [
|
329
|
328
|
"reject.value 0",
|
330
|
329
|
"soft_reject.value 0",
|