From bc1053e49a858212fc4da29cd4a6f8989e92070d Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Tue, 3 Nov 2020 17:28:50 +0100 Subject: [PATCH] Adding test on expiration aerosols (should be independent on particle_sizes order) --- cara/tests/test_known_quantities.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cara/tests/test_known_quantities.py b/cara/tests/test_known_quantities.py index 5a11e4ae..82c3ac71 100644 --- a/cara/tests/test_known_quantities.py +++ b/cara/tests/test_known_quantities.py @@ -139,3 +139,12 @@ def test_periodic_hepa(baseline_periodic_hepa, baseline_room): aes = [baseline_periodic_hepa.air_exchange(baseline_room, t) for t in ts] answers = [0, rate, rate, 0, 0, 0, rate, 0, 0] npt.assert_allclose(aes, answers, rtol=1e-5) + + +def test_expiration_aerosols(): + mask = models.Mask.types['Type I'] + exp1 = models.Expiration((0.751, 0.139, 0.0139, 0.059), + particle_sizes = (0.8e-4, 1.8e-4, 3.5e-4, 5.5e-4)) + exp2 = models.Expiration((0.059, 0.0139, 0.751, 0.139), + particle_sizes = (5.5e-4, 3.5e-4, 0.8e-4, 1.8e-4)) + npt.assert_allclose(exp1.aerosols(mask), exp2.aerosols(mask), rtol=1e-5)