Hi Muharem,
All looks good. One tiny comment in below.
Gavin.
> === modified file 'lib/lp/soyuz/doc/build.txt' > --- lib/lp/soyuz/doc/build.txt 2010-01-21 08:53:21 +0000 > +++ lib/lp/soyuz/doc/build.txt 2010-02-10 10:33:18 +0000 > @@ -8,6 +8,7 @@ > launchpad build daemon. > > # Create a 'mozilla-firefox' build in ubuntutest/breezy-autotest/i386. > + >>> from zope.security.proxy import removeSecurityProxy > >>> from lp.soyuz.tests.test_publishing import SoyuzTestPublisher > >>> login('<email address hidden>') > >>> test_publisher = SoyuzTestPublisher() > @@ -17,6 +18,9 @@ > >>> binaries = test_publisher.getPubBinaries( > ... binaryname='firefox', pub_source=source) > >>> [firefox_build] = source.getBuilds() > + >>> the_job = removeSecurityProxy(firefox_build.buildqueue_record.job) > + >>> the_job.start() > + >>> the_job.complete()
I think it's bad to keep a reference to an unwrapped object that is normally subject to access control. It's too easy to inadvertently reuse this reference later in the test. Would you be happy to do something like:
job = firefox_build.buildqueue_record.job removeSecurityProxy(job).start() removeSecurityProxy(job).complete()
instead?
« Back to merge proposal
Hi Muharem,
All looks good. One tiny comment in below.
Gavin.
> === modified file 'lib/lp/ soyuz/doc/ build.txt' soyuz/doc/ build.txt 2010-01-21 08:53:21 +0000 soyuz/doc/ build.txt 2010-02-10 10:33:18 +0000 breezy- autotest/ i386. tests.test_ publishing import SoyuzTestPublisher her() getPubBinaries( 'firefox' , pub_source=source) roxy(firefox_ build.buildqueu e_record. job)
> --- lib/lp/
> +++ lib/lp/
> @@ -8,6 +8,7 @@
> launchpad build daemon.
>
> # Create a 'mozilla-firefox' build in ubuntutest/
> + >>> from zope.security.proxy import removeSecurityProxy
> >>> from lp.soyuz.
> >>> login('<email address hidden>')
> >>> test_publisher = SoyuzTestPublis
> @@ -17,6 +18,9 @@
> >>> binaries = test_publisher.
> ... binaryname=
> >>> [firefox_build] = source.getBuilds()
> + >>> the_job = removeSecurityP
> + >>> the_job.start()
> + >>> the_job.complete()
I think it's bad to keep a reference to an unwrapped object that is
normally subject to access control. It's too easy to inadvertently
reuse this reference later in the test. Would you be happy to do
something like:
job = firefox_ build.buildqueu e_record. job ityProxy( job).start( ) ityProxy( job).complete( )
removeSecur
removeSecur
instead?