def test_SDtoD3(): sd = ScalarDistribution([(0, 1), (2, 3), (4, 5)], [1 / 3] * 3) d = SDtoD(sd) assert type(d) is Distribution assert d.outcome_length() == 2
def test_SDtoD2(): sd = ScalarDistribution([1]) sd[0] = 0 sd.make_sparse() with pytest.raises(InvalidDistribution): SDtoD(sd)
def test_SDtoD1(): sd = ScalarDistribution([1 / 4] * 4) d = SDtoD(sd) assert type(sd) is ScalarDistribution assert type(d) is Distribution
def test_SDtoD3(): sd = ScalarDistribution([(0, 1), (2, 3), (4, 5)], [1/3]*3) d = SDtoD(sd) assert type(d) is Distribution assert d.outcome_length() == 2
def test_SDtoD3(): sd = ScalarDistribution([(0, 1), (2, 3), (4, 5)], [1/3]*3) d = SDtoD(sd) assert_true(type(d) is Distribution) assert_equal(d.outcome_length(), 2)
def test_SDtoD3(): sd = ScalarDistribution([(0, 1), (2, 3), (4, 5)], [1 / 3] * 3) d = SDtoD(sd) assert_true(type(d) is Distribution) assert_equal(d.outcome_length(), 2)