Merge lp:~adeuring/launchpad/security-guarded-test-object-factory-2 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11208 |
Proposed branch: | lp:~adeuring/launchpad/security-guarded-test-object-factory-2 |
Merge into: | lp:launchpad |
Diff against target: |
1025 lines (+286/-62) 24 files modified
lib/lp/code/browser/tests/test_branchlisting.py (+4/-2) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+12/-5) lib/lp/code/browser/tests/test_sourcepackagerecipebuild.py (+4/-1) lib/lp/code/model/tests/test_branch.py (+4/-1) lib/lp/code/model/tests/test_linkedbranch.py (+7/-2) lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+5/-2) lib/lp/registry/browser/tests/distroseries-views.txt (+1/-1) lib/lp/registry/browser/tests/milestone-views.txt (+5/-1) lib/lp/registry/browser/tests/productseries-views.txt (+6/-2) lib/lp/registry/stories/webservice/xx-project-registry.txt (+4/-2) lib/lp/registry/tests/test_distroseries.py (+15/-6) lib/lp/registry/tests/test_sourcepackage.py (+9/-2) lib/lp/soyuz/adapters/tests/test_packagelocation.py (+4/-1) lib/lp/soyuz/browser/tests/archive-views.txt (+7/-2) lib/lp/soyuz/browser/tests/test_distrosourcepackagerelease.py (+7/-1) lib/lp/soyuz/browser/tests/test_sourcepackagerelease.py (+11/-5) lib/lp/soyuz/doc/archive.txt (+9/-4) lib/lp/soyuz/stories/soyuz/xx-distribution-archives.txt (+12/-5) lib/lp/soyuz/tests/test_publishing.py (+9/-3) lib/lp/testing/factory.py (+85/-9) lib/lp/testing/tests/test_factory.py (+50/-0) lib/lp/translations/browser/tests/test_breadcrumbs.py (+3/-1) lib/lp/translations/doc/translations-export-to-branch.txt (+5/-1) lib/lp/translations/stories/buildfarm/xx-build-summary.txt (+8/-3) |
To merge this branch: | bzr merge lp:~adeuring/launchpad/security-guarded-test-object-factory-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij (community) | code | Approve | |
Review via email: mp+30642@code.launchpad.net |
Description of the change
This branch is the second of series with the final goal that all
methods of LaunchpadObject
objects. Basically, it ensures that the methods
LaunchpadObject
LaunchpadObject
proxied objects.
The remaining changes are only calls of the function
remove_
some lint removal.
See also the merge proposal for the base branch:
https:/
tests:
./bin/test -vvt lp.soyuz.
./bin/test -vvt lp.soyuz.
./bin/test -vvt lp.soyuz.
./bin/test -vvt xx-distribution
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
./lib/lp/
0: narrative uses a moin header.
8: narrative uses a moin header.
472: narrative uses a moin header.
515: narrative uses a moin header.
642: narrative uses a moin header.
743: want exceeds 78 characters.
1025: narrative uses a moin header.
1302: narrative uses a moin header.
1368: narrative uses a moin header.
./lib/lp/
0: narrative uses a moin header.
120: narrative exceeds 78 characters.
282: narrative uses a moin header.
444: narrative uses a moin header.
674: narrative uses a moin header.
714: narrative uses a moin header.
760: narrative uses a moin header.
826: narrative uses a moin header.
933: narrative uses a moin header.
952: narrative uses a moin header.
1031: narrative uses a moin header.
1087: narrative uses a moin header.
1282: narrative uses a moin header.
1318: narrative uses a moin header.
1352: source has bad indentation.
1854: narrative uses a moin header.
1998: narrative has trailing whitespace.
2024: narrative has trailing whitespace.
2025: narrative has trailing whitespace.
2037: narrative uses a moin header.
2054: narrative uses a moin header.
2057: narrative exceeds 78 characters.
2071: source exceeds 78 characters.
2077: narrative exceeds 78 characters.
2092: narrative exceeds 78 characters.
2243: narrative uses a moin header.
2314: narrative uses a moin header.
2521: narrative uses a moin header.
2560: narrative uses a moin header.
2640: narrative uses a moin header.
2672: narrative uses a moin header.
2704: narrative uses a moin header.
2749: narrative uses a moin header.
./lib/lp/
0: narrative uses a moin header.
./lib/lp/
157: 'logout' imported but unused
837: E231 missing whitespace after ','
2734: E302 expected 2 blank lines, found 1
2761: E301 expected 1 blank line, found 0
1043: Line exceeds 78 characters.
2735: Line exceeds 78 characters.
I simply did not bother to fix these already existing lint issues.
This branch is based on
lp:~adeuring/launchpad/security-guarded-test-object-factory-1 (reviewed
and approved by jtv) which did not land due to the recent buildbot
failure. The diff against this branch:
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -12,8 +12,10 @@
from lp.soyuz.
from lp.soyuz.
from lp.testing import TestCaseWithFactory
+from lp.testing.factory import remove_
from canonical.testing import LaunchpadZopele
+
class TestPackageLoca
"""Test the `PackageLocation` class."""
layer = LaunchpadZopele
@@ -34,7 +36,8 @@
- copy_archive = returned_
+ copy_archive = remove_
+ returned_
# Now use the created copy archive to test the build_package_
# helper (called via getPackageLocat
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -15,11 +15,14 @@
>>> from lp.registry.
... IDistributionSet)
+ >>> from lp.testing.factory import (
+ ... remove_
>>> ubuntu = getUtility(
>>> copy_location = factory.
... distribution=
... name="intrepid-
- >>> copy_archive = copy_location.
+ >>> copy_archive = remove_
+ ... copy_location)
And let's create two views to compare:
@@ -65,8 +68,10 @@
0
# Create a copy-request to Celso's PPA.
+ >>> naked_copy_location = remove_
+ ... copy_location)
>>> package_
- ... copy_location, copy_archive.owner)
+ ... naked_copy_
>>> len(copy_
1
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -1285,10 +1285,15 @@
The IArchive interface includes a convenience method for creating a
package copy request:
+ >>> from lp.testing.factory import (
+ ... remove_
>>> requestor = factory.
>>> copy_target = factory.
... distribution=
- >>> pcr = ubuntu.
+ >>> naked_copy_target = remove_
+ ... copy_target)
+ >>> pcr = ubuntu.
+ ... naked_copy_target, requestor)
>>> print pcr
Package copy request
source = primary/
@@ -1301,7 +1306,7 @@
The requestPackageCopy method can also take an optional suite name:
>>> package_
- ... copy_target, requestor, suite="
+ ... naked_copy_target, requestor, suite="
>>> print package_
Package copy request
source = primary/
@@ -1412,9 +1417,9 @@
COPY archives use a URL format of <distro-
- >>> print copy_target.
+ >>> print naked_copy_
True
- >>> print copy_target.
+ >>> print naked_copy_
http://
If the archive is private, the url may be different as private PPAs
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -6,6 +6,8 @@
>>> from canonical.
... IDistributionSet)
>>> from lp.registry.
+ >>> from lp.testing.factory import (
+ ... remove_
>>> login('<email address hidden>')
>>> ubuntu = getUtility(
@@ -13,18 +15,21 @@
>>> copy_location = factory.
... distribution=
... name="intrepid-
- >>> copy_archive = copy_location.
+ >>> naked_copy_location = remove_
+ ... copy_location)
+ >>> copy_archive = naked_copy_
>>> copy_archive.
True
>>> package_
- ... copy_location, copy_archive.owner)
+ ... naked_copy_
>>> nopriv = getUtility(
>>> disabled_location = factory.
... distribution=
... name="disabled-
- >>> disabled_archive = disabled_
+ >>> disabled_archive = remove_
+ ... disabled_
>>> disabled_
False
@@ -119,12 +124,14 @@
>>> copy_location = factory.
... distribution=
... name="intrepid-
- >>> copy_archive = copy_location.
+ >>> naked_copy_location = remove_
+ ... copy_location)
+ >>> copy_archive = naked_copy_
>>> copy_archive.
>>> copy_archive.
>>> copy_archive.
>>> package_
- ... copy_location, copy_archive.owner)
+ ... naked_copy_
>>> pub_src = stp.getPubSource(
... archive=
>>> pub_bins = stp.getPubBinar
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -362,7 +362,7 @@
location = PackageLocation
- return location
+ return ProxyFactory(
def makeAccount(self, displayname, email=None, password=None,
@@ -1040,7 +1040,7 @@
def makeDiff(self, diff_text=DIFF):
- return Diff.fromFile(
+ return ProxyFactory(
def makePreviewDiff
diff = self.makeDiff()