Skip to content

Commit 27f92a5

Browse files
committed
add test for v1 search commands
1 parent 5d5eb8a commit 27f92a5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/searchcommands/test_multibyte_processing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,33 @@
77
from splunklib import six
88
from splunklib.searchcommands import StreamingCommand, Configuration
99

10+
1011
def build_test_command():
1112
@Configuration()
1213
class TestSearchCommand(StreamingCommand):
1314
def stream(self, records):
1415
for record in records:
1516
yield record
17+
1618
return TestSearchCommand()
1719

20+
1821
def get_input_file(name):
1922
return path.join(
2023
path.dirname(path.dirname(__file__)), 'data', 'custom_search', name + '.gz')
2124

25+
2226
def test_multibyte_chunked():
2327
data = gzip.open(get_input_file("multibyte_input"))
2428
if not six.PY2:
2529
data = io.TextIOWrapper(data)
2630
cmd = build_test_command()
2731
cmd._process_protocol_v2(sys.argv, data, sys.stdout)
32+
33+
34+
def test_v1_searchcommand():
35+
data = gzip.open(get_input_file("v1_search_input"))
36+
if not six.PY2:
37+
data = io.TextIOWrapper(data)
38+
cmd = build_test_command()
39+
cmd._process_protocol_v1(["test_script.py", "__EXECUTE__"], data, sys.stdout)

0 commit comments

Comments
 (0)