deltafi 1.1.13__py3-none-any.whl → 1.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of deltafi might be problematic. Click here for more details.
deltafi/result.py
CHANGED
|
@@ -101,22 +101,36 @@ class ErrorResult(Result):
|
|
|
101
101
|
super().__init__('error', 'ERROR', context)
|
|
102
102
|
self.error_cause = error_cause
|
|
103
103
|
self.error_context = error_context
|
|
104
|
+
self.annotations = {}
|
|
105
|
+
|
|
106
|
+
def annotate(self, key: str, value: str):
|
|
107
|
+
self.annotations[key] = value
|
|
108
|
+
return self
|
|
104
109
|
|
|
105
110
|
def response(self):
|
|
106
111
|
return {
|
|
107
112
|
'cause': self.error_cause,
|
|
108
|
-
'context': self.error_context
|
|
113
|
+
'context': self.error_context,
|
|
114
|
+
'annotations': self.annotations
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
|
|
112
118
|
class FilterResult(Result):
|
|
113
|
-
def __init__(self, context: Context, filtered_cause: str):
|
|
119
|
+
def __init__(self, context: Context, filtered_cause: str, filtered_context: str=None):
|
|
114
120
|
super().__init__('filter', 'FILTER', context)
|
|
115
121
|
self.filtered_cause = filtered_cause
|
|
122
|
+
self.filtered_context = filtered_context
|
|
123
|
+
self.annotations = {}
|
|
124
|
+
|
|
125
|
+
def annotate(self, key: str, value: str):
|
|
126
|
+
self.annotations[key] = value
|
|
127
|
+
return self
|
|
116
128
|
|
|
117
129
|
def response(self):
|
|
118
130
|
return {
|
|
119
|
-
'message': self.filtered_cause
|
|
131
|
+
'message': self.filtered_cause,
|
|
132
|
+
'context': self.filtered_context,
|
|
133
|
+
'annotations': self.annotations
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
|
deltafi/test_kit/framework.py
CHANGED
|
@@ -163,13 +163,15 @@ class TestCaseBase(ABC):
|
|
|
163
163
|
self.cause_regex = cause
|
|
164
164
|
self.context_regex = context
|
|
165
165
|
|
|
166
|
-
def expect_filter_result(self, cause: str):
|
|
166
|
+
def expect_filter_result(self, cause: str, context: str=None):
|
|
167
167
|
"""
|
|
168
168
|
A Sets the expected output of the action to a Filter Result
|
|
169
169
|
:param cause: the expected filter cause (message)
|
|
170
|
+
:param context: the expected error context (optional)
|
|
170
171
|
"""
|
|
171
172
|
self.expected_result_type = FilterResult
|
|
172
173
|
self.cause_regex = cause
|
|
174
|
+
self.context_regex = context
|
|
173
175
|
|
|
174
176
|
|
|
175
177
|
class ActionTest(ABC):
|
|
@@ -9,16 +9,16 @@ deltafi/input.py,sha256=DuY280ZglZxEUkhjTtyr0g9Ohu2drn16UVhASH244nA,6290
|
|
|
9
9
|
deltafi/logger.py,sha256=q76R_Gn8BfcASH3Zy0V82m5ot34bjTnSELyKbjhvx3E,2136
|
|
10
10
|
deltafi/metric.py,sha256=eIDjZQVO53KuAFoEtjLNFwqMrp_7BC0Td9GLD1tb6sE,967
|
|
11
11
|
deltafi/plugin.py,sha256=GkDq9oc5O0QYUZ7CdYcP1f9zRT38ufvzudZ4addHVS8,13076
|
|
12
|
-
deltafi/result.py,sha256=
|
|
12
|
+
deltafi/result.py,sha256=KkFKewPxcP8_Slp0D2COJ43h5_fF5Vti9ocWtp8pjpc,14911
|
|
13
13
|
deltafi/storage.py,sha256=toq58EPZgzj2TfDF-YpFUmRnsWSjACA0KQAZzkM04xU,2740
|
|
14
14
|
deltafi/test_kit/__init__.py,sha256=qv6y7PpBG0ekTN9EuD9Lj8JYOLVqZA6tvHwgjplncAM,709
|
|
15
15
|
deltafi/test_kit/assertions.py,sha256=2eahqmbedhnHXMguiJHdaV-6sx4_jvCbxH4HSzx6PV8,1378
|
|
16
16
|
deltafi/test_kit/compare_helpers.py,sha256=Oi07zsq7jlpAHxqjwHsea84acC3lAL3ooG0VC42lLAc,1581
|
|
17
17
|
deltafi/test_kit/constants.py,sha256=epz0OS-qILcc8t7iIs5B3m2-wvZx8FpYpyb19ZsImbI,833
|
|
18
18
|
deltafi/test_kit/format.py,sha256=YkF8VGuDp6fOxria332zoQJarmmPaN6fTjTuumzyMLI,4071
|
|
19
|
-
deltafi/test_kit/framework.py,sha256=
|
|
19
|
+
deltafi/test_kit/framework.py,sha256=R07AH4zxWXaJ3QNufGrtiOvdZrZKEoo2FtZLGmgAnRk,13062
|
|
20
20
|
deltafi/test_kit/load.py,sha256=W8LRW1-NYHdjPB9UJ7kAAKblv883Ke39v4jewwbfm60,4855
|
|
21
21
|
deltafi/test_kit/transform.py,sha256=x2TNTV39TmJQbVImm-sOfUlS_qaWcDRi5mfK4ZE0ONE,2608
|
|
22
|
-
deltafi-1.1.
|
|
23
|
-
deltafi-1.1.
|
|
24
|
-
deltafi-1.1.
|
|
22
|
+
deltafi-1.1.15.dist-info/METADATA,sha256=PzI9gUfVOZz5rYszjYSvHZyIhftU0QJEx6-gUXnnzGQ,1484
|
|
23
|
+
deltafi-1.1.15.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
24
|
+
deltafi-1.1.15.dist-info/RECORD,,
|
|
File without changes
|