Add unit test helpers for building certificate-related data.

Review Request #13257 — Created Sept. 5, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

This introduces three new test helper methods:

  • TestCase.create_certificate()
  • TestCase.create_certificate_bundle()
  • TestCase.create_certificate_fingerprints()

These are used to create certificate-related objects for testing, with
pre-populated data.

create_certificate() defaults to hard-coded certificate values but no
certificate data. If cert_data is passed in, then default values are
loaded from the data instead.

Unit tests pass.

Used some of these in in-progress code.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add unit test helpers for building certificate-related data.
This introduces three new test helper methods: * `TestCase.create_certificate()` * `TestCase.create_certificate_bundle()` * `TestCase.create_certificate_fingerprints()` These are used to create certificate-related objects for testing, with pre-populated data. `create_certificate()` defaults to hard-coded certificate values but no certificate data. If ``cert_data`` is passed in, then default values are loaded from the data instead.
1d62bb9988d85510271f059db87a2926a3070f52 Christian Hammond
reviewboard/certs/cert.py
reviewboard/testing/testcase.py
Loading...