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=<open file '<stdout>', mode 'w'>)[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_run()[source]

Called after all test.

end_section()[source]

Called after each section.

end_test(result)[source]

Called after each test.

format(result)[source]

Format single test.

>>> from univention.testing.data import TestCase, TestEnvironment,                                              TestResult
>>> te = TestEnvironment()
>>> tc = TestCase()
>>> tc.uid = '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=<open file '<stdout>', mode 'w'>)[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,                                              TestResult
>>> te = TestEnvironment()
>>> tc = TestCase()
>>> tc.uid = '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=<open file '<stdout>', mode 'w'>)[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_test(result)[source]

Called after each test.

utf8(data)[source]
format(result)[source]
>>> from univention.testing.data import TestCase, TestEnvironment,                                              TestResult
>>> te = TestEnvironment()
>>> tc = TestCase()
>>> tc.uid = '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=<open file '<stdout>', mode 'w'>)[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, TestEnvironment,                                              TestResult
>>> te = TestEnvironment()
>>> tc = TestCase()
>>> tc.uid = '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=<open file '<stdout>', mode 'w'>)[source]

Bases: univention.testing.data.TestFormatInterface

Create simple text report.

_Text__term = <WeakValueDictionary at 140484918666592>
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_section()[source]

Called after each section.

end_test(result)[source]

Called after each test.

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