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.
Example Usage:
Id("$Id$")
Example Usage:
class Test(TestCase):
Revision = Revision("$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$")
Example Usage:
class Test(TestCase):
Date = Date("$Date$")
Example Usage:
class Test(TestCase):
LastChangedDate = LastChangedDate("$LastChangedDate$")
Example Usage:
class Test(TestCase):
Header = Header("$Header$")
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$")
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$")
Example Usage:
class Test(TestCase):
RCSFile = RCSFile("$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()