I have a few comments, but they're all minor, and you could land
without addressing any of them.
Awesome doctest killing!
Gavin.
[1]
+ # We will also need to log into an admin to do the rescore
Full-stop. Ho ho.
[2]
Some lint:
./lib/lp/soyuz/doc/binarypackagebuild.txt
1: narrative uses a moin header.
48: source exceeds 78 characters.
113: narrative uses a moin header.
137: source exceeds 78 characters.
138: source exceeds 78 characters.
162: source exceeds 78 characters.
163: source exceeds 78 characters.
./lib/lp/soyuz/tests/test_build.py
219: W291 trailing whitespace
219: Line has trailing whitespace.
./lib/lp/soyuz/tests/test_build_depwait.py
25: E302 expected 2 blank lines, found 1
71: W291 trailing whitespace
71: Line has trailing whitespace.
88: Line exceeds 78 characters.
./lib/lp/soyuz/tests/test_build_set.py
31: E302 expected 2 blank lines, found 1
192: W291 trailing whitespace
192: Line has trailing whitespace.
I guess it's not worth addressing the binarypackagebuild.txt lint, but
please take a look at the others.
[3]
+ def test_update_dependancies(self):
+ # Calling .updateDependencies() on a build will update will remove
+ # those which are reachable.
"will update" or "will remove"?
[4]
+ # Commit to make sure stuff hits the database.
+ transaction.commit()
Is this absolutely needed? I believe it slows down the test tear-down,
but I could be wrong. Perhaps flush_database_updates() would be
sufficient? If so, there are several commits in the new tests that
might be better as flushes instead.
But it's not very important; I mention it really to make you aware of
matchers in case they're interesting later on. There are some LP
specific matchers in lp.testing.matchers too.
Hi Steven,
I have a few comments, but they're all minor, and you could land
without addressing any of them.
Awesome doctest killing!
Gavin.
[1]
+ # We will also need to log into an admin to do the rescore
Full-stop. Ho ho.
[2]
Some lint:
./lib/lp/ soyuz/doc/ binarypackagebu ild.txt soyuz/tests/ test_build. py soyuz/tests/ test_build_ depwait. py soyuz/tests/ test_build_ set.py
1: narrative uses a moin header.
48: source exceeds 78 characters.
113: narrative uses a moin header.
137: source exceeds 78 characters.
138: source exceeds 78 characters.
162: source exceeds 78 characters.
163: source exceeds 78 characters.
./lib/lp/
219: W291 trailing whitespace
219: Line has trailing whitespace.
./lib/lp/
25: E302 expected 2 blank lines, found 1
71: W291 trailing whitespace
71: Line has trailing whitespace.
88: Line exceeds 78 characters.
./lib/lp/
31: E302 expected 2 blank lines, found 1
192: W291 trailing whitespace
192: Line has trailing whitespace.
I guess it's not worth addressing the binarypackagebu ild.txt lint, but
please take a look at the others.
[3]
+ def test_update_ dependancies( self): cies() on a build will update will remove
+ # Calling .updateDependen
+ # those which are reachable.
"will update" or "will remove"?
[4]
+ # Commit to make sure stuff hits the database. commit( )
+ transaction.
Is this absolutely needed? I believe it slows down the test tear-down, updates( ) would be
but I could be wrong. Perhaps flush_database_
sufficient? If so, there are several commits in the new tests that
might be better as flushes instead.
[5]
+ self.assertTrue (build. buildqueue_ record. lastscore > 0)
In case of failure, this might be more informative if written as:
(LessThan is from testtools. matchers. )
But it's not very important; I mention it really to make you aware of
matchers in case they're interesting later on. There are some LP
specific matchers in lp.testing.matchers too.
[6]
In TestBuildPrivac y.setUp( ):
+ [public_build] = public_ spph.createMiss ingBuilds( ) logged_ in(self. admin): spph.createMiss ingBuilds( )
...
+ with person_
+ [private_build] = private_
Is the log-in when creating private_build necessary because it's
private?
[7]
+ def _get_build_ title(self, build):
+ return build.title
This doesn't seem to be very useful!
[8]
+ self.assertRaises(
+ Unauthorized, getattr, private, 'getBuildRecords')
This might read better with a lambda:
This appears twice.
[9]
+ expected_titles = [] titles. append( etag, spph.source_ package_ name, package_ version, es.distribution .name, es.name) ) ls(sorted( expected_ titles) , sorted( build_titles) )
+ for spph in spphs:
+ for das in (self.das_one, self.das_two):
+ expected_
+ '%s build of %s %s in %s %s RELEASE' % (
+ das.architectur
+ spph.source_
+ self.distroseri
+ self.distroseri
+ build_titles = [build.title for build in builds]
+ self.assertEqua
Why did you use titles to compare the things returned? Is there a more
direct way to do the comparison?
[10]
To tidy up your imports please run:
utilities/ format- new-and- modified- imports -r :prev