Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k5test-0.10.2.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

k5test-0.10.2-py2.py3-none-any.whl (11.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file k5test-0.10.2.tar.gz.

File metadata

  • Download URL: k5test-0.10.2.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for k5test-0.10.2.tar.gz
Algorithm Hash digest
SHA256 411430e02c723bcdcf6669bfe28b442557afbc7f524f8a97d1f9cf29b488590f
MD5 84146fd351deedbc51b6374e16070204
BLAKE2b-256 09bfbb88a2955d2c076306e60851b8de3bcd8ef86e9b48ab79fb7633a9e66ea8

See more details on using hashes here.

Provenance

File details

Details for the file k5test-0.10.2-py2.py3-none-any.whl.

File metadata

  • Download URL: k5test-0.10.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for k5test-0.10.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 21018fd69dd110567c66f0ff3c81fe03c609b96e747d026af0d6ef4bc8bd2417
MD5 7886aa5fa9b8a0e6cd8bcb3b729b2fb1
BLAKE2b-256 fddb96f6201f8672daa2550a1ac866b2fe3d8f10c112b0d75f464fc207c46766

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page