[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: HEADS UP: cmdline test factory

From: David James <james82_at_gmail.com>
Date: Sun, 21 Jun 2009 12:23:52 -0700

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.