On Sat, Jun 20, 2009 at 3:59 PM, Neels Janosch Hofmeyr<neels_at_elego.de> wrote:
> This is how I implemented the same test cmpilato wrote in about two minutes
> sharp:
>
> [[[
> def mine(sbox):
> "lock a file using a comment with xml special chars"
> svntest.factory.make(sbox, """
> echo "This represents a binary file\\n" >> iota
> svn ci
> svn lock -m 'lock & load' iota
> """)
> ]]]
> (Note that I had to double-escape the '\n' to '\\n' because of python
> parsing it before factory can.)
This sounds very useful! I like how it simplifies the test suite. I
just have a drive-by suggestion for you here. If you don't want Python
to interpret the backslashes, use raw strings. In that case, you don't
need to double-escape. E.g.
[[[
svntest.factory.make(sbox, r"""
echo "This represents a binary file\n" >> iota
svn ci
svn lock -m 'lock & load' iota
""")
]]]
Cheers,
David
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2363988
Received on 2009-06-21 21:25:13 CEST