Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote : | # |
1 | === modified file 'lib/lp/soyuz/model/queue.py' |
2 | --- lib/lp/soyuz/model/queue.py 2009-10-09 09:43:12 +0000 |
3 | +++ lib/lp/soyuz/model/queue.py 2009-10-09 11:09:28 +0000 |
4 | @@ -488,7 +488,7 @@ |
5 | return None |
6 | |
7 | @property |
8 | - def mySourcePackageRelease(self): |
9 | + def my_source_package_release(self): |
10 | """The source package release related to this queue item. |
11 | |
12 | al-maisan, Wed, 30 Sep 2009 17:58:31 +0200: |
13 | @@ -736,7 +736,7 @@ |
14 | message.ORIGIN = '\nOrigin: %s' % changes['origin'] |
15 | |
16 | if self.sources or self.builds: |
17 | - message.SPR_URL = canonical_url(self.mySourcePackageRelease) |
18 | + message.SPR_URL = canonical_url(self.my_source_package_release) |
19 | |
20 | def _sendRejectionNotification( |
21 | self, recipients, changes_lines, changes, summary_text, dry_run, |
22 | @@ -1133,7 +1133,7 @@ |
23 | # the section of the source package uploaded in order to facilitate |
24 | # filtering on the part of the email recipients. |
25 | if self.sources: |
26 | - spr = self.mySourcePackageRelease |
27 | + spr = self.my_source_package_release |
28 | xlp_component_header = 'component=%s, section=%s' % ( |
29 | spr.component.name, spr.section.name) |
30 | extra_headers['X-Launchpad-Component'] = xlp_component_header |
31 | |
32 | === modified file 'lib/lp/soyuz/tests/test_packageupload.py' |
33 | --- lib/lp/soyuz/tests/test_packageupload.py 2009-10-07 08:28:03 +0000 |
34 | +++ lib/lp/soyuz/tests/test_packageupload.py 2009-10-09 11:12:08 +0000 |
35 | @@ -232,7 +232,7 @@ |
36 | 'Changed-By: Foo Bar <foo.bar@canonical.com>\n' |
37 | 'Maintainer: Launchpad team <launchpad@lists.canonical.com>\n' |
38 | 'http://launchpad.dev/ubuntutest/breezy-autotest/+source/foocomm/1.0-2\n') |
39 | - |
40 | + |
41 | self.layer.switchDbUser('launchpad') |
42 | |
43 | # One source and 2 binaries are pending publication. They all were |
44 | |
45 | === modified file 'lib/lp/soyuz/tests/test_publishing.py' |
46 | --- lib/lp/soyuz/tests/test_publishing.py 2009-10-05 18:29:12 +0000 |
47 | +++ lib/lp/soyuz/tests/test_publishing.py 2009-10-09 11:12:47 +0000 |
48 | @@ -385,7 +385,7 @@ |
49 | return [BinaryPackagePublishingHistory.get(pub.id) |
50 | for pub in secure_pub_binaries] |
51 | |
52 | - def _findFile(self, top, name_fragment): |
53 | + def _findChangesFile(self, top, name_fragment): |
54 | """File with given name fragment in directory tree starting at top.""" |
55 | for root, dirs, files in os.walk(top, topdown=False): |
56 | for name in files: |
57 | @@ -399,8 +399,8 @@ |
58 | """Create source with meaningful '.changes' file.""" |
59 | top = 'lib/lp/archiveuploader/tests/data/suite' |
60 | name_fragment = '%s_%s' % (sourcename, version) |
61 | - changesfile_path = self._findFile(top, name_fragment) |
62 | - |
63 | + changesfile_path = self._findChangesFile(top, name_fragment) |
64 | + |
65 | source = None |
66 | |
67 | if changesfile_path is not None: |
68 | @@ -412,12 +412,12 @@ |
69 | changesfile_content = handle.read() |
70 | finally: |
71 | handle.close() |
72 | - |
73 | + |
74 | source = self.getPubSource( |
75 | sourcename=sourcename, archive=archive, version=new_version, |
76 | changes_file_content=changesfile_content, |
77 | distroseries=distroseries) |
78 | - |
79 | + |
80 | return source |
81 | |
82 |
Abel Deuring wrote:
> Review: Approve
> Hi Muharem,
>
> nice work, just a few cosmetic remarks, see below.
Hello Abel,
I am thanking you for the prompt review. All your suggestion were
accommodated except for one. Please see the enclosed incremental diff as
well as my replies below for more detail.
> soyuz/model/ queue.py' soyuz/model/ queue.py 2009-10-01 07:05:22 +0000 soyuz/model/ queue.py 2009-10-09 09:50:27 +0000 count() == 1, ( ckageRelease( ) upload. changesfile. read()) list=self. distroseries. changeslist, file_object= changes_ file_object, allow_unsigned= True) (self, logger=None, dry_run=False): `.""" Release( self): package_ release
> Abel
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -367,15 +367,6 @@
>> assert self.sources.
>> 'Source is mandatory for delayed copies.')
>> self.setAccepted()
>> - # The second assert guarantees that we'll actually have a SPR.
>> - spr = self.mySourcePa
>> - # Use the changesfile of the original upload.
>> - changes_file_object = StringIO.StringIO(
>> - spr.package_
>> - self.notify(
>> - announce_
>> - changes_
>> - self.syncUpdate()
>>
>> def rejectFromQueue
>> """See `IPackageUpload
>> @@ -496,6 +487,7 @@
>> else:
>> return None
>>
>> + @property
>> def mySourcePackage
>> """The source package release related to this queue item.
>
> As a Property, this should be named my_source_
Fixed.
> soyuz/tests/ test_packageupl oad.py' soyuz/tests/ test_packageupl oad.py 2009-09-29 17:16:01 +0000 soyuz/tests/ test_packageupl oad.py 2009-10-09 09:50:27 +0000 atus.ACCEPTED, delayed_ copy.status) ls(len( stub.test_ emails) , 0) txn.commit( ) switchDbUser( self.dbuser) emails. pop() from_string( raw_msg) payload( decode= True) ls(from_ addr, '<email address hidden>') breezy- autotest- security] \n\t' 20060302. 0120_all. tar.gz, foocomm 1.0-2 (Accepted)') ls(msg[ 'Subject' ], expected_subject) (body.startswit h('foocomm (1.0-2) breezy; urgency=low')) ls(body, launchpad. dev/ubuntutest/ breezy- autotest/ +source/ foocomm/ 1.0-2\n')
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -198,6 +198,9 @@
>> self.assertEquals(
>> PackageUploadSt
>>
>> + # Make sure no announcement email was sent at this point.
>> + self.assertEqua
>> +
>> self.layer.
>> self.layer.
>>
>> @@ -210,22 +213,26 @@
>>
>> # Check the announcement email.
>> from_addr, to_addrs, raw_msg = stub.test_
>> - # This is now a MIMEMultipart message.
>> msg = message_
>> body = msg.get_payload(0)
>> body = body.get_
>>
>> - self.assertEqua
>> self.assertEquals(
>> - to_addrs, ['<email address hidden>'])
>> + str(to_addrs), "['<email address hidden>']")
>>
>> expected_subject = (
>> '[ubuntutest/
>> 'dist-upgrader_
>> self.assertEqua
>>
>> - self.assertTrue
>> -
>> + self.assertEqua
>> + 'foocomm (1.0-2) breezy; urgency=low\n\n'
>> + ' * Initial version\n\n'
>> + 'Date: Thu, 16 Feb 2006 15:34:09 +0000\n'
>> + 'Changed-By: Foo Bar <email address hidden>\n'
>> + 'Maintainer: Launchpad team <email address hidden>\n'
>> + 'http://
>
> This line is a bit too long. Could you split itto two lines? (OK,
> breaking the URL into two line does ot look nice either...
With your permission I'd like to leave it as it is.
>> +
>
> Please remove the whitespace in the line above.
Done.
> switchDbUser( 'launchpad' ) soyuz/tests/ test_publishing .py' soyuz/tests/ test_publishing .py 2009-09-10 08:56:15 +0000 soyuz/tests/ test_publishing .py 2009-10-09 09:50:27 +0000 ublishingHistor y.get(pub. id) pub_binaries]
>> self.layer.
>>
>> # One source and 2 binaries are pending publication. They all were
>>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>> @@ -385,6 +385,41 @@
>> return [BinaryPackageP
>> for pub in secure_
>>
>> + def _findFile(self, top, name_fragment):
>
> A name like _findChangesFile would be a better, I think. The method
> does not find any file having name_fragment in its name ;)
Suggestion happily adopted :)
> '.changes' ) and name.find( name_fragment) > -1: archiveuploader /tests/ data/suite'
>> + """File with given name fragment in directory tree starting at top."""
>> + for root, dirs, files in os.walk(top, topdown=False):
>> + for name in files:
>> + if name.endswith(
>> + return os.path.join(root, name)
>> + return None
>> +
>> + def createSource(
>> + self, archive, sourcename, version, distroseries=None,
>> + new_version=None):
>> + """Create source with meaningful '.changes' file."""
>> + top = 'lib/lp/
>> + name_fragment = '%s_%s' % (sourcename, version)
>> + changesfile_path = self._findFile(top, name_fragment)
>> +
>
> Please remove the whitespace in the line above.
Done.
> e_path, 'r')
>> + source = None
>> +
>> + if changesfile_path is not None:
>> + if new_version is None:
>> + new_version = version
>> + changesfile_content = ''
>> + handle = open(changesfil
>> + try:
>> + changesfile_content = handle.read()
>> + finally:
>> + handle.close()
>> +
>
> Please remove the whitespace in the line above.
Done.
> sourcename, archive=archive, version= new_version, file_content= changesfile_ content, distroseries)
>> + source = self.getPubSource(
>> + sourcename=
>> + changes_
>> + distroseries=
>> +
>
> Please remove the whitespace in the line above.
Done.
> shingBase( unittest. TestCase, SoyuzTestPublis her): ssLayer
>> + return source
>> +
>>
>> class TestNativePubli
>> layer = LaunchpadZopele
>>
>>
Best regards
--
Muharem Hrnjadovic <email address hidden>
Public key id : B2BBFCFC
Key fingerprint : A5A3 CC67 2B87 D641 103F 5602 219F 6B60 B2BB FCFC