(self)
| 1025 | |
| 1026 | class TestDistributions(unittest.TestCase): |
| 1027 | def test_zeroinputs(self): |
| 1028 | # Verify that distributions can handle a series of zero inputs' |
| 1029 | g = random.Random() |
| 1030 | x = [g.random() for i in range(50)] + [0.0]*5 |
| 1031 | g.random = x[:].pop; g.uniform(1,10) |
| 1032 | g.random = x[:].pop; g.paretovariate(1.0) |
| 1033 | g.random = x[:].pop; g.expovariate(1.0) |
| 1034 | g.random = x[:].pop; g.expovariate() |
| 1035 | g.random = x[:].pop; g.weibullvariate(1.0, 1.0) |
| 1036 | g.random = x[:].pop; g.vonmisesvariate(1.0, 1.0) |
| 1037 | g.random = x[:].pop; g.normalvariate(0.0, 1.0) |
| 1038 | g.random = x[:].pop; g.gauss(0.0, 1.0) |
| 1039 | g.random = x[:].pop; g.lognormvariate(0.0, 1.0) |
| 1040 | g.random = x[:].pop; g.vonmisesvariate(0.0, 1.0) |
| 1041 | g.random = x[:].pop; g.gammavariate(0.01, 1.0) |
| 1042 | g.random = x[:].pop; g.gammavariate(1.0, 1.0) |
| 1043 | g.random = x[:].pop; g.gammavariate(200.0, 1.0) |
| 1044 | g.random = x[:].pop; g.betavariate(3.0, 3.0) |
| 1045 | g.random = x[:].pop; g.triangular(0.0, 1.0, 1.0/3.0) |
| 1046 | |
| 1047 | def test_avg_std(self): |
| 1048 | # Use integration to test distribution average and standard deviation. |
nothing calls this directly
no test coverage detected