Metadata

Tests can have metadata, i.e. the source filename, revision, id, etc. .

class htf.MetaData(value)

MetaData can be used to mark variables to be handled as meta data.

For example MetaData can be used to set additional attributes of a test case that is put into the meta data section of a test report.

Example usage:

from __future__ import \
    absolute_import, division, print_function, unicode_literals

import htf


class ExampleTestCase(htf.TestCase):
    Id = htf.MetaData("$Id: example.py, author, deadbeef $")
    Revision = htf.MetaData("$Revision: deadbeef $")

    def test_1(self):
        pass

if __name__ == "__main__":
    htf.main()

Keywords

Commonly keywords are used in source code, eg. $Id: ...$.

There are several metadata aliases for these keywords. The resulting metadata the content but not the keywords that is actually expanded.

class htf.Id(value)

Returns “an id” in test report.

Example Usage:

Id("$Id$")
class htf.Revision(value)

Returns “a revision” in test report.

Example Usage:

class Test(TestCase):

    Revision = Revision("$Revision$")
class htf.Rev(value)

Returns “a revision” in test report.

Alias of Revision.

Example Usage:

class Test(TestCase):

    Rev = Rev("$Rev$")
class htf.LastChangedRevision(value)

Returns “a revision” in test report.

Alias of Revision.

Example Usage:

class Test(TestCase):

    LastChangedRevision = LastChangedRevision("$LastChangedRevision$")
class htf.Date(value)

Returns “a date” in test report.

Example Usage:

class Test(TestCase):

    Date = Date("$Date$")
class htf.LastChangedDate(value)

Returns “a date” in test report.

Alias of Date.

Example Usage:

class Test(TestCase):

    LastChangedDate = LastChangedDate("$LastChangedDate$")
class htf.Header(value)

Returns “a header” in test report.

Example Usage:

class Test(TestCase):

    Header = Header("$Header$")
class htf.Author(value)

Returns “an author” in test report.

Example Usage:

class Test(TestCase):

    Author = Author("$Author$")
class htf.LastChangedBy(value)

Returns the author of the last modification of the document.

Alias of Author.

Example Usage:

class Test(TestCase):

    LastChangedBy = LastChangedBy("$LastChangedBy$")
class htf.Source(value)

Returns: “a source file” in test report.

Example Usage:

class Test(TestCase):

    Source = Source("$Source$")
class htf.HeadURL(value)

Returns: “https://server:port:/file” in test report.

Example Usage:

class Test(TestCase):

    HeadURL = HeadURL("$HeadURL$")
class htf.URL(value)

Returns: “https://server:port:/file” in test report.

Alias of HeadURL.

Example Usage:

class Test(TestCase):

    URL = URL("$URL$")
class htf.RCSFile(value)

Returns: RCSFile marker

Example Usage:

class Test(TestCase):

    RCSFile = RCSFile("$RCSFile$")
class htf.RCSfile(value)

Returns: RCSfile marker

Alias of RCSFile.

Example Usage:

class Test(TestCase):

    RCSfile = RCSfile("$RCSfile$")

Miscellaneous

class htf.markers.TestingframeworkVersion

Returns: “htf-<htf-version> on Python <python-version>” in test report.

Example Usage:

class Test(TestCase):

    testingframeworkVersion = TestingframeworkVersion()