Here is the @test node body:
--- cut here ---
root = p.copy()
while p.hasChildren():
p.firstChild().doDelete(newNode = None)
try:
p1 = p.insertAsLastChild()
body = 'foo'
p1.setBodyString(body)
c.selectPosition(p1)
c.copyOutline()
c.pasteOutline()
finally:
c.redraw_now()
--- cut here ---
My problem: the node that is being created by c.pasteOutline() has an
empty body. If after running the test I type 'paste-node' in the
minibuffer, a new node appears, it has 'foo' in the body.
Searching for "copyOutline" and "pasteOutline" in leo's html docs
doesn't provide any usage examples, so I'm stuck.
Did you notice that the code works when run with the execute-script
command? That indicates that something strange is going on related to
unit testing.
To make things easier to see, I added a call to p1.expand() after the line:
p1 = p.insertAsLastChild()
There is no reason at all to get stuck :-) Just insert a call to
g.pdb() in pasteOutline(). Compare what happens when run with ctrl-b
vs. run-unit-tests-locally. You will see that in the latter case
readSaxFile misses the body text.
So it looks like a bug which I'll fix soon.
Edward
Ok. Feel free to complete my example test with a couple of asserts
that compare the headlines and bodies of these two created children of
root and add it to the leo unit tests. Since you cleared the things up
and this seems to be a leo bug rather than me doing something wrong,
it'll be good to have a simple regression test for this.