def test_set_mu(self): p = JointNormal(labels=['x', 'y'], mu=np.array([0, 0]), cov=np.array([[1e-19, 1e-19], [1e-19, 1e-19]])) p.mu = self.mu self.assertAlmostEqual(p.mu[0, 0], self.mu[0]) self.assertAlmostEqual(p.mu[1, 0], self.mu[1])
def test_set_mu_bad(self): p = JointNormal(labels=['x', 'y'], mu=np.array([0, 0]), cov=np.array([[1e-19, 1e-19], [1e-19, 1e-19]])) with self.assertRaises(ValueError): p.mu = [1, 2, 3]