launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24970
[Merge] ~cjwatson/launchpad:use-getUniqueUnicode into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:use-getUniqueUnicode into launchpad:master.
Commit message:
Use getUniqueUnicode() rather than getUniqueString().decode()
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/386919
This makes Python 3 porting easier, because the intent is clearer.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:use-getUniqueUnicode into launchpad:master.
diff --git a/lib/lp/testing/factory.py b/lib/lp/testing/factory.py
index 87ca1bc..1a6d4ec 100644
--- a/lib/lp/testing/factory.py
+++ b/lib/lp/testing/factory.py
@@ -1785,7 +1785,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
if owner is None:
owner = self.makePerson()
if name is None:
- name = self.getUniqueString('gitrepository').decode('utf-8')
+ name = self.getUniqueUnicode('gitrepository')
if target is _DEFAULT:
target = self.makeProduct()
@@ -1824,7 +1824,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
if repository is None:
repository = self.makeGitRepository(**repository_kwargs)
if paths is None:
- paths = [self.getUniqueString('refs/heads/path').decode('utf-8')]
+ paths = [self.getUniqueUnicode('refs/heads/path')]
refs_info = {
path: {
u"sha1": unicode(
@@ -1843,7 +1843,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
if repository_url is None:
repository_url = self.getUniqueURL()
if path is None:
- path = self.getUniqueString('refs/heads/path').decode('utf-8')
+ path = self.getUniqueUnicode('refs/heads/path')
return getUtility(IGitRefRemoteSet).new(repository_url, path)
def makeGitRule(self, repository=None, ref_pattern=u"refs/heads/*",
@@ -3081,7 +3081,7 @@ class BareLaunchpadObjectFactory(ObjectFactory):
distroseries = self.makeSourcePackageRecipeDistroseries()
if name is None:
- name = self.getUniqueString('spr-name').decode('utf8')
+ name = self.getUniqueUnicode('spr-name')
if description is None:
description = self.getUniqueString(
'spr-description').decode('utf8')