Skip to content

Commit

Permalink
Adds more tests for the registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Krienbühl committed Feb 6, 2015
1 parent a4d7b6c commit b5c75c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libres/tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ def test_autocreate():
assert r.get_context('yo') is ctx


def test_assert_existence():
r = Registry()

with pytest.raises(errors.UnknownContext):
r.assert_exists('foo')

r.register_context('foo')

with pytest.raises(errors.ContextAlreadyExists):
r.assert_does_not_exist('foo')


def test_replace():
r = Registry()

Expand Down

0 comments on commit b5c75c4

Please sign in to comment.