Core API

Core API is mostly made of healthcheck() function.

healthcheck

hospital.core.healthcheck(test)

Make test a healthcheck and return it.

Basically sets is_healthcheck attribute to True.

Can be used as a function-decorator:

>>> @healthcheck
... def test_dummy():
...     pass
>>> is_healthcheck(test_dummy)
True

Can be used as a class-decorator:

>>> import unittest
>>> @healthcheck
... class DummyTestCase(unittest.TestCase):
...     pass
>>> is_healthcheck(DummyTestCase)
True

Can be used to modify instance:

>>> def test_noop():
...     pass
>>> is_healthcheck(test_noop)
False
>>> healthcheck_noop = healthcheck(test_noop)
>>> is_healthcheck(healthcheck_noop)
True

HealthCheck

class hospital.core.HealthCheck(methodName='runTest')

Bases: unittest.case.TestCase

Base class for health checks, extends unittest.TestCase.

is_healthcheck = True

is_healthcheck

hospital.core.is_healthcheck(obj)

Return True if obj is an healthcheck.

Read the Docs v: 0.2
Versions
latest
0.2
0.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.