diff --git a/test/prior_tests.py b/test/prior_tests.py index bca3df485996461a62fbc205325810f9e1e08fcb..b6d8ad2fe9f88e61f8c7ad60f8e423e7afbdcb87 100644 --- a/test/prior_tests.py +++ b/test/prior_tests.py @@ -24,6 +24,18 @@ class TestPriorInstantiationWithoutOptionalPriors(unittest.TestCase): def test_class_instance(self): self.assertIsInstance(self.prior, tupak.prior.Prior) + def test_magic_call_is_the_same_as_sampling(self): + self.prior = Mock(return_value=0.5) + self.assertEqual(self.prior.sample(), self.p()) + + def test_base_rescale_method(self): + self.assertIsNone(self.prior.rescale()) + + def test_base_repr(self): + self.prior = tupak.prior.Prior(name='test_name', latex_label='test_label', minimum=0, maximum=1) + expected_string = "Prior(name='test_name', latex_label='test_label', minimum=0, maximum=1)" + self.assertEqual(expected_string, self.prior.__repr__()) + class TestPriorName(unittest.TestCase):