Add doctests proving recursive curve->command_stack->arguments->curve serializing...
[hooke.git] / hooke / command_stack.py
index 6e84a91..4d5cd01 100644 (file)
@@ -163,6 +163,25 @@ class CommandStack (list):
     >>> c.clear()
     >>> print [repr(cm) for cm in c]
     []
+
+    YAMLize a curve argument.
+
+    >>> from .curve import Curve
+    >>> c.append(CommandMessage('curve info', {'curve': Curve(path=None)}))
+    >>> print yaml.dump(c)
+    !!python/object/new:hooke.command_stack.CommandStack
+    listitems:
+    - !!python/object:hooke.engine.CommandMessage
+      arguments:
+        curve: !!python/object:hooke.curve.Curve
+          command_stack: !!python/object:hooke.command_stack.CommandStack {}
+          data: null
+          driver: null
+          info: {}
+          name: null
+          path: null
+      command: curve info
+    <BLANKLINE>
     """
     def execute(self, hooke, filter=None, stack=False):
         """Execute a stack of commands.