def test_get_cov_from_canform(): """ Test that the _update_covform function is called before returning the covariance parameter. """ gaussian_a = Gaussian(prec=2.0, h_vec=1.0, g_val=0.0, var_names=["a"]) expect(Gaussian, times=1)._update_covform() gaussian_a.get_cov() verifyNoUnwantedInteractions() unstub()
def test_get_cov(self): """ Test that the correct covariance is returned. """ gaussian_a = Gaussian(cov=2.0, mean=1.0, log_weight=0.0, var_names=["a"]) self.assertTrue(np.array_equal(gaussian_a.get_cov(), np.array([[2.0]])))