Skip to content

Commit

Permalink
Document how test_message_spec works
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Dec 4, 2012
1 parent c4fc493 commit 61e383b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion IPython/zmq/tests/test_message_spec.py
Expand Up @@ -83,7 +83,17 @@ def execute(code='', **kwargs):


class Reference(HasTraits):


"""
Base class for message spec specification testing.
This class is the core of the message specification test. The
idea is that child classes implement trait attributes for each
message keys, so that message keys can be tested against these
traits using :meth:`check` method.
"""

def check(self, d):
"""validate a dict against our traits"""
for key in self.trait_names():
Expand Down Expand Up @@ -232,6 +242,9 @@ def _data_changed(self, name, old, new):
'stream' : Stream(),
'display_data' : DisplayData(),
}
"""
Specifications of `content` part of the reply messages.
"""


def validate_message(msg, msg_type=None, parent=None):
Expand Down

0 comments on commit 61e383b

Please sign in to comment.