Skip to content

Commit

Permalink
Test error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rlmv committed Feb 20, 2018
1 parent 294314e commit 1ade50d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyphi/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def repertoire(self, direction, mechanism, purview):
return self.cause_repertoire(mechanism, purview)
elif direction == Direction.EFFECT:
return self.effect_repertoire(mechanism, purview)
# TODO: test that ValueError is raised

return validate.direction(direction)

def unconstrained_repertoire(self, direction, purview):
Expand Down
6 changes: 5 additions & 1 deletion test/test_subsystem_cause_effect_repertoire.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest

import example_networks
from pyphi import Subsystem
from pyphi import Direction, Subsystem
from pyphi.models import Cut

# Get example networks
Expand Down Expand Up @@ -356,4 +356,8 @@ def test_cause_and_effect_repertoire(function, subsystem, mechanism, purview,
assert np.array_equal(result, expected)


def test_repertoire_wrong_direction_error(s):
with pytest.raises(ValueError):
s.repertoire(Direction.BIDIRECTIONAL, (0,), (0, 1))

# vim: set foldmarker={{{,}}} foldlevel=0 foldmethod=marker :

0 comments on commit 1ade50d

Please sign in to comment.