def test_DtoSD2(): outcomes = [(0, ), (2, ), (4, )] pmf = [1 / 3] * 3 d = Distribution(outcomes, pmf) sd = DtoSD(d, True) assert type(sd) is ScalarDistribution assert sd.outcomes == (0, 2, 4)
def test_DtoSD1(): outcomes = ['00', '01', '10', '11'] pmf = [1 / 4] * 4 d = Distribution(outcomes, pmf) sd = DtoSD(d, False) assert type(d) is Distribution assert type(sd) is ScalarDistribution