A library for testing Python applications in self-contained Kerberos 5 environments
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file k5test-0.10.0.tar.gz
.
File metadata
- Download URL: k5test-0.10.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc5e7e5e286b2f331c1396c33f2a1cd8cf34e78d8d482168a50ffd8576a1455c |
|
MD5 | 002b7e3a63ac26ed6e182f3965a70496 |
|
BLAKE2b-256 | 831ec6b81b1743c5a5b9fbda41db419f10feb25641410b7eefbcf2c666dc131a |