forked from splunk/splunk-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:splunk/splunk-sdk-python into dev…
…elop
- Loading branch information
Showing
11 changed files
with
108 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,8 +111,8 @@ def splunk_restart(uri, auth): | |
|
||
|
||
class AnalyzeCommand(Command): | ||
""" | ||
setup.py command to run code coverage of the test suite. | ||
""" | ||
setup.py command to run code coverage of the test suite. | ||
""" | ||
description = 'Create an HTML coverage report from running the full test suite.' | ||
|
@@ -367,8 +367,8 @@ def _link_debug_client(self): | |
|
||
|
||
class TestCommand(Command): | ||
""" | ||
setup.py command to run the whole test suite. | ||
""" | ||
setup.py command to run the whole test suite. | ||
""" | ||
description = 'Run full test suite.' | ||
|
@@ -439,7 +439,7 @@ def run(self): | |
setup( | ||
description='Custom Search Command examples', | ||
name=os.path.basename(project_dir), | ||
version='1.6.13', | ||
version='1.6.14', | ||
author='Splunk, Inc.', | ||
author_email='[email protected]', | ||
url='http://github.com/splunk/splunk-sdk-python', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import io | ||
import gzip | ||
import sys | ||
|
||
from os import path | ||
|
||
from splunklib import six | ||
from splunklib.searchcommands import StreamingCommand, Configuration | ||
|
||
|
||
def build_test_command(): | ||
@Configuration() | ||
class TestSearchCommand(StreamingCommand): | ||
def stream(self, records): | ||
for record in records: | ||
yield record | ||
|
||
return TestSearchCommand() | ||
|
||
|
||
def get_input_file(name): | ||
return path.join( | ||
path.dirname(path.dirname(__file__)), 'data', 'custom_search', name + '.gz') | ||
|
||
|
||
def test_multibyte_chunked(): | ||
data = gzip.open(get_input_file("multibyte_input")) | ||
if not six.PY2: | ||
data = io.TextIOWrapper(data) | ||
cmd = build_test_command() | ||
cmd._process_protocol_v2(sys.argv, data, sys.stdout) | ||
|
||
|
||
def test_v1_searchcommand(): | ||
data = gzip.open(get_input_file("v1_search_input")) | ||
if not six.PY2: | ||
data = io.TextIOWrapper(data) | ||
cmd = build_test_command() | ||
cmd._process_protocol_v1(["test_script.py", "__EXECUTE__"], data, sys.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters