Skip to content

Added missing setters for some TestCase class members. #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion junit_xml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def to_file(file_descriptor, test_suites, prettyprint=True, encoding=None):
def _clean_illegal_xml_chars(string_to_clean):
"""
Removes any illegal unicode characters from the given XML string.

@see: http://stackoverflow.com/questions/1707890/fast-way-to-filter-illegal-xml-unicode-chars-in-python
"""

Expand Down Expand Up @@ -285,6 +285,22 @@ def __init__(self, name, classname=None, elapsed_sec=None, stdout=None,
self.skipped_message = None
self.skipped_output = None

def add_elapsed_time_in_sec(self, elapsed_sec):
"""Adds/Updates the test duration to the testcase, test time is in seconds only"""
self.elapsed_sec = elapsed_sec

def add_classname(self, classname):
"""Adds/Updates a classname to the testcase"""
self.classname = classname

def add_stdout(self, stdout):
"""Adds/Updates the stdout to the testcase"""
self.stdout = stdout

def add_stderr(self, stderr):
"""Adds/Updates the stderr to the testcase"""
self.stderr = stderr

def add_error_info(self, message=None, output=None):
"""Adds an error message, output, or both to the test case"""
if message:
Expand Down