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=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.data.TestFormatInterface

Create simple HTML report.

begin_run(environment, count=1)[source]

Called before first test.

begin_section(section)[source]

Called before each section.

end_test(result)[source]

Called after each test.

end_section()[source]

Called after each section.

end_run()[source]

Called after all test.

format(result)[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=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.data.TestFormatInterface

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

end_test(result)[source]

Called after each test.

format(result)[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=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.data.TestFormatInterface

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

begin_test(case, prefix='')[source]

Called before each test.

end_run()[source]

Called after all test.

end_test(result)[source]

Called after each test.

utf8(data)[source]
format(result)[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=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.data.TestFormatInterface

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

begin_run(environment, count=1)[source]

Called before first test.

end_test(result)[source]

Called after each test.

format(result)[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.Text(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.data.TestFormatInterface

Create simple text report.

begin_run(environment, count=1)[source]

Called before first test.

begin_section(section)[source]

Called before each section.

begin_test(case, prefix='')[source]

Called before each test.

end_test(result)[source]

Called after each test.

end_section()[source]

Called after each section.

format(result)[source]
>>> te = TestEnvironment()
>>> tc = TestCase('python/data.py')
>>> tr = TestResult(tc, te)
>>> tr.success()
>>> import io
>>> s = io.StringIO()
>>> Text(s).format(tr)
class univention.testing.format.text.Raw(stream=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]

Bases: univention.testing.format.text.Text

Create simple text report with raw file names.

begin_test(case, prefix='')[source]

Called before each test.