You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 74381f7
Browse filesBrowse the repository at this point in the historyBrowse files
Shakeel Mohamed
committed
search command tests: clean up hard-coded paths and line numbers
# errors, if invoked to execute. Same error message as expected_pattern
119
+
# defined above
128
120
129
121
command=SearchCommand()
130
122
result=StringIO()
@@ -137,18 +129,21 @@ def test_process(self):
137
129
result.reset()
138
130
observed=result.read()
139
131
self.assertNotEqual(e.code, 0)
140
-
self.assertEqual(expected, observed)
132
+
self.assertTrue(expected_pattern.match(observed))
141
133
exceptBaseExceptionase:
142
134
self.fail("Expected SystemExit, but caught %s"%type(e))
143
135
else:
144
136
self.fail("Expected SystemExit, but no exception was raised")
145
137
146
138
# Command.process should exit on processing exceptions
147
139
148
-
expected=\
140
+
expected_pattern=re.compile(
149
141
'\r\n' \
150
142
'ERROR\r\n' \
151
-
'"TypeError at ""/Users/smohamed/git/splunk-sdk-python/splunklib/searchcommands/splunk_csv/dict_reader.py"", line 38 : \'NoneType\' object is not iterable"\r\n'
0 commit comments