(self, random_mock)
| 1199 | |
| 1200 | @unittest.mock.patch('random.Random.random') |
| 1201 | def test_gammavariate_alpha_equal_one(self, random_mock): |
| 1202 | |
| 1203 | # #2.a: alpha == 1. |
| 1204 | # The execution body of the while loop executes once. |
| 1205 | # Then random.random() returns 0.45, |
| 1206 | # which causes while to stop looping and the algorithm to terminate. |
| 1207 | random_mock.side_effect = [0.45] |
| 1208 | returned_value = random.gammavariate(1.0, 3.14) |
| 1209 | self.assertAlmostEqual(returned_value, 1.877208182372648) |
| 1210 | |
| 1211 | @unittest.mock.patch('random.Random.random') |
| 1212 | def test_gammavariate_alpha_equal_one_equals_expovariate(self, random_mock): |
nothing calls this directly
no test coverage detected