Exemple #1
0
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
Exemple #2
0
def test_SDtoD2():
    sd = ScalarDistribution([1])
    sd[0] = 0
    sd.make_sparse()
    with pytest.raises(InvalidDistribution):
        SDtoD(sd)
Exemple #3
0
def test_SDtoD1():
    sd = ScalarDistribution([1 / 4] * 4)
    d = SDtoD(sd)
    assert type(sd) is ScalarDistribution
    assert type(d) is Distribution
Exemple #4
0
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
Exemple #5
0
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)
Exemple #6
0
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)