← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-archiveuploader-doctest-unicode-strings into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-archiveuploader-doctest-unicode-strings into launchpad:master.

Commit message:
lp.archiveuploader: Fix u'...' doctest examples for Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/396567
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-archiveuploader-doctest-unicode-strings into launchpad:master.
diff --git a/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt b/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt
index 4a515c1..dc39b37 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-closing-bugs.txt
@@ -75,8 +75,8 @@ nascentupload-publishing-accepted-sources.txt.
 
 This new version fixes bug #6 according its changesfiles:
 
-    >>> bar2_src.changes.changed_by['person'].name
-    u'kinnison'
+    >>> print(bar2_src.changes.changed_by['person'].name)
+    kinnison
 
     >>> bar2_src.changes._dict['Launchpad-bugs-fixed']
     '6'
diff --git a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
index 3977e37..be454a4 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-epoch-handling.txt
@@ -54,8 +54,8 @@ Upload and publish 'non-epoched' version:
     >>> bar_src_upload.process()
     >>> result = bar_src_upload.do_accept()
     >>> bar_src_queue_noepoch = bar_src_upload.queue_root
-    >>> bar_src_queue_noepoch.displayversion
-    u'1.0-1'
+    >>> print(bar_src_queue_noepoch.displayversion)
+    1.0-1
     >>> bar_src_queue_noepoch.status.name
     'NEW'
     >>> bar_src_queue_noepoch.setAccepted()
@@ -123,20 +123,20 @@ Upload a newer'epoched' bar source :
 
 Accept all bar sources:
 
-    >>> bar_src_queue_noepoch.displayversion
-    u'1.0-1'
+    >>> print(bar_src_queue_noepoch.displayversion)
+    1.0-1
     >>> bar_src_queue_noepoch.setAccepted()
     >>> bar_src_queue_noepoch.status.name
     'ACCEPTED'
 
-    >>> bar_src_queue_epoch.displayversion
-    u'1:1.0-1'
+    >>> print(bar_src_queue_epoch.displayversion)
+    1:1.0-1
     >>> bar_src_queue_epoch.setAccepted()
     >>> bar_src_queue_epoch.status.name
     'ACCEPTED'
 
-    >>> bar_src_queue_epoch2.displayversion
-    u'1:1.0-2'
+    >>> print(bar_src_queue_epoch2.displayversion)
+    1:1.0-2
     >>> bar_src_queue_epoch2.setAccepted()
     >>> bar_src_queue_epoch2.status.name
     'ACCEPTED'
@@ -214,8 +214,8 @@ For source uploads, Changes.version == DSC.version == SPR.version:
 
     >>> bar_src_queue = bar_src_upload.queue_root
     >>> bar_spr = bar_src_queue.sources[0].sourcepackagerelease
-    >>> bar_spr.version
-    u'1:1.0-9'
+    >>> print(bar_spr.version)
+    1:1.0-9
 
     >>> from lp.registry.interfaces.pocket import PackagePublishingPocket
     >>> from lp.soyuz.interfaces.publishing import IPublishingSet
@@ -269,8 +269,8 @@ Anyway, the proper value for BinaryPackageRelease.version is the
 version stored in the binary control file:
 
     >>> bar_bpr = bar_bin_queue.builds[0].build.binarypackages[0]
-    >>> bar_bpr.version
-    u'1:6.6.6'
+    >>> print(bar_bpr.version)
+    1:6.6.6
 
 
 
diff --git a/lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt b/lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt
index 4c284f4..9feccc6 100644
--- a/lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload-publishing-accepted-sources.txt
@@ -37,11 +37,11 @@ Check if the publication is available through the Soyuz package stack:
     1
     >>> ed_pub = ed_dspr.publishing_history[0]
 
-    >>> ed_pub.sourcepackagerelease.title
-    u'ed - 0.2-20'
+    >>> print(ed_pub.sourcepackagerelease.title)
+    ed - 0.2-20
 
-    >>> ed_pub.distroseries.name
-    u'hoary'
+    >>> print(ed_pub.distroseries.name)
+    hoary
 
     >>> ed_pub.status.name
     'PENDING'
@@ -88,11 +88,11 @@ available via the package stack:
     1
     >>> ed21_pub = ed21_dspr.publishing_history[0]
 
