コード例 #1
0
def test_subsystem_validation(s):
    # Wrong state length.
    with pytest.raises(ValueError):
        s = Subsystem(s.network, (0, 0), s.node_indices)
    # Wrong state values.
    with pytest.raises(ValueError):
        s = Subsystem(s.network, (2, 0, 0), s.node_indices)
    # Disallow impossible states at subsystem level (we don't want to return a
    # phi-value associated with an impossible state).
    net = example_networks.simple()
    with pytest.raises(exceptions.StateUnreachableError):
        s = Subsystem(net, (0, 1, 0), s.node_indices)
コード例 #2
0
ファイル: test_subsystem.py プロジェクト: B1sounours/pyphi
def test_subsystem_validation(s):
    # Wrong state length.
    with pytest.raises(ValueError):
        s = Subsystem(s.network, (0, 0), s.node_indices)
    # Wrong state values.
    with pytest.raises(ValueError):
        s = Subsystem(s.network, (2, 0, 0), s.node_indices)
    # Disallow impossible states at subsystem level (we don't want to return a
    # phi-value associated with an impossible state).
    net = example_networks.simple()
    with pytest.raises(validate.StateUnreachableError):
        s = Subsystem(net, (0, 1, 0), s.node_indices)
コード例 #3
0
ファイル: conftest.py プロジェクト: wmayner/pyphi
def simple():
    return example_networks.simple()
コード例 #4
0
def simple():
    return example_networks.simple()