
class TestCoverageAnnotator(Component):
    """
    >>> from genshi.builder import tag
    >>> from trac.test import Mock, MockPerm
    >>> from trac.mimeview import Context
    >>> from bitten.model import Build, Report
    >>> from bitten.report.tests.coverage import env_stub_with_tables
    >>> env = env_stub_with_tables()

    >>> Build(env, rev=123, config='trunk', rev_time=12345, platform='any').insert()
    >>> rpt = Report(env, build=1, step='test', category='coverage')
    >>> rpt.items.append({'file': 'foo.py', 'line_hits': '5 - 0'})
    >>> rpt.insert()

    >>> ann = TestCoverageAnnotator(env)
    >>> req = Mock(href=Mock(), perm=MockPerm())
    >>> context = Context.from_request(req, 'source', 'foo.py', 123)
    >>> data = ann.get_annotation_data(context)
    >>> print data
    [5, None, 0]

    >>> def annotate_row(lineno, line):
    ...     row = tag.tr()
    ...     ann.annotate_row(context, row, lineno, line, data)
    ...     return str(row)

    >>> annotate_row(1, 'x = 1')
    '<tr><th style="background-color: #0f0">5</th></tr>'
    >>> annotate_row(2, '')
    '<tr><th></th></tr>'
    >>> annotate_row(3, 'y = x')
    '<tr><th style="background-color: #f00">0</th></tr>'
    """
    implements(IHTMLPreviewAnnotator)

    # IHTMLPreviewAnnotator methods

    def get_annotation_type(self):
        pass

    def get_annotation_data(self, context):
        pass

    def annotate_row(self, context, row, lineno, line, data):
        pass