-    >>> ed21_pub.sourcepackagerelease.title
-    u'ed - 0.2-21'
+    >>> print(ed21_pub.sourcepackagerelease.title)
+    ed - 0.2-21
 
-    >>> ed21_pub.distroseries.name
-    u'hoary'
+    >>> print(ed21_pub.distroseries.name)
+    hoary
 
     >>> ed21_pub.status.name
     'PENDING'
diff --git a/lib/lp/archiveuploader/tests/nascentupload.txt b/lib/lp/archiveuploader/tests/nascentupload.txt
index 95d96d9..6e2ba89 100644
--- a/lib/lp/archiveuploader/tests/nascentupload.txt
+++ b/lib/lp/archiveuploader/tests/nascentupload.txt
@@ -85,8 +85,10 @@ exists for it:
     >>> quodlibet.changes.signer is not None
     True
     >>> p = quodlibet.changes.maintainer['person']
-    >>> p.name, p.displayname
-    (u'buildd', u'Ubuntu/i386 Build Daemon')
+    >>> print(p.name)
+    buildd
+    >>> print(p.displayname)
+    Ubuntu/i386 Build Daemon
 
 
 Sourceful Uploads
@@ -342,38 +344,38 @@ for the archive index generation:
 
 The 'Maintainer:' identity in RFC-822 format, as it was in DSC:
 
-    >>> ed_spr.dsc_maintainer_rfc822
-    u'James Troup <james@xxxxxxxxxx>'
+    >>> print(ed_spr.dsc_maintainer_rfc822)
+    James Troup <james@xxxxxxxxxx>
 
 Version of debian policy/standards used to build this source package:
 
-    >>> ed_spr.dsc_standards_version
-    u'3.5.8.0'
+    >>> print(ed_spr.dsc_standards_version)
+    3.5.8.0
 
 Format of the included DSC (.dsc) file:
 
-    >>> ed_spr.dsc_format
-    u'1.0'
+    >>> print(ed_spr.dsc_format)
+    1.0
 
 Binaries names claimed to be resulted of this source, line with names
 separated by space:
 
-    >>> ed_spr.dsc_binaries
-    u'ed'
+    >>> print(ed_spr.dsc_binaries)
+    ed
 
 Other DSC fields are also stored in the SourcePackageRelease record.
 
-    >>> ed_spr.builddepends
-    u'dpatch'
+    >>> print(ed_spr.builddepends)
+    dpatch
 
-    >>> ed_spr.builddependsindep
-    u''
+    >>> print(ed_spr.builddependsindep)
+    <BLANKLINE>
 
-    >>> ed_spr.build_conflicts
-    u'foo-bar'
+    >>> print(ed_spr.build_conflicts)
+    foo-bar
 
-    >>> ed_spr.build_conflicts_indep
-    u'biscuit'
+    >>> print(ed_spr.build_conflicts_indep)
+    biscuit
 
 The content of 'debian/copyright' is stored as the 'copyright'
 attribute of SourcePackageRelease (note that its content is filtered
@@ -526,8 +528,8 @@ Upload new source 'multibar', step 1:
     >>> len(multibar_src_queue.sources)
     1
     >>> multibar_spr = multibar_src_queue.sources[0].sourcepackagerelease
-    >>> multibar_spr.title
-    u'multibar - 1.0-1'
+    >>> print(multibar_spr.title)
+    multibar - 1.0-1
 
 Once we have a new queue entry we are able to accept it, step 2:
 
@@ -707,11 +709,11 @@ content, it should have all the required fields except the
     ...     PackageUploadStatus.NEW, name=u'test75874', exact_match=True)[0]
     >>> inst_spr = inst_queue.sources[0].sourcepackagerelease
 
-    >>> inst_spr.dsc_maintainer_rfc822
-    u'Colin Watson <cjwatson@xxxxxxxxxx>'
+    >>> print(inst_spr.dsc_maintainer_rfc822)
+    Colin Watson <cjwatson@xxxxxxxxxx>
 
-    >>> inst_spr.dsc_binaries
-    u'test75874'
+    >>> print(inst_spr.dsc_binaries)
+    test75874
 
     >>> inst_spr.dsc_standards_version is None
     True
