tests.calculation
Submodules
tests.calculation.test_aperture
- class tests.calculation.test_aperture.TestApertureEdgeCases(methodName='runTest')[source]
Bases:
TestCasetests aperture-class with different edge/false and usual input for different radius, amount and end correction types (open/flange).
tests.calculation.test_geometry
- class tests.calculation.test_geometry.TestGeometry(methodName='runTest')[source]
Bases:
TestCaseTests formulas for volume calculation with different false/ edge and usaual input
- classmethod setUpClass()[source]
Hook method for setting up class fixture before running tests in the class.
- test_cuboid_with_radius_height()[source]
Expect TraitError when cuboid given parameters for cylinder calculation
tests.calculation.test_medium
- class tests.calculation.test_medium.TestMedium(methodName='runTest')[source]
Bases:
TestCaseUnit Tests für die Medium-Klasse. Testet Randwerte und Out-of-Range-Werte für Temperatur und relative Feuchte.
- expected_kinematic_viscosity(temp_celsius, rho)[source]
Compute expected kinematic viscosity (m²/s).
- classmethod setUpClass()[source]
Liest einmalig die physikalischen Grenzen und Standardwerte aus den Traits der Medium-Klasse aus.
tests.calculation.test_resonator
- class tests.calculation.test_resonator.TestResonator(methodName='runTest')[source]
Bases:
TestCaseUnit tests for the Resonator class which works as a container for aperture and geometry.
- test_from_dict_reconstruction()[source]
Tests whether a Resonator can be correctly restructured from its representation in the dictionary.
tests.calculation.test_simulation_parameters
- class tests.calculation.test_simulation_parameters.TestSimulationParameters(methodName='runTest')[source]
Bases:
TestCaseUnit tests for the SimulationParameters class. These tests check the correctness of frequency calculation, physical relationships, and input validation via Traits.
- test_dependent_arrays()[source]
Test that the arrays omega, k, and wavelength are calculated correctly.
- test_diffuse_sets_angle_zero()[source]
Test that setting assume_diffuse to True resets the angle of incidence to 0°. This mimics a uniformly distributed sound field.
- test_freq_mon_increase()[source]
Test that the generated frequency vector is strictly increasing. Ensures that no invalid or unordered values exist.
- test_freq_range_too_low_trait_error()[source]
Test that defining a frequency range with a minimum below 0.01 Hz raises a TraitError. The lower bound for freq_range is set to 1.0 Hz in the class definition.
- test_frequency_vector_length()[source]
Test that the number of calculated frequencies matches: number of octaves × values_per_octave. Ensures correct log spacing and resolution.