Merge lp:~cjwatson/launchpad/octal-constants into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 17916
Proposed branch: lp:~cjwatson/launchpad/octal-constants
Merge into: lp:launchpad
Diff against target: 1193 lines (+140/-142)
51 files modified
lib/lp/answers/tests/test_question_webservice.py (+2/-2)
lib/lp/app/browser/tests/test_vocabulary.py (+3/-5)
lib/lp/archivepublisher/config.py (+1/-1)
lib/lp/archivepublisher/customupload.py (+5/-5)
lib/lp/archivepublisher/diskpool.py (+2/-2)
lib/lp/archivepublisher/model/ftparchive.py (+1/-1)
lib/lp/archivepublisher/scripts/generate_contents_files.py (+1/-1)
lib/lp/archivepublisher/tests/test_ddtp_tarball.py (+3/-3)
lib/lp/archivepublisher/tests/test_debian_installer.py (+12/-12)
lib/lp/archivepublisher/tests/test_dist_upgrader.py (+5/-5)
lib/lp/archivepublisher/tests/test_publish_ftpmaster.py (+1/-1)
lib/lp/archivepublisher/tests/test_uefi.py (+5/-5)
lib/lp/archiveuploader/tests/test_dscfile.py (+5/-5)
lib/lp/bugs/doc/checkwatches-batching.txt (+1/-1)
lib/lp/bugs/doc/externalbugtracker.txt (+1/-1)
lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt (+1/-1)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+5/-5)
lib/lp/code/feed/tests/test_revision.py (+2/-2)
lib/lp/code/model/tests/test_gitjob.py (+2/-2)
lib/lp/code/model/tests/test_gitrepository.py (+4/-4)
lib/lp/code/xmlrpc/tests/test_codehosting.py (+3/-3)
lib/lp/codehosting/codeimport/tests/servers.py (+2/-2)
lib/lp/codehosting/tests/servers.py (+3/-3)
lib/lp/codehosting/tests/test_sftp.py (+5/-5)
lib/lp/hardwaredb/doc/hwdb.txt (+2/-2)
lib/lp/registry/browser/tests/productseries-views.txt (+1/-1)
lib/lp/registry/browser/tests/test_announcements.py (+2/-2)
lib/lp/registry/doc/distribution-mirror.txt (+2/-2)
lib/lp/registry/doc/poll.txt (+1/-1)
lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt (+1/-1)
lib/lp/registry/tests/test_distributionmirror_prober.py (+2/-2)
lib/lp/scripts/runlaunchpad.py (+2/-2)
lib/lp/scripts/tests/test_garbo.py (+3/-3)
lib/lp/services/librarianserver/testing/server.py (+3/-3)
lib/lp/services/librarianserver/tests/test_web.py (+3/-3)
lib/lp/services/osutils.py (+3/-3)
lib/lp/services/tarfile_helpers.py (+3/-3)
lib/lp/services/webapp/tests/test_batching.py (+3/-3)
lib/lp/snappy/tests/test_snapbuild.py (+3/-3)
lib/lp/soyuz/model/queue.py (+2/-2)
lib/lp/soyuz/tests/test_binarypackagename.py (+3/-3)
lib/lp/soyuz/tests/test_build.py (+3/-3)
lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py (+3/-3)
lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py (+3/-3)
lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py (+3/-3)
lib/lp/soyuz/tests/test_livefs.py (+3/-3)
lib/lp/soyuz/tests/test_livefsbuild.py (+3/-3)
lib/lp/soyuz/tests/test_livefsbuildbehaviour.py (+2/-2)
lib/lp/testing/tests/test_factory.py (+2/-2)
lib/lp/translations/browser/tests/test_translationmessage_view.py (+2/-2)
lib/lp/translations/doc/poexport-language-pack.txt (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/octal-constants
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+285211@code.launchpad.net

Commit message

Use Python 3-style octal constants.

Description of the change

Use Python 3-style octal constants.

Now that vim in xenial is built with Python 3 and I upgraded my pyflakes.vim to match, my editor is complaining at me about the Python 2-style octal constants in various places.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/answers/tests/test_question_webservice.py'
--- lib/lp/answers/tests/test_question_webservice.py 2015-10-26 14:54:43 +0000
+++ lib/lp/answers/tests/test_question_webservice.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2011-2015 Canonical Ltd. This software is licensed under the1# Copyright 2011-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Webservice unit tests related to Launchpad Questions."""4"""Webservice unit tests related to Launchpad Questions."""
@@ -264,7 +264,7 @@
264264
265 def test_searchQuestions(self):265 def test_searchQuestions(self):
266 date_gen = time_counter(266 date_gen = time_counter(
267 datetime(2015, 01, 01, tzinfo=pytz.UTC), timedelta(days=1))267 datetime(2015, 1, 1, tzinfo=pytz.UTC), timedelta(days=1))
268 created = [268 created = [
269 self.factory.makeQuestion(title="foo", datecreated=next(date_gen))269 self.factory.makeQuestion(title="foo", datecreated=next(date_gen))
270 for i in range(10)]270 for i in range(10)]
271271
=== modified file 'lib/lp/app/browser/tests/test_vocabulary.py'
--- lib/lp/app/browser/tests/test_vocabulary.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/browser/tests/test_vocabulary.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the1# Copyright 2011-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test vocabulary adapters."""4"""Test vocabulary adapters."""
@@ -138,8 +138,7 @@
138 def test_PersonPickerEntrySourceAdapter_user(self):138 def test_PersonPickerEntrySourceAdapter_user(self):
139 # The person picker provides more information for users.139 # The person picker provides more information for users.
140 person = self.factory.makePerson(email='snarf@eg.dom', name='snarf')140 person = self.factory.makePerson(email='snarf@eg.dom', name='snarf')
141 creation_date = datetime(141 creation_date = datetime(2005, 1, 30, 0, 0, 0, 0, pytz.timezone('UTC'))
142 2005, 01, 30, 0, 0, 0, 0, pytz.timezone('UTC'))
143 removeSecurityProxy(person).datecreated = creation_date142 removeSecurityProxy(person).datecreated = creation_date
144 getUtility(IIrcIDSet).new(person, 'eg.dom', 'snarf')143 getUtility(IIrcIDSet).new(person, 'eg.dom', 'snarf')
145 getUtility(IIrcIDSet).new(person, 'ex.dom', 'pting')144 getUtility(IIrcIDSet).new(person, 'ex.dom', 'pting')
@@ -535,8 +534,7 @@
535 name='xpting-team',534 name='xpting-team',
536 membership_policy=TeamMembershipPolicy.RESTRICTED)535 membership_policy=TeamMembershipPolicy.RESTRICTED)
537 person = self.factory.makePerson(name='xpting-person')536 person = self.factory.makePerson(name='xpting-person')
538 creation_date = datetime(537 creation_date = datetime(2005, 1, 30, 0, 0, 0, 0, pytz.timezone('UTC'))
539 2005, 01, 30, 0, 0, 0, 0, pytz.timezone('UTC'))
540 removeSecurityProxy(person).datecreated = creation_date538 removeSecurityProxy(person).datecreated = creation_date
541 TestPersonVocabulary.test_persons.extend([team, person])539 TestPersonVocabulary.test_persons.extend([team, person])
542 product = self.factory.makeProduct(owner=team)540 product = self.factory.makeProduct(owner=team)
543541
=== modified file 'lib/lp/archivepublisher/config.py'
--- lib/lp/archivepublisher/config.py 2016-01-13 17:09:34 +0000
+++ lib/lp/archivepublisher/config.py 2016-02-05 16:55:09 +0000
@@ -141,4 +141,4 @@
141 if directory is None:141 if directory is None:
142 continue142 continue
143 if not os.path.exists(directory):143 if not os.path.exists(directory):
144 os.makedirs(directory, 0755)144 os.makedirs(directory, 0o755)
145145
=== modified file 'lib/lp/archivepublisher/customupload.py'
--- lib/lp/archivepublisher/customupload.py 2013-07-25 17:05:20 +0000
+++ lib/lp/archivepublisher/customupload.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2013 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Infrastructure for handling custom uploads.4"""Infrastructure for handling custom uploads.
@@ -247,7 +247,7 @@
247 """Ensure the parent directory exists."""247 """Ensure the parent directory exists."""
248 parentdir = os.path.dirname(path)248 parentdir = os.path.dirname(path)
249 if not os.path.isdir(parentdir):249 if not os.path.isdir(parentdir):
250 os.makedirs(parentdir, 0755)250 os.makedirs(parentdir, 0o755)
251251
252 def installFiles(self):252 def installFiles(self):
253 """Install the files from the custom upload to the archive."""253 """Install the files from the custom upload to the archive."""
@@ -267,8 +267,8 @@
267 # Also, ensure that the process has the expected umask.267 # Also, ensure that the process has the expected umask.
268 old_mask = os.umask(0)268 old_mask = os.umask(0)
269 try:269 try:
270 if old_mask != 022:270 if old_mask != 0o022:
271 raise CustomUploadBadUmask(022, old_mask)271 raise CustomUploadBadUmask(0o022, old_mask)
272 finally:272 finally:
273 os.umask(old_mask)273 os.umask(old_mask)
274 if os.path.islink(sourcepath):274 if os.path.islink(sourcepath):
@@ -296,7 +296,7 @@
296 os.symlink(os.readlink(sourcepath), destpath)296 os.symlink(os.readlink(sourcepath), destpath)
297 else:297 else:
298 shutil.copy(sourcepath, destpath)298 shutil.copy(sourcepath, destpath)
299 os.chmod(destpath, 0644)299 os.chmod(destpath, 0o644)
300300
301 extracted = True301 extracted = True
302302
303303
=== modified file 'lib/lp/archivepublisher/diskpool.py'
--- lib/lp/archivepublisher/diskpool.py 2015-10-21 09:37:08 +0000
+++ lib/lp/archivepublisher/diskpool.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__all__ = ['DiskPoolEntry', 'DiskPool', 'poolify', 'unpoolify']4__all__ = ['DiskPoolEntry', 'DiskPool', 'poolify', 'unpoolify']
@@ -105,7 +105,7 @@
105 def close(self):105 def close(self):
106 """Make the atomic move into place having closed the temp file."""106 """Make the atomic move into place having closed the temp file."""
107 self.fd.close()107 self.fd.close()
108 os.chmod(self.tempname, 0644)108 os.chmod(self.tempname, 0o644)
109 # Note that this will fail if the target and the temp dirs are on109 # Note that this will fail if the target and the temp dirs are on
110 # different filesystems.110 # different filesystems.
111 os.rename(self.tempname, self.targetfilename)111 os.rename(self.tempname, self.targetfilename)
112112
=== modified file 'lib/lp/archivepublisher/model/ftparchive.py'
--- lib/lp/archivepublisher/model/ftparchive.py 2016-02-04 19:46:52 +0000
+++ lib/lp/archivepublisher/model/ftparchive.py 2016-02-05 16:55:09 +0000
@@ -52,7 +52,7 @@
52def safe_mkdir(path):52def safe_mkdir(path):
53 """Ensures the path exists, creating it if it doesn't."""53 """Ensures the path exists, creating it if it doesn't."""
54 if not os.path.exists(path):54 if not os.path.exists(path):
55 os.makedirs(path, 0755)55 os.makedirs(path, 0o755)
5656
5757
58DEFAULT_COMPONENT = "main"58DEFAULT_COMPONENT = "main"
5959
=== modified file 'lib/lp/archivepublisher/scripts/generate_contents_files.py'
--- lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-01-13 17:09:34 +0000
+++ lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-02-05 16:55:09 +0000
@@ -275,7 +275,7 @@
275 ensure_directory_exists(os.path.dirname(contents_dest))275 ensure_directory_exists(os.path.dirname(contents_dest))
276 os.rename(current_contents, last_contents)276 os.rename(current_contents, last_contents)
277 os.rename(new_contents, contents_dest)277 os.rename(new_contents, contents_dest)
278 os.chmod(contents_dest, 0664)278 os.chmod(contents_dest, 0o664)
279 else:279 else:
280 self.logger.debug(280 self.logger.debug(
281 "Skipping unmodified Contents file for %s/%s.", suite, arch)281 "Skipping unmodified Contents file for %s/%s.", suite, arch)
282282
=== modified file 'lib/lp/archivepublisher/tests/test_ddtp_tarball.py'
--- lib/lp/archivepublisher/tests/test_ddtp_tarball.py 2012-07-03 17:32:59 +0000
+++ lib/lp/archivepublisher/tests/test_ddtp_tarball.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test ddtp-tarball custom uploads.4"""Test ddtp-tarball custom uploads.
@@ -30,8 +30,8 @@
30 self.temp_dir = self.makeTemporaryDirectory()30 self.temp_dir = self.makeTemporaryDirectory()
31 self.pubconf = FakeConfig(self.temp_dir)31 self.pubconf = FakeConfig(self.temp_dir)
32 self.suite = "distroseries"32 self.suite = "distroseries"
33 # CustomUpload.installFiles requires a umask of 022.33 # CustomUpload.installFiles requires a umask of 0o022.
34 old_umask = os.umask(022)34 old_umask = os.umask(0o022)
35 self.addCleanup(os.umask, old_umask)35 self.addCleanup(os.umask, old_umask)
3636
37 def openArchive(self, version):37 def openArchive(self, version):
3838
=== modified file 'lib/lp/archivepublisher/tests/test_debian_installer.py'
--- lib/lp/archivepublisher/tests/test_debian_installer.py 2012-06-28 16:32:27 +0000
+++ lib/lp/archivepublisher/tests/test_debian_installer.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test debian-installer custom uploads.4"""Test debian-installer custom uploads.
@@ -34,8 +34,8 @@
34 self.temp_dir = self.makeTemporaryDirectory()34 self.temp_dir = self.makeTemporaryDirectory()
35 self.pubconf = FakeConfig(self.temp_dir)35 self.pubconf = FakeConfig(self.temp_dir)
36 self.suite = "distroseries"36 self.suite = "distroseries"
37 # CustomUpload.installFiles requires a umask of 022.37 # CustomUpload.installFiles requires a umask of 0o022.
38 old_umask = os.umask(022)38 old_umask = os.umask(0o022)
39 self.addCleanup(os.umask, old_umask)39 self.addCleanup(os.umask, old_umask)
4040
41 def openArchive(self):41 def openArchive(self):
@@ -82,10 +82,10 @@
82 self.assertRaises(CustomUploadAlreadyExists, self.process)82 self.assertRaises(CustomUploadAlreadyExists, self.process)
8383
84 def test_bad_umask(self):84 def test_bad_umask(self):
85 # The umask must be 022 to avoid incorrect permissions.85 # The umask must be 0o022 to avoid incorrect permissions.
86 self.openArchive()86 self.openArchive()
87 self.addFile("dir/file", "foo")87 self.addFile("dir/file", "foo")
88 os.umask(002) # cleanup already handled by setUp88 os.umask(0o002) # cleanup already handled by setUp
89 self.assertRaises(CustomUploadBadUmask, self.process)89 self.assertRaises(CustomUploadBadUmask, self.process)
9090
91 def test_current_symlink(self):91 def test_current_symlink(self):
@@ -133,18 +133,18 @@
133 self.getInstallerPath(link_to_dir_path))))133 self.getInstallerPath(link_to_dir_path))))
134134
135 def test_top_level_permissions(self):135 def test_top_level_permissions(self):
136 # Top-level directories are set to mode 0755 (see bug 107068).136 # Top-level directories are set to mode 0o755 (see bug 107068).
137 self.openArchive()137 self.openArchive()
138 self.addFile("hello", "world")138 self.addFile("hello", "world")
139 self.process()139 self.process()
140 installer_path = self.getInstallerPath()140 installer_path = self.getInstallerPath()
141 self.assertEqual(0755, os.stat(installer_path).st_mode & 0777)141 self.assertEqual(0o755, os.stat(installer_path).st_mode & 0o777)
142 self.assertEqual(142 self.assertEqual(
143 0755,143 0o755,
144 os.stat(os.path.join(installer_path, os.pardir)).st_mode & 0777)144 os.stat(os.path.join(installer_path, os.pardir)).st_mode & 0o777)
145145
146 def test_extracted_permissions(self):146 def test_extracted_permissions(self):
147 # Extracted files and directories are set to 0644/0755.147 # Extracted files and directories are set to 0o644/0o755.
148 self.openArchive()148 self.openArchive()
149 directory = ("images/netboot/ubuntu-installer/i386/"149 directory = ("images/netboot/ubuntu-installer/i386/"
150 "pxelinux.cfg.serial-9600")150 "pxelinux.cfg.serial-9600")
@@ -152,9 +152,9 @@
152 self.addFile(filename, "hey")152 self.addFile(filename, "hey")
153 self.process()153 self.process()
154 self.assertEqual(154 self.assertEqual(
155 0644, os.stat(self.getInstallerPath(filename)).st_mode & 0777)155 0o644, os.stat(self.getInstallerPath(filename)).st_mode & 0o777)
156 self.assertEqual(156 self.assertEqual(
157 0755, os.stat(self.getInstallerPath(directory)).st_mode & 0777)157 0o755, os.stat(self.getInstallerPath(directory)).st_mode & 0o777)
158158
159 def test_getSeriesKey_extracts_architecture(self):159 def test_getSeriesKey_extracts_architecture(self):
160 # getSeriesKey extracts the architecture from an upload's filename.160 # getSeriesKey extracts the architecture from an upload's filename.
161161
=== modified file 'lib/lp/archivepublisher/tests/test_dist_upgrader.py'
--- lib/lp/archivepublisher/tests/test_dist_upgrader.py 2012-06-28 16:32:27 +0000
+++ lib/lp/archivepublisher/tests/test_dist_upgrader.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test dist-upgrader custom uploads.4"""Test dist-upgrader custom uploads.
@@ -35,8 +35,8 @@
35 self.temp_dir = self.makeTemporaryDirectory()35 self.temp_dir = self.makeTemporaryDirectory()
36 self.pubconf = FakeConfig(self.temp_dir)36 self.pubconf = FakeConfig(self.temp_dir)
37 self.suite = "distroseries"37 self.suite = "distroseries"
38 # CustomUpload.installFiles requires a umask of 022.38 # CustomUpload.installFiles requires a umask of 0o022.
39 old_umask = os.umask(022)39 old_umask = os.umask(0o022)
40 self.addCleanup(os.umask, old_umask)40 self.addCleanup(os.umask, old_umask)
4141
42 def openArchive(self, version):42 def openArchive(self, version):
@@ -68,10 +68,10 @@
68 self.assertRaises(CustomUploadAlreadyExists, self.process)68 self.assertRaises(CustomUploadAlreadyExists, self.process)
6969
70 def test_bad_umask(self):70 def test_bad_umask(self):
71 # The umask must be 022 to avoid incorrect permissions.71 # The umask must be 0o022 to avoid incorrect permissions.
72 self.openArchive("20060302.0120")72 self.openArchive("20060302.0120")
73 self.archive.add_file("20060302.0120/file", "foo")73 self.archive.add_file("20060302.0120/file", "foo")
74 os.umask(002) # cleanup already handled by setUp74 os.umask(0o002) # cleanup already handled by setUp
75 self.assertRaises(CustomUploadBadUmask, self.process)75 self.assertRaises(CustomUploadBadUmask, self.process)
7676
77 def test_current_symlink(self):77 def test_current_symlink(self):
7878
=== modified file 'lib/lp/archivepublisher/tests/test_publish_ftpmaster.py'
--- lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2016-02-04 19:46:52 +0000
+++ lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2016-02-05 16:55:09 +0000
@@ -320,7 +320,7 @@
320 script_file = file(script_path, "w")320 script_file = file(script_path, "w")
321 script_file.write(script_code)321 script_file.write(script_code)
322 script_file.close()322 script_file.close()
323 os.chmod(script_path, 0755)323 os.chmod(script_path, 0o755)
324324
325 def test_script_runs_successfully(self):325 def test_script_runs_successfully(self):
326 self.prepareUbuntu()326 self.prepareUbuntu()
327327
=== modified file 'lib/lp/archivepublisher/tests/test_uefi.py'
--- lib/lp/archivepublisher/tests/test_uefi.py 2012-11-09 12:50:09 +0000
+++ lib/lp/archivepublisher/tests/test_uefi.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test UEFI custom uploads."""4"""Test UEFI custom uploads."""
@@ -33,8 +33,8 @@
33 self.uefi_dir = self.makeTemporaryDirectory()33 self.uefi_dir = self.makeTemporaryDirectory()
34 self.pubconf = FakeConfig(self.temp_dir, self.uefi_dir)34 self.pubconf = FakeConfig(self.temp_dir, self.uefi_dir)
35 self.suite = "distroseries"35 self.suite = "distroseries"
36 # CustomUpload.installFiles requires a umask of 022.36 # CustomUpload.installFiles requires a umask of 0o022.
37 old_umask = os.umask(022)37 old_umask = os.umask(0o022)
38 self.addCleanup(os.umask, old_umask)38 self.addCleanup(os.umask, old_umask)
3939
40 def setUpKeyAndCert(self):40 def setUpKeyAndCert(self):
@@ -97,11 +97,11 @@
97 self.assertRaises(CustomUploadAlreadyExists, self.process)97 self.assertRaises(CustomUploadAlreadyExists, self.process)
9898
99 def test_bad_umask(self):99 def test_bad_umask(self):
100 # The umask must be 022 to avoid incorrect permissions.100 # The umask must be 0o022 to avoid incorrect permissions.
101 self.setUpKeyAndCert()101 self.setUpKeyAndCert()
102 self.openArchive("test", "1.0", "amd64")102 self.openArchive("test", "1.0", "amd64")
103 self.archive.add_file("1.0/dir/file.efi", "foo")103 self.archive.add_file("1.0/dir/file.efi", "foo")
104 os.umask(002) # cleanup already handled by setUp104 os.umask(0o002) # cleanup already handled by setUp
105 self.assertRaises(CustomUploadBadUmask, self.process)105 self.assertRaises(CustomUploadBadUmask, self.process)
106106
107 def test_correct_signing_command(self):107 def test_correct_signing_command(self):
108108
=== modified file 'lib/lp/archiveuploader/tests/test_dscfile.py'
--- lib/lp/archiveuploader/tests/test_dscfile.py 2015-07-29 01:59:43 +0000
+++ lib/lp/archiveuploader/tests/test_dscfile.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2014 Canonical Ltd. This software is licensed under the1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test dscfile.py"""4"""Test dscfile.py"""
@@ -219,12 +219,12 @@
219 def test_ReadOnlyCWD(self):219 def test_ReadOnlyCWD(self):
220 """Processing a file should work when cwd is read-only."""220 """Processing a file should work when cwd is read-only."""
221 tempdir = self.useTempDir()221 tempdir = self.useTempDir()
222 os.chmod(tempdir, 0555)222 os.chmod(tempdir, 0o555)
223 try:223 try:
224 dsc_file = self.getDscFile('bar_1.0-1')224 dsc_file = self.getDscFile('bar_1.0-1')
225 list(dsc_file.verify())225 list(dsc_file.verify())
226 finally:226 finally:
227 os.chmod(tempdir, 0755)227 os.chmod(tempdir, 0o755)
228228
229229
230class BaseTestSourceFileVerification(TestCase):230class BaseTestSourceFileVerification(TestCase):
@@ -400,7 +400,7 @@
400 os.mkdir(unpacked_dir)400 os.mkdir(unpacked_dir)
401 bar_path = os.path.join(unpacked_dir, "bar_1.0")401 bar_path = os.path.join(unpacked_dir, "bar_1.0")
402 os.mkdir(bar_path)402 os.mkdir(bar_path)
403 os.chmod(bar_path, 0600)403 os.chmod(bar_path, 0o600)
404 os.chmod(unpacked_dir, 0600)404 os.chmod(unpacked_dir, 0o600)
405 cleanup_unpacked_dir(unpacked_dir)405 cleanup_unpacked_dir(unpacked_dir)
406 self.assertFalse(os.path.exists(unpacked_dir))406 self.assertFalse(os.path.exists(unpacked_dir))
407407
=== modified file 'lib/lp/bugs/doc/checkwatches-batching.txt'
--- lib/lp/bugs/doc/checkwatches-batching.txt 2010-10-18 22:24:59 +0000
+++ lib/lp/bugs/doc/checkwatches-batching.txt 2016-02-05 16:55:09 +0000
@@ -80,7 +80,7 @@
80 ... return remote_bug_ids[::2]80 ... return remote_bug_ids[::2]
8181
82 >>> remote = QueryableRemoteSystem()82 >>> remote = QueryableRemoteSystem()
83 >>> now = datetime(2010, 01, 13, 16, 52, tzinfo=UTC)83 >>> now = datetime(2010, 1, 13, 16, 52, tzinfo=UTC)
8484
85When there are no bug watches to check, the result is empty, and the85When there are no bug watches to check, the result is empty, and the
86remote system is not queried.86remote system is not queried.
8787
=== modified file 'lib/lp/bugs/doc/externalbugtracker.txt'
--- lib/lp/bugs/doc/externalbugtracker.txt 2015-07-08 16:05:11 +0000
+++ lib/lp/bugs/doc/externalbugtracker.txt 2016-02-05 16:55:09 +0000
@@ -518,7 +518,7 @@
518will then be passed on to initializeRemoteBugDB().518will then be passed on to initializeRemoteBugDB().
519519
520 >>> some_time_ago = datetime(520 >>> some_time_ago = datetime(
521 ... 2007, 03, 17, 16, 00, tzinfo=pytz.timezone('UTC'))521 ... 2007, 3, 17, 16, 0, tzinfo=pytz.timezone('UTC'))
522 >>> for bug_watch in bug_watches:522 >>> for bug_watch in bug_watches:
523 ... bug_watch.lastchecked = some_time_ago523 ... bug_watch.lastchecked = some_time_ago
524 >>> transaction.commit()524 >>> transaction.commit()
525525
=== modified file 'lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt'
--- lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2013-05-09 08:53:01 +0000
+++ lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2016-02-05 16:55:09 +0000
@@ -71,7 +71,7 @@
71 >>> login('foo.bar@canonical.com')71 >>> login('foo.bar@canonical.com')
72 >>> watch = getUtility(IBugWatchSet).get(2)72 >>> watch = getUtility(IBugWatchSet).get(2)
73 >>> removeSecurityProxy(watch).next_check = datetime(73 >>> removeSecurityProxy(watch).next_check = datetime(
74 ... 2010, 4, 8, 16, 07, tzinfo=utc)74 ... 2010, 4, 8, 16, 7, tzinfo=utc)
75 >>> logout()75 >>> logout()
7676
77 >>> admin_browser.open('http://bugs.launchpad.dev/bugs/1/+watch/2')77 >>> admin_browser.open('http://bugs.launchpad.dev/bugs/1/+watch/2')
7878
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-01-20 12:21:21 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-02-05 16:55:09 +0000
@@ -1200,10 +1200,10 @@
1200 recipe=recipe, distroseries=self.squirrel, archive=archive)1200 recipe=recipe, distroseries=self.squirrel, archive=archive)
1201 build.updateStatus(1201 build.updateStatus(
1202 BuildStatus.BUILDING,1202 BuildStatus.BUILDING,
1203 date_started=datetime(2010, 03, 16, tzinfo=UTC))1203 date_started=datetime(2010, 3, 16, tzinfo=UTC))
1204 build.updateStatus(1204 build.updateStatus(
1205 BuildStatus.FULLYBUILT,1205 BuildStatus.FULLYBUILT,
1206 date_finished=datetime(2010, 03, 16, tzinfo=UTC))1206 date_finished=datetime(2010, 3, 16, tzinfo=UTC))
1207 return build1207 return build
12081208
1209 def test_index(self):1209 def test_index(self):
@@ -1290,10 +1290,10 @@
1290 binary_build.queueBuild()1290 binary_build.queueBuild()
1291 binary_build.updateStatus(1291 binary_build.updateStatus(
1292 BuildStatus.BUILDING,1292 BuildStatus.BUILDING,
1293 date_started=datetime(2010, 04, 16, tzinfo=UTC))1293 date_started=datetime(2010, 4, 16, tzinfo=UTC))
1294 binary_build.updateStatus(1294 binary_build.updateStatus(
1295 BuildStatus.FULLYBUILT,1295 BuildStatus.FULLYBUILT,
1296 date_finished=datetime(2010, 04, 16, tzinfo=UTC))1296 date_finished=datetime(2010, 4, 16, tzinfo=UTC))
1297 binary_build.setLog(self.factory.makeLibraryFileAlias())1297 binary_build.setLog(self.factory.makeLibraryFileAlias())
12981298
1299 self.assertTextMatchesExpressionIgnoreWhitespace("""\1299 self.assertTextMatchesExpressionIgnoreWhitespace("""\
@@ -1360,7 +1360,7 @@
1360 # We create builds in time ascending order (oldest first) since we1360 # We create builds in time ascending order (oldest first) since we
1361 # use id as the ordering attribute and lower ids mean created earlier.1361 # use id as the ordering attribute and lower ids mean created earlier.
1362 date_gen = time_counter(1362 date_gen = time_counter(
1363 datetime(2010, 03, 16, tzinfo=UTC), timedelta(days=1))1363 datetime(2010, 3, 16, tzinfo=UTC), timedelta(days=1))
1364 build1 = self.makeBuildJob(recipe, date_gen.next())1364 build1 = self.makeBuildJob(recipe, date_gen.next())
1365 build2 = self.makeBuildJob(recipe, date_gen.next())1365 build2 = self.makeBuildJob(recipe, date_gen.next())
1366 build3 = self.makeBuildJob(recipe, date_gen.next())1366 build3 = self.makeBuildJob(recipe, date_gen.next())
13671367
=== modified file 'lib/lp/code/feed/tests/test_revision.py'
--- lib/lp/code/feed/tests/test_revision.py 2012-01-01 02:58:52 +0000
+++ lib/lp/code/feed/tests/test_revision.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the revision feeds."""4"""Tests for the revision feeds."""
@@ -32,7 +32,7 @@
32 def test_format(self):32 def test_format(self):
33 # The id contains the iso format of the date part of the revision33 # The id contains the iso format of the date part of the revision
34 # date, and the revision id.34 # date, and the revision id.
35 revision_date = datetime(2009, 07, 21, 12, tzinfo=UTC)35 revision_date = datetime(2009, 7, 21, 12, tzinfo=UTC)
36 revision = self.factory.makeRevision(36 revision = self.factory.makeRevision(
37 revision_date=revision_date, rev_id="test_revision_id")37 revision_date=revision_date, rev_id="test_revision_id")
38 feed_id = revision_feed_id(revision)38 feed_id = revision_feed_id(revision)
3939
=== modified file 'lib/lp/code/model/tests/test_gitjob.py'
--- lib/lp/code/model/tests/test_gitjob.py 2015-10-28 17:32:49 +0000
+++ lib/lp/code/model/tests/test_gitjob.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2015 Canonical Ltd. This software is licensed under the1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for `GitJob`s."""4"""Tests for `GitJob`s."""
@@ -162,7 +162,7 @@
162 job = GitRefScanJob.create(repository)162 job = GitRefScanJob.create(repository)
163 paths = (u"refs/heads/master", u"refs/tags/1.0")163 paths = (u"refs/heads/master", u"refs/tags/1.0")
164 author = repository.owner164 author = repository.owner
165 author_date_start = datetime(2015, 01, 01, tzinfo=pytz.UTC)165 author_date_start = datetime(2015, 1, 1, tzinfo=pytz.UTC)
166 author_date_gen = time_counter(author_date_start, timedelta(days=1))166 author_date_gen = time_counter(author_date_start, timedelta(days=1))
167 hosting_client = FakeGitHostingClient(167 hosting_client = FakeGitHostingClient(
168 self.makeFakeRefs(paths),168 self.makeFakeRefs(paths),
169169
=== modified file 'lib/lp/code/model/tests/test_gitrepository.py'
--- lib/lp/code/model/tests/test_gitrepository.py 2016-01-20 12:21:21 +0000
+++ lib/lp/code/model/tests/test_gitrepository.py 2016-02-05 16:55:09 +0000
@@ -724,7 +724,7 @@
724 # When a GitRepository receives an object modified event, the last724 # When a GitRepository receives an object modified event, the last
725 # modified date is set to UTC_NOW.725 # modified date is set to UTC_NOW.
726 repository = self.factory.makeGitRepository(726 repository = self.factory.makeGitRepository(
727 date_created=datetime(2015, 02, 04, 17, 42, 0, tzinfo=pytz.UTC))727 date_created=datetime(2015, 2, 4, 17, 42, 0, tzinfo=pytz.UTC))
728 notify(ObjectModifiedEvent(728 notify(ObjectModifiedEvent(
729 removeSecurityProxy(repository), repository,729 removeSecurityProxy(repository), repository,
730 [IGitRepository["name"]], user=repository.owner))730 [IGitRepository["name"]], user=repository.owner))
@@ -733,7 +733,7 @@
733733
734 def test_create_ref_sets_date_last_modified(self):734 def test_create_ref_sets_date_last_modified(self):
735 repository = self.factory.makeGitRepository(735 repository = self.factory.makeGitRepository(
736 date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC))736 date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC))
737 [ref] = self.factory.makeGitRefs(repository=repository)737 [ref] = self.factory.makeGitRefs(repository=repository)
738 new_refs_info = {738 new_refs_info = {
739 ref.path: {739 ref.path: {
@@ -747,7 +747,7 @@
747747
748 def test_update_ref_sets_date_last_modified(self):748 def test_update_ref_sets_date_last_modified(self):
749 repository = self.factory.makeGitRepository(749 repository = self.factory.makeGitRepository(
750 date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC))750 date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC))
751 [ref] = self.factory.makeGitRefs(repository=repository)751 [ref] = self.factory.makeGitRefs(repository=repository)
752 new_refs_info = {752 new_refs_info = {
753 u"refs/heads/new": {753 u"refs/heads/new": {
@@ -761,7 +761,7 @@
761761
762 def test_remove_ref_sets_date_last_modified(self):762 def test_remove_ref_sets_date_last_modified(self):
763 repository = self.factory.makeGitRepository(763 repository = self.factory.makeGitRepository(
764 date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC))764 date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC))
765 [ref] = self.factory.makeGitRefs(repository=repository)765 [ref] = self.factory.makeGitRefs(repository=repository)
766 repository.removeRefs(set([ref.path]))766 repository.removeRefs(set([ref.path]))
767 self.assertSqlAttributeEqualsDate(767 self.assertSqlAttributeEqualsDate(
768768
=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
--- lib/lp/code/xmlrpc/tests/test_codehosting.py 2015-10-19 10:56:16 +0000
+++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2012 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the internal codehosting API."""4"""Tests for the internal codehosting API."""
@@ -230,8 +230,8 @@
230230
231 def test_recordSuccess(self):231 def test_recordSuccess(self):
232 # recordSuccess must insert the given data into ScriptActivity.232 # recordSuccess must insert the given data into ScriptActivity.
233 started = datetime.datetime(2007, 07, 05, 19, 32, 1, tzinfo=UTC)233 started = datetime.datetime(2007, 7, 5, 19, 32, 1, tzinfo=UTC)
234 completed = datetime.datetime(2007, 07, 05, 19, 34, 24, tzinfo=UTC)234 completed = datetime.datetime(2007, 7, 5, 19, 34, 24, tzinfo=UTC)
235 started_tuple = tuple(started.utctimetuple())235 started_tuple = tuple(started.utctimetuple())
236 completed_tuple = tuple(completed.utctimetuple())236 completed_tuple = tuple(completed.utctimetuple())
237 success = self.codehosting_api.recordSuccess(237 success = self.codehosting_api.recordSuccess(
238238
=== modified file 'lib/lp/codehosting/codeimport/tests/servers.py'
--- lib/lp/codehosting/codeimport/tests/servers.py 2012-09-06 09:25:47 +0000
+++ lib/lp/codehosting/codeimport/tests/servers.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Server classes that know how to create various kinds of foreign archive."""4"""Server classes that know how to create various kinds of foreign archive."""
@@ -277,7 +277,7 @@
277 in tree_contents]277 in tree_contents]
278 repo.object_store.add_objects(blobs)278 repo.object_store.add_objects(blobs)
279 root_id = dulwich.index.commit_tree(repo.object_store, [279 root_id = dulwich.index.commit_tree(repo.object_store, [
280 (filename, b.id, stat.S_IFREG | 0644)280 (filename, b.id, stat.S_IFREG | 0o644)
281 for (b, filename) in blobs])281 for (b, filename) in blobs])
282 repo.do_commit(committer='Joe Foo <joe@foo.com>',282 repo.do_commit(committer='Joe Foo <joe@foo.com>',
283 message=u'<The commit message>', tree=root_id)283 message=u'<The commit message>', tree=root_id)
284284
=== modified file 'lib/lp/codehosting/tests/servers.py'
--- lib/lp/codehosting/tests/servers.py 2012-08-14 23:27:07 +0000
+++ lib/lp/codehosting/tests/servers.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2012 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Server used in codehosting acceptance tests."""4"""Server used in codehosting acceptance tests."""
@@ -67,7 +67,7 @@
67 """Clear the branch areas."""67 """Clear the branch areas."""
68 if os.path.isdir(self._mirror_root):68 if os.path.isdir(self._mirror_root):
69 shutil.rmtree(self._mirror_root)69 shutil.rmtree(self._mirror_root)
70 os.makedirs(self._mirror_root, 0700)70 os.makedirs(self._mirror_root, 0o700)
7171
72 def setUpRoot(self):72 def setUpRoot(self):
73 self.clear()73 self.clear()
@@ -112,7 +112,7 @@
112 shutil.copyfile(112 shutil.copyfile(
113 sibpath(__file__, 'id_dsa.pub'),113 sibpath(__file__, 'id_dsa.pub'),
114 os.path.join(user_home, '.ssh', 'id_dsa.pub'))114 os.path.join(user_home, '.ssh', 'id_dsa.pub'))
115 os.chmod(os.path.join(user_home, '.ssh', 'id_dsa'), 0600)115 os.chmod(os.path.join(user_home, '.ssh', 'id_dsa'), 0o600)
116 real_home, os.environ['HOME'] = os.environ['HOME'], user_home116 real_home, os.environ['HOME'] = os.environ['HOME'], user_home
117 return real_home, user_home117 return real_home, user_home
118118
119119
=== modified file 'lib/lp/codehosting/tests/test_sftp.py'
--- lib/lp/codehosting/tests/test_sftp.py 2015-01-06 12:47:59 +0000
+++ lib/lp/codehosting/tests/test_sftp.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the transport-backed SFTP server implementation."""4"""Tests for the transport-backed SFTP server implementation."""
@@ -138,7 +138,7 @@
138 branch_name = self.factory.getUniqueString()138 branch_name = self.factory.getUniqueString()
139 deferred = server.makeDirectory(139 deferred = server.makeDirectory(
140 '~%s/%s/%s' % (avatar.username, product.name, branch_name),140 '~%s/%s/%s' % (avatar.username, product.name, branch_name),
141 {'permissions': 0777})141 {'permissions': 0o777})
142 return deferred142 return deferred
143143
144144
@@ -507,12 +507,12 @@
507 # makeDirectory makes the directory.507 # makeDirectory makes the directory.
508 directory = self.getPathSegment()508 directory = self.getPathSegment()
509 deferred = self.sftp_server.makeDirectory(509 deferred = self.sftp_server.makeDirectory(
510 directory, {'permissions': 0777})510 directory, {'permissions': 0o777})
511511
512 def assertDirectoryExists(ignored):512 def assertDirectoryExists(ignored):
513 self.assertTrue(513 self.assertTrue(
514 os.path.isdir(directory), '%r is not a directory' % directory)514 os.path.isdir(directory), '%r is not a directory' % directory)
515 self.assertEqual(040777, os.stat(directory).st_mode)515 self.assertEqual(0o40777, os.stat(directory).st_mode)
516516
517 return deferred.addCallback(assertDirectoryExists)517 return deferred.addCallback(assertDirectoryExists)
518518
@@ -521,7 +521,7 @@
521 nonexistent = self.getPathSegment()521 nonexistent = self.getPathSegment()
522 nonexistent_child = '%s/%s' % (nonexistent, self.getPathSegment())522 nonexistent_child = '%s/%s' % (nonexistent, self.getPathSegment())
523 deferred = self.sftp_server.makeDirectory(523 deferred = self.sftp_server.makeDirectory(
524 nonexistent_child, {'permissions': 0777})524 nonexistent_child, {'permissions': 0o777})
525 return assert_fails_with(deferred, filetransfer.SFTPError)525 return assert_fails_with(deferred, filetransfer.SFTPError)
526526
527 def test_removeDirectory(self):527 def test_removeDirectory(self):
528528
=== modified file 'lib/lp/hardwaredb/doc/hwdb.txt'
--- lib/lp/hardwaredb/doc/hwdb.txt 2016-01-26 15:47:37 +0000
+++ lib/lp/hardwaredb/doc/hwdb.txt 2016-02-05 16:55:09 +0000
@@ -159,8 +159,8 @@
159 ... HWSubmissionFormat,159 ... HWSubmissionFormat,
160 ... IHWSubmissionSet,160 ... IHWSubmissionSet,
161 ... )161 ... )
162 >>> date_created = datetime(2007, 04, 01, tzinfo=pytz.timezone('UTC'))162 >>> date_created = datetime(2007, 4, 1, tzinfo=pytz.timezone('UTC'))
163 >>> date_submitted = datetime(2007, 04, 02, tzinfo=pytz.timezone('UTC'))163 >>> date_submitted = datetime(2007, 4, 2, tzinfo=pytz.timezone('UTC'))
164 >>> submission_data = 'submission data'164 >>> submission_data = 'submission data'
165 >>> hw_submission_set = getUtility(IHWSubmissionSet)165 >>> hw_submission_set = getUtility(IHWSubmissionSet)
166 >>> submission = hw_submission_set.createSubmission(166 >>> submission = hw_submission_set.createSubmission(
167167
=== modified file 'lib/lp/registry/browser/tests/productseries-views.txt'
--- lib/lp/registry/browser/tests/productseries-views.txt 2012-11-08 03:55:11 +0000
+++ lib/lp/registry/browser/tests/productseries-views.txt 2016-02-05 16:55:09 +0000
@@ -214,7 +214,7 @@
214 >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities214 >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities
215 >>> celebrities = getUtility(ILaunchpadCelebrities)215 >>> celebrities = getUtility(ILaunchpadCelebrities)
216216
217 >>> test_date = datetime(2009, 05, 01, 19, 34, 24, tzinfo=UTC)217 >>> test_date = datetime(2009, 5, 1, 19, 34, 24, tzinfo=UTC)
218 >>> product = factory.makeProduct(name="field", displayname='Field')218 >>> product = factory.makeProduct(name="field", displayname='Field')
219 >>> productseries = factory.makeProductSeries(219 >>> productseries = factory.makeProductSeries(
220 ... product=product, name='rabbit', date_created=test_date)220 ... product=product, name='rabbit', date_created=test_date)
221221
=== modified file 'lib/lp/registry/browser/tests/test_announcements.py'
--- lib/lp/registry/browser/tests/test_announcements.py 2012-01-01 02:58:52 +0000
+++ lib/lp/registry/browser/tests/test_announcements.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the1# Copyright 2011-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for +announcement views."""4"""Tests for +announcement views."""
@@ -36,7 +36,7 @@
36 def test_announcement_info_with_publication_date(self):36 def test_announcement_info_with_publication_date(self):
37 product = self.factory.makeProduct(displayname=u"Foo")37 product = self.factory.makeProduct(displayname=u"Foo")
38 announcer = self.factory.makePerson(displayname=u"Bar Baz")38 announcer = self.factory.makePerson(displayname=u"Bar Baz")
39 announced = datetime(2007, 01, 12, tzinfo=utc)39 announced = datetime(2007, 1, 12, tzinfo=utc)
40 announcement = product.announce(40 announcement = product.announce(
41 announcer, "Hello World", publication_date=announced)41 announcer, "Hello World", publication_date=announced)
42 view = create_initialized_view(announcement, "+index")42 view = create_initialized_view(announcement, "+index")
4343
=== modified file 'lib/lp/registry/doc/distribution-mirror.txt'
--- lib/lp/registry/doc/distribution-mirror.txt 2016-01-26 15:47:37 +0000
+++ lib/lp/registry/doc/distribution-mirror.txt 2016-02-05 16:55:09 +0000
@@ -576,8 +576,8 @@
576 ... warty.components[0])576 ... warty.components[0])
577 >>> warty_i386_mirror = removeSecurityProxy(warty_i386_mirror)577 >>> warty_i386_mirror = removeSecurityProxy(warty_i386_mirror)
578 >>> recent_freshness, threshold = warty_i386_mirror.freshness_times[0]578 >>> recent_freshness, threshold = warty_i386_mirror.freshness_times[0]
579 >>> start = datetime(2005, 06, 20, tzinfo=utc)579 >>> start = datetime(2005, 6, 20, tzinfo=utc)
580 >>> end = datetime(2005, 06, 20, tzinfo=utc) + timedelta(hours=0.5)580 >>> end = datetime(2005, 6, 20, tzinfo=utc) + timedelta(hours=0.5)
581 >>> time_interval = (start, end)581 >>> time_interval = (start, end)
582 >>> upload = warty_i386_mirror.getLatestPublishingEntry(582 >>> upload = warty_i386_mirror.getLatestPublishingEntry(
583 ... time_interval, deb_only=False)583 ... time_interval, deb_only=False)
584584
=== modified file 'lib/lp/registry/doc/poll.txt'
--- lib/lp/registry/doc/poll.txt 2011-12-30 06:14:56 +0000
+++ lib/lp/registry/doc/poll.txt 2016-02-05 16:55:09 +0000
@@ -39,7 +39,7 @@
39 >>> pollsubset = IPollSubset(team)39 >>> pollsubset = IPollSubset(team)
4040
41Now we create a new poll on this team.41Now we create a new poll on this team.
42 >>> opendate = datetime(2005, 01, 01, tzinfo=pytz.timezone('UTC'))42 >>> opendate = datetime(2005, 1, 1, tzinfo=pytz.timezone('UTC'))
43 >>> closedate = opendate + timedelta(weeks=2)43 >>> closedate = opendate + timedelta(weeks=2)
44 >>> title = "2005 Leader's Elections"44 >>> title = "2005 Leader's Elections"
45 >>> proposition = "Who's going to be the next leader?"45 >>> proposition = "Who's going to be the next leader?"
4646
=== modified file 'lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt'
--- lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt 2016-01-26 15:47:37 +0000
+++ lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt 2016-02-05 16:55:09 +0000
@@ -214,7 +214,7 @@
214 >>> logintoken = LoginToken.selectOneBy(214 >>> logintoken = LoginToken.selectOneBy(
215 ... _token=hashlib.sha256(token_value).hexdigest())215 ... _token=hashlib.sha256(token_value).hexdigest())
216 >>> logintoken.date_created = datetime.datetime(216 >>> logintoken.date_created = datetime.datetime(
217 ... 2005,04,01, 12,00,00, tzinfo=pytz.timezone('UTC'))217 ... 2005, 4, 1, 12, 0, 0, tzinfo=pytz.timezone('UTC'))
218 >>> logintoken.sync()218 >>> logintoken.sync()
219219
220Back to Sample User. They visit the token URL and is asked to sign some220Back to Sample User. They visit the token URL and is asked to sign some
221221
=== modified file 'lib/lp/registry/tests/test_distributionmirror_prober.py'
--- lib/lp/registry/tests/test_distributionmirror_prober.py 2015-02-18 18:44:32 +0000
+++ lib/lp/registry/tests/test_distributionmirror_prober.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2015 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""distributionmirror-prober tests."""4"""distributionmirror-prober tests."""
@@ -930,7 +930,7 @@
930930
931 def _fake_gettime(self):931 def _fake_gettime(self):
932 # Fake the current time.932 # Fake the current time.
933 fake_time = datetime(2004, 10, 20, 12, 00, 00, 000000)933 fake_time = datetime(2004, 10, 20, 12, 0, 0, 0)
934 return fake_time934 return fake_time
935935
936 def test_logMessage_output(self):936 def test_logMessage_output(self):
937937
=== modified file 'lib/lp/scripts/runlaunchpad.py'
--- lib/lp/scripts/runlaunchpad.py 2014-01-06 06:52:41 +0000
+++ lib/lp/scripts/runlaunchpad.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2014 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -273,7 +273,7 @@
273273
274def prepare_for_librarian():274def prepare_for_librarian():
275 if not os.path.isdir(config.librarian_server.root):275 if not os.path.isdir(config.librarian_server.root):
276 os.makedirs(config.librarian_server.root, 0700)276 os.makedirs(config.librarian_server.root, 0o700)
277277
278278
279SERVICES = {279SERVICES = {
280280
=== modified file 'lib/lp/scripts/tests/test_garbo.py'
--- lib/lp/scripts/tests/test_garbo.py 2015-12-15 15:58:49 +0000
+++ lib/lp/scripts/tests/test_garbo.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2015 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test the database garbage collector."""4"""Test the database garbage collector."""
@@ -735,7 +735,7 @@
735 self.factory.makePerson(name='test-unlinked-person-new')735 self.factory.makePerson(name='test-unlinked-person-new')
736 person_old = self.factory.makePerson(name='test-unlinked-person-old')736 person_old = self.factory.makePerson(name='test-unlinked-person-old')
737 removeSecurityProxy(person_old).datecreated = datetime(737 removeSecurityProxy(person_old).datecreated = datetime(
738 2008, 01, 01, tzinfo=UTC)738 2008, 1, 1, tzinfo=UTC)
739739
740 # Normally, the garbage collector will do nothing because the740 # Normally, the garbage collector will do nothing because the
741 # PersonPruner is experimental741 # PersonPruner is experimental
@@ -1030,7 +1030,7 @@
1030 path="sample path"))))1030 path="sample path"))))
1031 # One to clean and one to keep1031 # One to clean and one to keep
1032 store.add(TimeLimitedToken(path="sample path", token="foo",1032 store.add(TimeLimitedToken(path="sample path", token="foo",
1033 created=datetime(2008, 01, 01, tzinfo=UTC)))1033 created=datetime(2008, 1, 1, tzinfo=UTC)))
1034 store.add(TimeLimitedToken(path="sample path", token="bar")),1034 store.add(TimeLimitedToken(path="sample path", token="bar")),
1035 store.commit()1035 store.commit()
1036 self.assertEqual(2, len(list(store.find(TimeLimitedToken,1036 self.assertEqual(2, len(list(store.find(TimeLimitedToken,
10371037
=== modified file 'lib/lp/services/librarianserver/testing/server.py'
--- lib/lp/services/librarianserver/testing/server.py 2012-02-28 05:36:01 +0000
+++ lib/lp/services/librarianserver/testing/server.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2011 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Fixture for the librarians."""4"""Fixture for the librarians."""
@@ -130,7 +130,7 @@
130 root_fixture = FunctionFixture(tempfile.mkdtemp, shutil.rmtree)130 root_fixture = FunctionFixture(tempfile.mkdtemp, shutil.rmtree)
131 self.useFixture(root_fixture)131 self.useFixture(root_fixture)
132 self._root = root_fixture.fn_result132 self._root = root_fixture.fn_result
133 os.chmod(self.root, 0700)133 os.chmod(self.root, 0o700)
134 # Give the root to the new librarian.134 # Give the root to the new librarian.
135 os.environ['LP_LIBRARIAN_ROOT'] = self._root135 os.environ['LP_LIBRARIAN_ROOT'] = self._root
136 else:136 else:
@@ -139,7 +139,7 @@
139 if os.path.exists(self.root):139 if os.path.exists(self.root):
140 self.tearDownRoot()140 self.tearDownRoot()
141 self.addCleanup(self.tearDownRoot)141 self.addCleanup(self.tearDownRoot)
142 os.makedirs(self.root, 0700)142 os.makedirs(self.root, 0o700)
143143
144 def _waitForDaemonStartup(self):144 def _waitForDaemonStartup(self):
145 super(LibrarianServerFixture, self)._waitForDaemonStartup()145 super(LibrarianServerFixture, self)._waitForDaemonStartup()
146146
=== modified file 'lib/lp/services/librarianserver/tests/test_web.py'
--- lib/lp/services/librarianserver/tests/test_web.py 2015-12-27 03:42:08 +0000
+++ lib/lp/services/librarianserver/tests/test_web.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from cStringIO import StringIO4from cStringIO import StringIO
@@ -223,7 +223,7 @@
223 file_alias = IMasterStore(LibraryFileAlias).get(223 file_alias = IMasterStore(LibraryFileAlias).get(
224 LibraryFileAlias, file_alias_id)224 LibraryFileAlias, file_alias_id)
225 file_alias.date_created = datetime(225 file_alias.date_created = datetime(
226 2001, 01, 30, 13, 45, 59, tzinfo=pytz.utc)226 2001, 1, 30, 13, 45, 59, tzinfo=pytz.utc)
227227
228 # Commit so the file is available from the Librarian.228 # Commit so the file is available from the Librarian.
229 self.commit()229 self.commit()
@@ -419,7 +419,7 @@
419 file_alias = IMasterStore(LibraryFileAlias).get(419 file_alias = IMasterStore(LibraryFileAlias).get(
420 LibraryFileAlias, fileAlias)420 LibraryFileAlias, fileAlias)
421 file_alias.date_created = datetime(421 file_alias.date_created = datetime(
422 2001, 01, 30, 13, 45, 59, tzinfo=pytz.utc)422 2001, 1, 30, 13, 45, 59, tzinfo=pytz.utc)
423 # Commit the update.423 # Commit the update.
424 self.commit()424 self.commit()
425 # Fetch the file via HTTP, recording the interesting headers425 # Fetch the file via HTTP, recording the interesting headers
426426
=== modified file 'lib/lp/services/osutils.py'
--- lib/lp/services/osutils.py 2012-12-26 02:03:56 +0000
+++ lib/lp/services/osutils.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2012 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Utilities for doing the sort of thing the os module does."""4"""Utilities for doing the sort of thing the os module does."""
@@ -64,7 +64,7 @@
64 set_environ(old_values)64 set_environ(old_values)
6565
6666
67def ensure_directory_exists(directory, mode=0777):67def ensure_directory_exists(directory, mode=0o777):
68 """Create 'directory' if it doesn't exist.68 """Create 'directory' if it doesn't exist.
6969
70 :return: True if the directory had to be created, False otherwise.70 :return: True if the directory had to be created, False otherwise.
@@ -78,7 +78,7 @@
78 return True78 return True
7979
8080
81def open_for_writing(filename, mode, dirmode=0777):81def open_for_writing(filename, mode, dirmode=0o777):
82 """Open 'filename' for writing, creating directories if necessary.82 """Open 'filename' for writing, creating directories if necessary.
8383
84 :param filename: The path of the file to open.84 :param filename: The path of the file to open.
8585
=== modified file 'lib/lp/services/tarfile_helpers.py'
--- lib/lp/services/tarfile_helpers.py 2012-05-25 13:22:27 +0000
+++ lib/lp/services/tarfile_helpers.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2012 Canonical Ltd. This software is licensed under the1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Helpers to work with tar files more easily."""4"""Helpers to work with tar files more easily."""
@@ -87,7 +87,7 @@
87 except KeyError:87 except KeyError:
88 tarinfo = self._make_skeleton_tarinfo(joined_path, now)88 tarinfo = self._make_skeleton_tarinfo(joined_path, now)
89 tarinfo.type = tarfile.DIRTYPE89 tarinfo.type = tarfile.DIRTYPE
90 tarinfo.mode = 075590 tarinfo.mode = 0o755
91 self.tarfile.addfile(tarinfo)91 self.tarfile.addfile(tarinfo)
9292
93 def add_directory(self, path):93 def add_directory(self, path):
@@ -105,7 +105,7 @@
105 self._ensure_directories(path, now)105 self._ensure_directories(path, now)
106106
107 tarinfo = self._make_skeleton_tarinfo(path, now)107 tarinfo = self._make_skeleton_tarinfo(path, now)
108 tarinfo.mode = 0644108 tarinfo.mode = 0o644
109 tarinfo.size = len(contents)109 tarinfo.size = len(contents)
110 self.tarfile.addfile(tarinfo, StringIO(contents))110 self.tarfile.addfile(tarinfo, StringIO(contents))
111111
112112
=== modified file 'lib/lp/services/webapp/tests/test_batching.py'
--- lib/lp/services/webapp/tests/test_batching.py 2015-10-01 10:25:19 +0000
+++ lib/lp/services/webapp/tests/test_batching.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2011 Canonical Ltd. This software is licensed under the1# Copyright 2011-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -395,7 +395,7 @@
395 range_factory = StormRangeFactory(resultset, self.logError)395 range_factory = StormRangeFactory(resultset, self.logError)
396 order_by = [396 order_by = [
397 Person.id, Person.datecreated, Person.name, Person.display_name]397 Person.id, Person.datecreated, Person.name, Person.display_name]
398 limits = [1, datetime(2011, 07, 25, 0, 0, 0), 'foo', 'bar']398 limits = [1, datetime(2011, 7, 25, 0, 0, 0), 'foo', 'bar']
399 result = range_factory.limitsGroupedByOrderDirection(order_by, limits)399 result = range_factory.limitsGroupedByOrderDirection(order_by, limits)
400 self.assertEqual([(order_by, limits)], result)400 self.assertEqual([(order_by, limits)], result)
401 order_by = [401 order_by = [
@@ -443,7 +443,7 @@
443 Person.id, Person.datecreated, Desc(Person.name),443 Person.id, Person.datecreated, Desc(Person.name),
444 Desc(Person.display_name)]444 Desc(Person.display_name)]
445 limits = [445 limits = [
446 1, datetime(2011, 07, 25, 0, 0, 0, tzinfo=pytz.UTC), 'foo', 'bar']446 1, datetime(2011, 7, 25, 0, 0, 0, tzinfo=pytz.UTC), 'foo', 'bar']
447 limits = range_factory.limitsGroupedByOrderDirection(order_by, limits)447 limits = range_factory.limitsGroupedByOrderDirection(order_by, limits)
448 equals_expressions = range_factory.equalsExpressionsFromLimits(limits)448 equals_expressions = range_factory.equalsExpressionsFromLimits(limits)
449 equals_expressions = map(compile, equals_expressions)449 equals_expressions = map(compile, equals_expressions)
450450
=== modified file 'lib/lp/snappy/tests/test_snapbuild.py'
--- lib/lp/snappy/tests/test_snapbuild.py 2016-02-04 00:45:12 +0000
+++ lib/lp/snappy/tests/test_snapbuild.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2015 Canonical Ltd. This software is licensed under the1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test snap package build features."""4"""Test snap package build features."""
@@ -238,7 +238,7 @@
238 build = self.factory.makeSnapBuild(238 build = self.factory.makeSnapBuild(
239 name=u"snap-1", requester=person, owner=person,239 name=u"snap-1", requester=person, owner=person,
240 distroarchseries=distroarchseries,240 distroarchseries=distroarchseries,
241 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC),241 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC),
242 status=BuildStatus.FAILEDTOBUILD,242 status=BuildStatus.FAILEDTOBUILD,
243 builder=self.factory.makeBuilder(name="bob"),243 builder=self.factory.makeBuilder(name="bob"),
244 duration=timedelta(minutes=10))244 duration=timedelta(minutes=10))
@@ -332,7 +332,7 @@
332 # The basic properties of a SnapBuild are sensible.332 # The basic properties of a SnapBuild are sensible.
333 db_build = self.factory.makeSnapBuild(333 db_build = self.factory.makeSnapBuild(
334 requester=self.person,334 requester=self.person,
335 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC))335 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC))
336 build_url = api_url(db_build)336 build_url = api_url(db_build)
337 logout()337 logout()
338 build = self.webservice.get(build_url).jsonBody()338 build = self.webservice.get(build_url).jsonBody()
339339
=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py 2016-01-26 15:47:37 +0000
+++ lib/lp/soyuz/model/queue.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2015 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -1444,7 +1444,7 @@
1444 dest_file = os.path.join(1444 dest_file = os.path.join(
1445 archive_config.metaroot, self.libraryfilealias.filename)1445 archive_config.metaroot, self.libraryfilealias.filename)
1446 if not os.path.isdir(archive_config.metaroot):1446 if not os.path.isdir(archive_config.metaroot):
1447 os.makedirs(archive_config.metaroot, 0755)1447 os.makedirs(archive_config.metaroot, 0o755)
14481448
1449 # At this point we now have a directory of the format:1449 # At this point we now have a directory of the format:
1450 # <person_name>/meta/<ppa_name>1450 # <person_name>/meta/<ppa_name>
14511451
=== modified file 'lib/lp/soyuz/tests/test_binarypackagename.py'
--- lib/lp/soyuz/tests/test_binarypackagename.py 2012-09-26 08:12:48 +0000
+++ lib/lp/soyuz/tests/test_binarypackagename.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010 Canonical Ltd. This software is licensed under the1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test BinaryPackageName."""4"""Test BinaryPackageName."""
@@ -169,10 +169,10 @@
169 name = self.factory.makeBinaryPackageName()169 name = self.factory.makeBinaryPackageName()
170 self.factory.makeBinaryPackageRelease(170 self.factory.makeBinaryPackageRelease(
171 binarypackagename=name, description="foo",171 binarypackagename=name, description="foo",
172 date_created=datetime(1980, 01, 01, tzinfo=pytz.UTC))172 date_created=datetime(1980, 1, 1, tzinfo=pytz.UTC))
173 self.factory.makeBinaryPackageRelease(173 self.factory.makeBinaryPackageRelease(
174 binarypackagename=name, description="bar",174 binarypackagename=name, description="bar",
175 date_created=datetime(2000, 01, 01, tzinfo=pytz.UTC))175 date_created=datetime(2000, 1, 1, tzinfo=pytz.UTC))
176 self.assertEqual(176 self.assertEqual(
177 {name.name: "bar"},177 {name.name: "bar"},
178 getBinaryPackageDescriptions([name], max_title_length=3))178 getBinaryPackageDescriptions([name], max_title_length=3))
179179
=== modified file 'lib/lp/soyuz/tests/test_build.py'
--- lib/lp/soyuz/tests/test_build.py 2015-09-11 12:21:16 +0000
+++ lib/lp/soyuz/tests/test_build.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2011-2015 Canonical Ltd. This software is licensed under the1# Copyright 2011-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4__metaclass__ = type4__metaclass__ = type
@@ -112,10 +112,10 @@
112 self.assertEquals(112 self.assertEquals(
113 PackageUploadStatus.DONE, build.package_upload.status)113 PackageUploadStatus.DONE, build.package_upload.status)
114 self.assertEquals(114 self.assertEquals(
115 datetime(2008, 01, 01, 0, 0, 0, tzinfo=pytz.UTC),115 datetime(2008, 1, 1, 0, 0, 0, tzinfo=pytz.UTC),
116 build.date_started)116 build.date_started)
117 self.assertEquals(117 self.assertEquals(
118 datetime(2008, 01, 01, 0, 5, 0, tzinfo=pytz.UTC),118 datetime(2008, 1, 1, 0, 5, 0, tzinfo=pytz.UTC),
119 build.date_finished)119 build.date_finished)
120 self.assertEquals(timedelta(minutes=5), build.duration)120 self.assertEquals(timedelta(minutes=5), build.duration)
121 expected_buildlog = 'buildlog_%s-%s-%s.%s_%s_FULLYBUILT.txt.gz' % (121 expected_buildlog = 'buildlog_%s-%s-%s.%s_%s_FULLYBUILT.txt.gz' % (
122122
=== modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py'
--- lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py 2012-07-02 16:11:15 +0000
+++ lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test upload and queue manipulation of DDTP tarballs.4"""Test upload and queue manipulation of DDTP tarballs.
@@ -36,8 +36,8 @@
36 def setUp(self):36 def setUp(self):
37 super(TestDistroSeriesQueueDdtpTarball, self).setUp()37 super(TestDistroSeriesQueueDdtpTarball, self).setUp()
38 import_public_test_keys()38 import_public_test_keys()
39 # CustomUpload.installFiles requires a umask of 022.39 # CustomUpload.installFiles requires a umask of 0o022.
40 old_umask = os.umask(022)40 old_umask = os.umask(0o022)
41 self.addCleanup(os.umask, old_umask)41 self.addCleanup(os.umask, old_umask)
42 self.anything_policy = getPolicy(42 self.anything_policy = getPolicy(
43 name="anything", distro="ubuntutest", distroseries=None)43 name="anything", distro="ubuntutest", distroseries=None)
4444
=== modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py'
--- lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py 2015-08-26 13:41:21 +0000
+++ lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012-2015 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test upload and queue manipulation of debian-installer custom uploads.4"""Test upload and queue manipulation of debian-installer custom uploads.
@@ -29,8 +29,8 @@
29 def setUp(self):29 def setUp(self):
30 super(TestDistroSeriesQueueDebianInstaller, self).setUp()30 super(TestDistroSeriesQueueDebianInstaller, self).setUp()
31 import_public_test_keys()31 import_public_test_keys()
32 # CustomUpload.installFiles requires a umask of 022.32 # CustomUpload.installFiles requires a umask of 0o022.
33 old_umask = os.umask(022)33 old_umask = os.umask(0o022)
34 self.addCleanup(os.umask, old_umask)34 self.addCleanup(os.umask, old_umask)
35 self.anything_policy = getPolicy(35 self.anything_policy = getPolicy(
36 name="anything", distro="ubuntutest", distroseries=None)36 name="anything", distro="ubuntutest", distroseries=None)
3737
=== modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py'
--- lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py 2015-09-02 12:05:15 +0000
+++ lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2012 Canonical Ltd. This software is licensed under the1# Copyright 2012-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test upload and queue manipulation of dist-upgrader tarballs.4"""Test upload and queue manipulation of dist-upgrader tarballs.
@@ -32,8 +32,8 @@
32 def setUp(self):32 def setUp(self):
33 super(TestDistroSeriesQueueDistUpgrader, self).setUp()33 super(TestDistroSeriesQueueDistUpgrader, self).setUp()
34 import_public_test_keys()34 import_public_test_keys()
35 # CustomUpload.installFiles requires a umask of 022.35 # CustomUpload.installFiles requires a umask of 0o022.
36 old_umask = os.umask(022)36 old_umask = os.umask(0o022)
37 self.addCleanup(os.umask, old_umask)37 self.addCleanup(os.umask, old_umask)
38 self.anything_policy = getPolicy(38 self.anything_policy = getPolicy(
39 name="anything", distro="ubuntutest", distroseries=None)39 name="anything", distro="ubuntutest", distroseries=None)
4040
=== modified file 'lib/lp/soyuz/tests/test_livefs.py'
--- lib/lp/soyuz/tests/test_livefs.py 2015-09-15 20:16:47 +0000
+++ lib/lp/soyuz/tests/test_livefs.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2014-2015 Canonical Ltd. This software is licensed under the1# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test live filesystems."""4"""Test live filesystems."""
@@ -96,14 +96,14 @@
96 def test_initial_date_last_modified(self):96 def test_initial_date_last_modified(self):
97 # The initial value of date_last_modified is date_created.97 # The initial value of date_last_modified is date_created.
98 livefs = self.factory.makeLiveFS(98 livefs = self.factory.makeLiveFS(
99 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC))99 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC))
100 self.assertEqual(livefs.date_created, livefs.date_last_modified)100 self.assertEqual(livefs.date_created, livefs.date_last_modified)
101101
102 def test_modifiedevent_sets_date_last_modified(self):102 def test_modifiedevent_sets_date_last_modified(self):
103 # When a LiveFS receives an object modified event, the last modified103 # When a LiveFS receives an object modified event, the last modified
104 # date is set to UTC_NOW.104 # date is set to UTC_NOW.
105 livefs = self.factory.makeLiveFS(105 livefs = self.factory.makeLiveFS(
106 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC))106 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC))
107 notify(ObjectModifiedEvent(107 notify(ObjectModifiedEvent(
108 removeSecurityProxy(livefs), livefs, [ILiveFS["name"]]))108 removeSecurityProxy(livefs), livefs, [ILiveFS["name"]]))
109 self.assertSqlAttributeEqualsDate(109 self.assertSqlAttributeEqualsDate(
110110
=== modified file 'lib/lp/soyuz/tests/test_livefsbuild.py'
--- lib/lp/soyuz/tests/test_livefsbuild.py 2015-09-11 12:20:23 +0000
+++ lib/lp/soyuz/tests/test_livefsbuild.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2014-2015 Canonical Ltd. This software is licensed under the1# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test live filesystem build features."""4"""Test live filesystem build features."""
@@ -240,7 +240,7 @@
240 build = self.factory.makeLiveFSBuild(240 build = self.factory.makeLiveFSBuild(
241 name=u"livefs-1", requester=person, owner=person,241 name=u"livefs-1", requester=person, owner=person,
242 distroarchseries=distroarchseries,242 distroarchseries=distroarchseries,
243 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC),243 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC),
244 status=BuildStatus.FAILEDTOBUILD,244 status=BuildStatus.FAILEDTOBUILD,
245 builder=self.factory.makeBuilder(name="bob"),245 builder=self.factory.makeBuilder(name="bob"),
246 duration=timedelta(minutes=10))246 duration=timedelta(minutes=10))
@@ -338,7 +338,7 @@
338 db_build = self.factory.makeLiveFSBuild(338 db_build = self.factory.makeLiveFSBuild(
339 requester=self.person, unique_key=u"foo",339 requester=self.person, unique_key=u"foo",
340 metadata_override={"image_format": "plain"},340 metadata_override={"image_format": "plain"},
341 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC))341 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC))
342 build_url = api_url(db_build)342 build_url = api_url(db_build)
343 logout()343 logout()
344 build = self.webservice.get(build_url).jsonBody()344 build = self.webservice.get(build_url).jsonBody()
345345
=== modified file 'lib/lp/soyuz/tests/test_livefsbuildbehaviour.py'
--- lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2015-10-21 09:37:08 +0000
+++ lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2014 Canonical Ltd. This software is licensed under the1# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Test live filesystem build behaviour."""4"""Test live filesystem build behaviour."""
@@ -160,7 +160,7 @@
160 def test_extraBuildArgs(self):160 def test_extraBuildArgs(self):
161 # _extraBuildArgs returns a reasonable set of additional arguments.161 # _extraBuildArgs returns a reasonable set of additional arguments.
162 job = self.makeJob(162 job = self.makeJob(
163 date_created=datetime(2014, 04, 25, 10, 38, 0, tzinfo=pytz.UTC),163 date_created=datetime(2014, 4, 25, 10, 38, 0, tzinfo=pytz.UTC),
164 metadata={"project": "distro", "subproject": "special"})164 metadata={"project": "distro", "subproject": "special"})
165 expected_archives = get_sources_list_for_building(165 expected_archives = get_sources_list_for_building(
166 job.build, job.build.distro_arch_series, None)166 job.build, job.build.distro_arch_series, None)
167167
=== modified file 'lib/lp/testing/tests/test_factory.py'
--- lib/lp/testing/tests/test_factory.py 2013-06-20 05:50:00 +0000
+++ lib/lp/testing/tests/test_factory.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2010-2013 Canonical Ltd. This software is licensed under the1# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for the Launchpad object factory."""4"""Tests for the Launchpad object factory."""
@@ -326,7 +326,7 @@
326 self.assertEqual(110, bpr.installedsize)326 self.assertEqual(110, bpr.installedsize)
327327
328 def test_makeBinaryPackageName_uses_date_created(self):328 def test_makeBinaryPackageName_uses_date_created(self):
329 date_created = datetime(2000, 01, 01, tzinfo=pytz.UTC)329 date_created = datetime(2000, 1, 1, tzinfo=pytz.UTC)
330 bpr = self.factory.makeBinaryPackageRelease(330 bpr = self.factory.makeBinaryPackageRelease(
331 date_created=date_created)331 date_created=date_created)
332 self.assertEqual(date_created, bpr.datecreated)332 self.assertEqual(date_created, bpr.datecreated)
333333
=== modified file 'lib/lp/translations/browser/tests/test_translationmessage_view.py'
--- lib/lp/translations/browser/tests/test_translationmessage_view.py 2014-06-10 11:25:51 +0000
+++ lib/lp/translations/browser/tests/test_translationmessage_view.py 2016-02-05 16:55:09 +0000
@@ -1,4 +1,4 @@
1# Copyright 2009-2014 Canonical Ltd. This software is licensed under the1# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4from __future__ import with_statement4from __future__ import with_statement
@@ -329,7 +329,7 @@
329 view = self._makeView()329 view = self._makeView()
330 view.request.form['lock_timestamp'] = u'2010-01-01 00:00:00 UTC'330 view.request.form['lock_timestamp'] = u'2010-01-01 00:00:00 UTC'
331 self.assertEqual(331 self.assertEqual(
332 datetime(2010, 01, 01, tzinfo=pytz.utc),332 datetime(2010, 1, 1, tzinfo=pytz.utc),
333 view._extractLockTimestamp())333 view._extractLockTimestamp())
334334
335 def test_extractLockTimestamp_returns_None_by_default(self):335 def test_extractLockTimestamp_returns_None_by_default(self):
336336
=== modified file 'lib/lp/translations/doc/poexport-language-pack.txt'
--- lib/lp/translations/doc/poexport-language-pack.txt 2015-01-16 16:44:27 +0000
+++ lib/lp/translations/doc/poexport-language-pack.txt 2016-02-05 16:55:09 +0000
@@ -91,8 +91,8 @@
91Directory permissions allow correct use of those directories:91Directory permissions allow correct use of those directories:
9292
93 >>> directory = tarfile.getmember('rosetta-hoary')93 >>> directory = tarfile.getmember('rosetta-hoary')
94 >>> oct(directory.mode)94 >>> '0o%o' % directory.mode
95 '0755'95 '0o755'
9696
97And one of the included .po files look like what we expected.97And one of the included .po files look like what we expected.
9898