diff --git a/lib/lp/archiveuploader/tests/nascentuploadfile.txt b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
index 830e1ca..3bb1a25 100644
--- a/lib/lp/archiveuploader/tests/nascentuploadfile.txt
+++ b/lib/lp/archiveuploader/tests/nascentuploadfile.txt
@@ -249,8 +249,8 @@ After initiliasing sig_file we can parse addresses and look them up in
 Launchpad:
 
     >>> addr = sig_file.parseAddress("Foo Bar <foo.bar@xxxxxxxxxxxxx>")
-    >>> addr['person'].displayname
-    u'Foo Bar'
+    >>> print(addr['person'].displayname)
+    Foo Bar
     >>> addr['person'].creation_comment is None
     True
 
@@ -271,8 +271,8 @@ a new Person will be created.
     >>> addr['person'].creation_rationale.name
     'SOURCEPACKAGEUPLOAD'
 
-    >>> addr['person'].creation_comment
-    u'when the some-source_6.6.6 package was uploaded to hoary/RELEASE'
+    >>> print(addr['person'].creation_comment)
+    when the some-source_6.6.6 package was uploaded to hoary/RELEASE
 
 If the use an un-initialized policy to create a launchpad person the
 creation_rationale will still be possible, however missing important
@@ -284,8 +284,8 @@ information, the upload target:
     >>> addr['person'].creation_rationale.name
     'SOURCEPACKAGEUPLOAD'
 
-    >>> addr['person'].creation_comment
-    u'when the some-source_6.6.6 package was uploaded to (unknown)'
+    >>> print(addr['person'].creation_comment)
+    when the some-source_6.6.6 package was uploaded to (unknown)
 
 On ChangesFile objects we can have access to the enhanced address_structure
 corresponding to the RFC-822 mentioned after performing 'processAddress':
@@ -302,14 +302,14 @@ As we can see, this method also return an error generator.
 The built address_structure contains values that will be used during
 the upload processing:
 
-    >>> ed_binary_changes.maintainer['name']
-    u'James Troup'
-    >>> ed_binary_changes.maintainer['email']
-    u'james@xxxxxxxxxx'
+    >>> print(ed_binary_changes.maintainer['name'])
+    James Troup
+    >>> print(ed_binary_changes.maintainer['email'])
+    james@xxxxxxxxxx
     >>> ed_binary_changes.maintainer['person']
     <Person ...>
-    >>> ed_binary_changes.maintainer['person'].displayname
-    u'James Troup'
+    >>> print(ed_binary_changes.maintainer['person'].displayname)
+    James Troup
 
 
 Signature Traces
@@ -322,13 +322,13 @@ requirements.
 The ChangesFile signer IPerson, used to checks upload ACL, normally
 know as 'sponsor' or 'mentor':
 
-    >>> ed_binary_changes.signer.displayname
-    u'Foo Bar'
+    >>> print(ed_binary_changes.signer.displayname)
+    Foo Bar
 
 The IGPGKey used to sign this ChangesFile:
 
-    >>> ed_binary_changes.signingkey.displayname
-    u'1024D/FD311613D941C6DE55737D310E3498675D147547'
+    >>> print(ed_binary_changes.signingkey.displayname)
+    1024D/FD311613D941C6DE55737D310E3498675D147547
 
 
 DSCFile
@@ -374,19 +374,19 @@ The DSC is GPG-signed most of the time, so we can guarantee who was
 the author. The DSCFile class implements the same address parsing
 methods found in ChangesFile:
 
-    >>> ed_source_dsc.maintainer['person'].displayname
-    u'James Troup'
+    >>> print(ed_source_dsc.maintainer['person'].displayname)
+    James Troup
 
 The DSC signer IPerson:
 
-    >>> ed_source_dsc.signer.displayname
-    u'Foo Bar'
+    >>> print(ed_source_dsc.signer.displayname)
+    Foo Bar
 
 The IGPGKey used to sign this DSC, which will be stored as the
 ISourcePackageRelease.dscsiginingkey:
 
-    >>> ed_source_dsc.signingkey.displayname
-    u'1024D/340CA3BB270E2716C9EE0B768E7EB7086C64A8C5'
+    >>> print(ed_source_dsc.signingkey.displayname)
+    1024D/340CA3BB270E2716C9EE0B768E7EB7086C64A8C5
 
 A DSCFile provides a verification API similiar to what we have in
 ChangesFile itself:

Follow ups