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