Skip to main content

K5Test

k5test is a library for setting up self-contained Kerberos 5 environments, and running Python unit tests inside those environments. It is based on the file of the same name found alongside the MIT Kerberos 5 unit tests.

Using k5test to set up a Kerberos 5 deployment

k5test can be used to set up a self-contained MIT krb5 or Heimdal environment. This is useful for testing applications without having to manipulate existing Kerberos realms, or having to set up a full Kerberos deployment by hand.

To set up a realm, use the k5test.K5Realm class. The constructor accepts several useful arguments for controlling which parts get set up; refer to the inline documentation for more information.

Using k5test to run unit tests

Instead of having test cases inherit from unittest.TestCase, inherit from k5test.KerberosTestCase, which will automatically set up a Kerberos 5 environment, before the test case, and tear it down afterwards.

Additionally, several decorators are defined. the k5test.gssapi_extension_test(extension_name, human_readable_name) decorator (which requires python-gssapi) allows you to skip tests with installations that don’t support a particular GSSAPI extension. The the k5test.krb_minversion_test(target_version, problem_name) decorator allows you to skip tests when running a version of krb5 less that the required version. The k5test.krb_plugin_test(plugin_type, plugin_name) decorator allows you to skip tests for installations that don’t have a particular plugin installed.

Metadata

Release files for k5test 0.10.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k5test 0.10.4
File Size Uploaded
k5test-0.10.4.tar.gz 13.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for k5test 0.10.4
File Interpreter ABI Platform
k5test-0.10.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 25.6 kB

Release files / k5test-0.10.4.tar.gz

Download URL k5test-0.10.4.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e152491e6602f6a93b3d533d387bd4590f2476093b6842170ff0b93de64bef30
BLAKE2b-256 checksum
How to use checksums
5e3bf65afbc2e1fb7e728cb3abd3fac872aad9dc0e222d343ac24675713bfb41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / k5test-0.10.4-py2.py3-none-any.whl

Download URL k5test-0.10.4-py2.py3-none-any.whl
Size 12.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
33de7ff10bf99155fe8ee5d5976798ad1db6237214306dadf5a0ae9d6bb0ad03
BLAKE2b-256 checksum
How to use checksums
b5bad86d465c589cbed8f872e187e90abbac73eb1453483477771e87e7ee8376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.10.4 This release

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.10.0

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page