Metadata

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

class htf.MetaData(value: str | bytes)

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:

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: str | bytes)

Returns “an id” in test report.

Example Usage:

Id("$Id$")
class htf.Revision(value: str | bytes)

Returns “a revision” in test report.

Example Usage:

class Test(TestCase):

    Revision = Revision("$Revision$")
class htf.Rev(value: str | bytes)

Returns “a revision” in test report.

Alias of Revision.

Example Usage:

class Test(TestCase):

    Rev = Rev("$Rev$")
class htf.LastChangedRevision(value: str | bytes)

Returns “a revision” in test report.

Alias of Revision.

Example Usage:

class Test(TestCase):

    LastChangedRevision = LastChangedRevision("$LastChangedRevision$")
class htf.Date(value: str | bytes)

Returns “a date” in test report.

Example Usage:

class Test(TestCase):

    Date = Date("$Date$")
class htf.LastChangedDate(value: str | bytes)

Returns “a date” in test report.

Alias of Date.

Example Usage:

class Test(TestCase):

    LastChangedDate = LastChangedDate("$LastChangedDate$")
class htf.Header(value: str | bytes)

Returns “a header” in test report.

Example Usage:

class Test(TestCase):

    Header = Header("$Header$")
class htf.Author(value: str | bytes)

Returns “an author” in test report.

Example Usage:

class Test(TestCase):

    Author = Author("$Author$")
class htf.LastChangedBy(value: str | bytes)

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: str | bytes)

Returns: “a source file” in test report.

Example Usage:

class Test(TestCase):

    Source = Source("$Source$")
class htf.HeadURL(value: str | bytes)

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

Example Usage:

class Test(TestCase):

    HeadURL = HeadURL("$HeadURL$")
class htf.URL(value: str | bytes)

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

Alias of HeadURL.

Example Usage:

class Test(TestCase):

    URL = URL("$URL$")
class htf.RCSFile(value: str | bytes)

Returns: RCSFile marker

Example Usage:

class Test(TestCase):

    RCSFile = RCSFile("$RCSFile$")
class htf.RCSfile(value: str | bytes)

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()