Add doctests proving recursive curve->command_stack->arguments->curve serializing...
[hooke.git] / hooke / command_stack.py
index 6e84a913f1ff9731ad2da74927bb7694361b946d..4d5cd01f0aeec343c584c43991e27d55d46369ae 100644 (file)
@@ -163,6 +163,25 @@ class CommandStack (list):
     >>> c.clear()
     >>> print [repr(cm) for cm in c]
     []
     >>> 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.
     """
     def execute(self, hooke, filter=None, stack=False):
         """Execute a stack of commands.