Skip to content

Commit

Permalink
Basic test added for setting a universe with kwargs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dotsdl committed Apr 3, 2016
1 parent b5464e4 commit 4dc9061
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/mdsynthesis/tests/test_treants.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ def test_set_universe_chainreader(self, treant):
assert treant.udef.topology == GRO
assert treant.udef.trajectory == [XTC, XTC]

def test_set_universe_with_kwargs(self, treant):
"""Universe should preserve its kwargs, if possible.
Test that setting a Universe for a Sim also gets its kwargs
preserved, that an exception is raised for unserializable kwargs,
and that a proper warning is geven when the Sim can't get them from
the Universe in the first place.
"""
u = mda.Universe(PDB, XTC, something_fake=True)

treant.universe = u

assert treant.udef.kwargs['something_fake'] is True

def test_add_univese_typeerror(self, treant):
"""Test checking of what is passed to setter"""
with pytest.raises(TypeError):
Expand Down

0 comments on commit 4dc9061

Please sign in to comment.