From ce47733c42d0505e20adf3b2a4cff2b27eb10a24 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 2 Nov 2019 14:12:09 -0400 Subject: [PATCH] [Test] Fix coverage consistency issue in getMixDiffCoeffsMole --- interfaces/cython/cantera/test/test_transport.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/test/test_transport.py b/interfaces/cython/cantera/test/test_transport.py index 7a4fd4a15..6f157cb2a 100644 --- a/interfaces/cython/cantera/test/test_transport.py +++ b/interfaces/cython/cantera/test/test_transport.py @@ -28,7 +28,6 @@ class TestTransport(utilities.CanteraTest): self.assertTrue(all(np.diff(Dkm_prime) < 2*eps)) self.assertNear(Dkm_prime[0], alpha) - def test_mixtureAveraged(self): self.assertEqual(self.phase.transport_model, 'Mix') Dkm1 = self.phase.mix_diff_coeffs @@ -47,6 +46,15 @@ class TestTransport(utilities.CanteraTest): self.assertArrayNear(Dbin1, Dbin2) self.assertArrayNear(Dbin1, Dbin1.T) + def test_mixDiffCoeffsMole(self): + # This test is mainly to make code coverage in GasTransport.cpp + # consistent by always covering the path where the binary diffusion + # coefficients need to be updated + Dkm1 = self.phase.mix_diff_coeffs_mole + self.phase.TP = self.phase.T + 1, None + Dkm2 = self.phase.mix_diff_coeffs_mole + self.assertTrue(all(Dkm2 > Dkm1)) + def test_CK_mode(self): mu_ct = self.phase.viscosity self.phase.transport_model = 'CK_Mix'