Пример #1
0
def test_distribution_structures4():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=(2, 3), alphabet=(2, 4), uniform=False).example()
    assert dist.outcome_length() in [2, 3]
    assert set(dist.alphabet[0]) <= {0, 1, 2, 3}
Пример #2
0
def test_distribution_structures6():
    """
    A test for the distribution_structures strategy.
    """
    dists = distribution_structures(size=3, alphabet=2, uniform=True)
    example = find(dists, predicate)
    assert coinformation(example) <= -1 / 2
Пример #3
0
def test_distribution_structures6():
    """
    A test for the distribution_structures strategy.
    """
    dists = distribution_structures(size=3, alphabet=2, uniform=True)
    example = find(dists, predicate)
    assert coinformation(example) <= -1/2
Пример #4
0
def test_distribution_structures4():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=(2, 3), alphabet=(2, 4), uniform=False).example()
    assert dist.outcome_length() in [2, 3]
    assert set(dist.alphabet[0]) <= {0, 1, 2, 3}
Пример #5
0
def test_distributions2(dist):
    """
    A test for the distributions strategy.
    """
    assert dist.alphabet == ((0, 1), (0, 1))


@given(dist=distributions(alphabets=((2, 2), (2, 2))))
def test_distributions3(dist):
    """
    A test for the distributions strategy.
    """
    assert dist.alphabet == ((0, 1), (0, 1))


@given(dist=distribution_structures(size=1, alphabet=2))
def test_distribution_structures1(dist):
    """
    A test for the distributions strategy.
    """
    assert dist.alphabet == ((0, 1), )


@given(dist=distribution_structures(size=(2, 4), alphabet=2))
def test_distribution_structures2(dist):
    """
    A test for the distributions strategy.
    """
    assert dist.outcome_length() in [2, 3, 4]

Пример #6
0
def test_distribution_structures2():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=(2, 4), alphabet=2).example()
    assert dist.outcome_length() in [2, 3, 4]
Пример #7
0
def test_distribution_structures1():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=1, alphabet=2).example()
    assert dist.alphabet == ((0, 1), )
Пример #8
0
def test_distribution_structures2():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=(2, 4), alphabet=2).example()
    assert dist.outcome_length() in [2, 3, 4]
Пример #9
0
def test_distribution_structures1():
    """
    A test for the distributions strategy.
    """
    dist = distribution_structures(size=1, alphabet=2).example()
    assert dist.alphabet == ((0, 1),)