Skip to content

Commit 253784c

Browse files
committed
Multibyte test cleanup
1 parent 0780fc1 commit 253784c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
from splunklib.searchcommands import StreamingCommand, Configuration, dispatch
2-
import gzip
3-
import os
41
import io
2+
import gzip
53
import sys
64

5+
from os import path
6+
7+
from splunklib import six
8+
from splunklib.searchcommands import StreamingCommand, Configuration
79

810
def build_test_command():
911
@Configuration()
@@ -13,14 +15,13 @@ def stream(self, records):
1315
yield record
1416
return TestSearchCommand()
1517

16-
1718
def get_input_file(name):
18-
return "tests/data/custom_search/" + name + ".gz"
19-
19+
return path.join(
20+
path.dirname(path.dirname(__file__)), 'data', 'custom_search', name + '.gz')
2021

21-
def test_multibyte_chunked(capsys):
22+
def test_multibyte_chunked():
2223
data = gzip.open(get_input_file("multibyte_input"))
23-
if sys.version_info.major >= 3:
24+
if not six.PY2:
2425
data = io.TextIOWrapper(data)
2526
cmd = build_test_command()
2627
cmd._process_protocol_v2(sys.argv, data, sys.stdout)

0 commit comments

Comments
 (0)