univention.testing.format package#

Import all UCS Test formatters.

Submodules#

univention.testing.format.html module#

Format UCS Test results as HTML.

class univention.testing.format.html.HTML(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: TestFormatInterface

Create simple HTML report.

begin_run(environment: TestEnvironment, count: int = 1) None[source]#

Called before first test.

begin_section(section: str) None[source]#

Called before each section.

end_test(result: TestResult) None[source]#

Called after each test.

end_section() None[source]#

Called after each section.

end_run() None[source]#

Called after all test.

format(result: TestResult) None[source]#

Format single test.

>>> from univention.testing.data import TestCase
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> HTML().format(tr)

univention.testing.format.jenkins module#

Format UCS Test results as Jenkins report.

class univention.testing.format.jenkins.Jenkins(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: TestFormatInterface

Create Jenkins report. <https://wiki.jenkins-ci.org/display/JENKINS/Monitoring+external+jobs>

end_test(result: TestResult) None[source]#

Called after each test.

format(result: TestResult) None[source]#
>>> from univention.testing.data import TestCase, TestEnvironment
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> Jenkins().format(tr)

univention.testing.format.junit module#

Format UCS Test results as JUnit report.

class univention.testing.format.junit.Junit(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: TestFormatInterface

Create Junit report. <http://windyroad.org/dl/Open%20Source/JUnit.xsd>

begin_test(case: TestCase, prefix: str = '') None[source]#

Called before each test.

end_run()[source]#

Called after all test.

end_test(result: TestResult) None[source]#

Called after each test.

utf8(data: Any) str[source]#
format(result: TestResult) None[source]#
>>> from univention.testing.data import TestEnvironment
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> Junit().format(tr)

univention.testing.format.tap module#

Format UCS Test results as Test Anything Protocol report.

class univention.testing.format.tap.TAP(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: TestFormatInterface

Create simple Test-Anything-Protocol report. <http://testanything.org/wiki/index.php/Main_Page>

begin_run(environment: TestEnvironment, count: int = 1) None[source]#

Called before first test.

end_test(result: TestResult) None[source]#

Called after each test.

format(result: TestResult) None[source]#
>>> from univention.testing.data import TestCase
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> TAP().format(tr)
1..1

univention.testing.format.text module#

Format UCS Test results as simple text report.

class univention.testing.format.text.Raw(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: Text

Create simple text report with raw file names.

begin_test(case: TestCase, prefix: str = '') None[source]#

Called before each test.

class univention.testing.format.text.Text(stream: ~typing.IO[str] = <colorama.ansitowin32.StreamWrapper object>)[source]#

Bases: TestFormatInterface

Create simple text report.

begin_run(environment: TestEnvironment, count: int = 1) None[source]#

Called before first test.

begin_section(section: str) None[source]#

Called before each section.

begin_test(case: TestCase, prefix: str = '') None[source]#

Called before each test.

end_test(result: TestResult, end: str = '\n') None[source]#

Called after each test.

end_section() None[source]#

Called after each section.

format(result: TestResult) None[source]#
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> import io
>>> s = io.StringIO()
>>> Text(s).format(tr)