Module test_utils

Source
Expand description

Test utilities

They contains:

  • A Open Api Spec tester
  • Some precomputed fake data and keys
  • A builder of MithrilFixture to generate signers alongside a stake distribution

Modules§

apispec
Tools to helps validate conformity to an OpenAPI specification
fake_data
Fake data builders for testing.
fake_keys
Pre hex encoded StmTypes for testing.
test_http_server
Define a HttpServer for test that can be configured using warp filters.

Macros§

assert_dir_eq
Compare a directory against a string representing its expected structure or against another directory.
assert_same_json
Compare two json strings ignoring keys order
current_function
Returns the name of the function that called this macro.
current_function_path
Returns the path of the function that called this macro.
temp_dir
Return a temporary directory based on the current function name.
temp_dir_create
Create and return a temporary directory based on the current function name.

Structs§

CardanoTransactionsBuilder
Builder to easily build transactions with consistent values.
CertificateChainBuilder
A builder for creating a certificate chain. For tests only.
CertificateChainBuilderContext
Context used while building a certificate chain. For tests only.
DirStructure
A structure to compare two directories in a human-readable way in tests.
MithrilFixture
A fixture of Mithril data types.
MithrilFixtureBuilder
A builder of mithril types.
SignerFixture
A signer fixture, containing a signer entity with its corresponding protocol signer and initializer
TempDir
A builder of temp directory for tests purpose.

Enums§

CertificateChainingMethod
Chaining method to use when building a certificate chain with the CertificateChainBuilder. For tests only.
StakeDistributionGenerationMethod
Methods that can be used to generate the stake distribution.

Functions§

assert_equivalent
Assert that two iterators are equivalent
equivalent_to
Compare two iterators ignoring the order
format_current_function_module
Return the path of the given function. If the last function is f, it is removed. The last {{closure}} is also removed.
format_current_function_path
Return a string representing the path of the given function.