Skip to content

Commit 6308a25

Browse files
author
Shakeel Mohamed
committed
Minor changes to modinput tests, plus a critical fix to the data_open function
1 parent d84c2f4 commit 6308a25

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

splunklib/modularinput/event_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def write_xml_document(self, document):
7676
7777
:param document: An ``ElementTree`` object.
7878
"""
79-
self._out.write(ET.tostring(document, "utf-8", "xml"))
79+
self._out.write(ET.tostring(document))
8080
self._out.flush()
8181

8282
def close(self):

tests/modularinput/modularinput_testlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
from splunklib.modularinput.utils import xml_compare, parse_xml_data, parse_parameters
2727

2828
def data_open(filepath):
29-
return os.path.join(os.path.dirname(os.path.abspath(__file__)), filepath)
29+
return open(os.path.join(os.path.dirname(os.path.abspath(__file__)), filepath))

tests/modularinput/test_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
except ImportError:
3030
import xml.etree.ElementTree as ET
3131

32-
TEST_SCRIPT_PATH = "__IGNORED_SCRIPT_PATH__" #TODO: replace empty first args...
32+
TEST_SCRIPT_PATH = "__IGNORED_SCRIPT_PATH__"
3333

3434
class ScriptTest(unittest.TestCase):
3535

0 commit comments

Comments
 (0)