You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
suggestion (testing): Add edge case tests for GasSpecies
Consider adding tests for edge cases, such as creating a GasSpecies with extreme values (very large or very small) for molar mass or concentration. Also, test the behavior when invalid inputs are provided.
def test_gas_species_builder_single_species():
"""Test building a single gas species with the GasSpeciesBuilder."""
vapor_pressure_strategy = ConstantVaporPressureStrategy(vapor_pressure=101325)
name = "Oxygen"
molar_mass = 0.032 # kg/mol
condensable = False
concentration = 1.2 # kg/m^3
suggestion (testing): Add test for mismatched array lengths
Add a test case where the input arrays (names, molar_masses, etc.) have different lengths to ensure the GasSpecies class handles this scenario correctly, either by raising an appropriate exception or handling it gracefully.
def test_gas_species_builder_array_species():
"""Test building an array of gas species with the GasSpeciesBuilder."""
vapor_pressure_strategy = ConstantVaporPressureStrategy(
vapor_pressure=np.array([101325, 101325]))
names = np.array(["Oxygen", "Nitrogen"])
molar_masses = np.array([0.032, 0.028]) # kg/mol
condensables = np.array([False, False])
concentrations = np.array([1.2, 0.8]) # kg/m^3
suggestion (testing): Add edge case tests for GasSpecies
Consider adding tests for edge cases, such as creating a GasSpecies with extreme values (very large or very small) for molar mass or concentration. Also, test the behavior when invalid inputs are provided.
def test_gas_species_builder_single_species():
"""Test building a single gas species with the GasSpeciesBuilder."""
vapor_pressure_strategy = ConstantVaporPressureStrategy(vapor_pressure=101325)
name = "Oxygen"
molar_mass = 0.032 # kg/mol
condensable = False
concentration = 1.2 # kg/m^3
def test_gas_species_builder_edge_cases():
"""Test edge cases for GasSpecies creation."""
with pytest.raises(ValueError):
GasSpecies(name="Invalid", molar_mass=-1, vapor_pressure_strategy=None, condensable=True, concentration=0)
The text was updated successfully, but these errors were encountered: