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)

Usage:

Id("$Id$")

Returns “an id” in test report.

class htf.Revision(value)

Usage:

class Test(TestCase):

    Revision = Revision("$Revision$")

Returns “a revision” in test report.

class htf.Rev(value)

Usage:

class Test(TestCase):

    Rev = Rev("$Rev$")

Returns “a revision” in test report.

Alias of Revision.

class htf.LastChangedRevision(value)

Usage:

class Test(TestCase):

    LastChangedRevision = LastChangedRevision("$LastChangedRevision$")

Returns “a revision” in test report.

Alias of Revision.

class htf.Date(value)

Usage:

class Test(TestCase):

    Date = Date("$Date$")

Returns “a date” in test report.

class htf.LastChangedDate(value)

Usage:

class Test(TestCase):

    LastChangedDate = LastChangedDate("$LastChangedDate$")

Returns “a date” in test report.

Alias of Date.

class htf.Header(value)

Usage:

class Test(TestCase):

    Header = Header("$Header$")

Returns “a header” in test report.

class htf.Author(value)

Usage:

class Test(TestCase):

    Author = Author("$Author$")

Returns “an author” in test report.

class htf.LastChangedBy(value)

Usage:

class Test(TestCase):

    LastChangedBy = LastChangedBy("$LastChangedBy$")

Returns the author of the last modification of the document.

Alias of Author.

class htf.Source(value)

Usage:

class Test(TestCase):

    Source = Source("$Source$")

Returns: “a source file” in test report.

class htf.HeadURL(value)

Usage:

class Test(TestCase):

    HeadURL = HeadURL("$HeadURL$")

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

class htf.URL(value)

Usage:

class Test(TestCase):

    URL = URL("$URL$")

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

Alias of HeadURL.

class htf.RCSFile(value)

Usage:

class Test(TestCase):

    RCSFile = RCSFile("$RCSFile$")

Returns: RCSFile marker

class htf.RCSfile(value)

Usage:

class Test(TestCase):

    RCSfile = RCSfile("$RCSfile$")

Returns: RCSfile marker

Alias of RCSFile.

Miscellaneous

class htf.markers.TestingframeworkVersion

Usage:

class Test(TestCase):

    testingframeworkVersion = TestingframeworkVersion()

Returns: “htf 0.14.0” in test report.