Merge lp:~cjwatson/launchpad/octal-constants into lp:launchpad
- octal-constants
- Merge into devel
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 |
Related bugs: |
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
1 | === modified file 'lib/lp/answers/tests/test_question_webservice.py' | |||
2 | --- lib/lp/answers/tests/test_question_webservice.py 2015-10-26 14:54:43 +0000 | |||
3 | +++ lib/lp/answers/tests/test_question_webservice.py 2016-02-05 16:55:09 +0000 | |||
4 | @@ -1,4 +1,4 @@ | |||
6 | 1 | # Copyright 2011-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2016 Canonical Ltd. This software is licensed under the |
7 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
8 | 3 | 3 | ||
9 | 4 | """Webservice unit tests related to Launchpad Questions.""" | 4 | """Webservice unit tests related to Launchpad Questions.""" |
10 | @@ -264,7 +264,7 @@ | |||
11 | 264 | 264 | ||
12 | 265 | def test_searchQuestions(self): | 265 | def test_searchQuestions(self): |
13 | 266 | date_gen = time_counter( | 266 | date_gen = time_counter( |
15 | 267 | datetime(2015, 01, 01, tzinfo=pytz.UTC), timedelta(days=1)) | 267 | datetime(2015, 1, 1, tzinfo=pytz.UTC), timedelta(days=1)) |
16 | 268 | created = [ | 268 | created = [ |
17 | 269 | self.factory.makeQuestion(title="foo", datecreated=next(date_gen)) | 269 | self.factory.makeQuestion(title="foo", datecreated=next(date_gen)) |
18 | 270 | for i in range(10)] | 270 | for i in range(10)] |
19 | 271 | 271 | ||
20 | === modified file 'lib/lp/app/browser/tests/test_vocabulary.py' | |||
21 | --- lib/lp/app/browser/tests/test_vocabulary.py 2015-07-08 16:05:11 +0000 | |||
22 | +++ lib/lp/app/browser/tests/test_vocabulary.py 2016-02-05 16:55:09 +0000 | |||
23 | @@ -1,4 +1,4 @@ | |||
25 | 1 | # Copyright 2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2016 Canonical Ltd. This software is licensed under the |
26 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
27 | 3 | 3 | ||
28 | 4 | """Test vocabulary adapters.""" | 4 | """Test vocabulary adapters.""" |
29 | @@ -138,8 +138,7 @@ | |||
30 | 138 | def test_PersonPickerEntrySourceAdapter_user(self): | 138 | def test_PersonPickerEntrySourceAdapter_user(self): |
31 | 139 | # The person picker provides more information for users. | 139 | # The person picker provides more information for users. |
32 | 140 | person = self.factory.makePerson(email='snarf@eg.dom', name='snarf') | 140 | person = self.factory.makePerson(email='snarf@eg.dom', name='snarf') |
35 | 141 | creation_date = datetime( | 141 | creation_date = datetime(2005, 1, 30, 0, 0, 0, 0, pytz.timezone('UTC')) |
34 | 142 | 2005, 01, 30, 0, 0, 0, 0, pytz.timezone('UTC')) | ||
36 | 143 | removeSecurityProxy(person).datecreated = creation_date | 142 | removeSecurityProxy(person).datecreated = creation_date |
37 | 144 | getUtility(IIrcIDSet).new(person, 'eg.dom', 'snarf') | 143 | getUtility(IIrcIDSet).new(person, 'eg.dom', 'snarf') |
38 | 145 | getUtility(IIrcIDSet).new(person, 'ex.dom', 'pting') | 144 | getUtility(IIrcIDSet).new(person, 'ex.dom', 'pting') |
39 | @@ -535,8 +534,7 @@ | |||
40 | 535 | name='xpting-team', | 534 | name='xpting-team', |
41 | 536 | membership_policy=TeamMembershipPolicy.RESTRICTED) | 535 | membership_policy=TeamMembershipPolicy.RESTRICTED) |
42 | 537 | person = self.factory.makePerson(name='xpting-person') | 536 | person = self.factory.makePerson(name='xpting-person') |
45 | 538 | creation_date = datetime( | 537 | creation_date = datetime(2005, 1, 30, 0, 0, 0, 0, pytz.timezone('UTC')) |
44 | 539 | 2005, 01, 30, 0, 0, 0, 0, pytz.timezone('UTC')) | ||
46 | 540 | removeSecurityProxy(person).datecreated = creation_date | 538 | removeSecurityProxy(person).datecreated = creation_date |
47 | 541 | TestPersonVocabulary.test_persons.extend([team, person]) | 539 | TestPersonVocabulary.test_persons.extend([team, person]) |
48 | 542 | product = self.factory.makeProduct(owner=team) | 540 | product = self.factory.makeProduct(owner=team) |
49 | 543 | 541 | ||
50 | === modified file 'lib/lp/archivepublisher/config.py' | |||
51 | --- lib/lp/archivepublisher/config.py 2016-01-13 17:09:34 +0000 | |||
52 | +++ lib/lp/archivepublisher/config.py 2016-02-05 16:55:09 +0000 | |||
53 | @@ -141,4 +141,4 @@ | |||
54 | 141 | if directory is None: | 141 | if directory is None: |
55 | 142 | continue | 142 | continue |
56 | 143 | if not os.path.exists(directory): | 143 | if not os.path.exists(directory): |
58 | 144 | os.makedirs(directory, 0755) | 144 | os.makedirs(directory, 0o755) |
59 | 145 | 145 | ||
60 | === modified file 'lib/lp/archivepublisher/customupload.py' | |||
61 | --- lib/lp/archivepublisher/customupload.py 2013-07-25 17:05:20 +0000 | |||
62 | +++ lib/lp/archivepublisher/customupload.py 2016-02-05 16:55:09 +0000 | |||
63 | @@ -1,4 +1,4 @@ | |||
65 | 1 | # Copyright 2009-2013 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
66 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
67 | 3 | 3 | ||
68 | 4 | """Infrastructure for handling custom uploads. | 4 | """Infrastructure for handling custom uploads. |
69 | @@ -247,7 +247,7 @@ | |||
70 | 247 | """Ensure the parent directory exists.""" | 247 | """Ensure the parent directory exists.""" |
71 | 248 | parentdir = os.path.dirname(path) | 248 | parentdir = os.path.dirname(path) |
72 | 249 | if not os.path.isdir(parentdir): | 249 | if not os.path.isdir(parentdir): |
74 | 250 | os.makedirs(parentdir, 0755) | 250 | os.makedirs(parentdir, 0o755) |
75 | 251 | 251 | ||
76 | 252 | def installFiles(self): | 252 | def installFiles(self): |
77 | 253 | """Install the files from the custom upload to the archive.""" | 253 | """Install the files from the custom upload to the archive.""" |
78 | @@ -267,8 +267,8 @@ | |||
79 | 267 | # Also, ensure that the process has the expected umask. | 267 | # Also, ensure that the process has the expected umask. |
80 | 268 | old_mask = os.umask(0) | 268 | old_mask = os.umask(0) |
81 | 269 | try: | 269 | try: |
84 | 270 | if old_mask != 022: | 270 | if old_mask != 0o022: |
85 | 271 | raise CustomUploadBadUmask(022, old_mask) | 271 | raise CustomUploadBadUmask(0o022, old_mask) |
86 | 272 | finally: | 272 | finally: |
87 | 273 | os.umask(old_mask) | 273 | os.umask(old_mask) |
88 | 274 | if os.path.islink(sourcepath): | 274 | if os.path.islink(sourcepath): |
89 | @@ -296,7 +296,7 @@ | |||
90 | 296 | os.symlink(os.readlink(sourcepath), destpath) | 296 | os.symlink(os.readlink(sourcepath), destpath) |
91 | 297 | else: | 297 | else: |
92 | 298 | shutil.copy(sourcepath, destpath) | 298 | shutil.copy(sourcepath, destpath) |
94 | 299 | os.chmod(destpath, 0644) | 299 | os.chmod(destpath, 0o644) |
95 | 300 | 300 | ||
96 | 301 | extracted = True | 301 | extracted = True |
97 | 302 | 302 | ||
98 | 303 | 303 | ||
99 | === modified file 'lib/lp/archivepublisher/diskpool.py' | |||
100 | --- lib/lp/archivepublisher/diskpool.py 2015-10-21 09:37:08 +0000 | |||
101 | +++ lib/lp/archivepublisher/diskpool.py 2016-02-05 16:55:09 +0000 | |||
102 | @@ -1,4 +1,4 @@ | |||
104 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
105 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
106 | 3 | 3 | ||
107 | 4 | __all__ = ['DiskPoolEntry', 'DiskPool', 'poolify', 'unpoolify'] | 4 | __all__ = ['DiskPoolEntry', 'DiskPool', 'poolify', 'unpoolify'] |
108 | @@ -105,7 +105,7 @@ | |||
109 | 105 | def close(self): | 105 | def close(self): |
110 | 106 | """Make the atomic move into place having closed the temp file.""" | 106 | """Make the atomic move into place having closed the temp file.""" |
111 | 107 | self.fd.close() | 107 | self.fd.close() |
113 | 108 | os.chmod(self.tempname, 0644) | 108 | os.chmod(self.tempname, 0o644) |
114 | 109 | # Note that this will fail if the target and the temp dirs are on | 109 | # Note that this will fail if the target and the temp dirs are on |
115 | 110 | # different filesystems. | 110 | # different filesystems. |
116 | 111 | os.rename(self.tempname, self.targetfilename) | 111 | os.rename(self.tempname, self.targetfilename) |
117 | 112 | 112 | ||
118 | === modified file 'lib/lp/archivepublisher/model/ftparchive.py' | |||
119 | --- lib/lp/archivepublisher/model/ftparchive.py 2016-02-04 19:46:52 +0000 | |||
120 | +++ lib/lp/archivepublisher/model/ftparchive.py 2016-02-05 16:55:09 +0000 | |||
121 | @@ -52,7 +52,7 @@ | |||
122 | 52 | def safe_mkdir(path): | 52 | def safe_mkdir(path): |
123 | 53 | """Ensures the path exists, creating it if it doesn't.""" | 53 | """Ensures the path exists, creating it if it doesn't.""" |
124 | 54 | if not os.path.exists(path): | 54 | if not os.path.exists(path): |
126 | 55 | os.makedirs(path, 0755) | 55 | os.makedirs(path, 0o755) |
127 | 56 | 56 | ||
128 | 57 | 57 | ||
129 | 58 | DEFAULT_COMPONENT = "main" | 58 | DEFAULT_COMPONENT = "main" |
130 | 59 | 59 | ||
131 | === modified file 'lib/lp/archivepublisher/scripts/generate_contents_files.py' | |||
132 | --- lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-01-13 17:09:34 +0000 | |||
133 | +++ lib/lp/archivepublisher/scripts/generate_contents_files.py 2016-02-05 16:55:09 +0000 | |||
134 | @@ -275,7 +275,7 @@ | |||
135 | 275 | ensure_directory_exists(os.path.dirname(contents_dest)) | 275 | ensure_directory_exists(os.path.dirname(contents_dest)) |
136 | 276 | os.rename(current_contents, last_contents) | 276 | os.rename(current_contents, last_contents) |
137 | 277 | os.rename(new_contents, contents_dest) | 277 | os.rename(new_contents, contents_dest) |
139 | 278 | os.chmod(contents_dest, 0664) | 278 | os.chmod(contents_dest, 0o664) |
140 | 279 | else: | 279 | else: |
141 | 280 | self.logger.debug( | 280 | self.logger.debug( |
142 | 281 | "Skipping unmodified Contents file for %s/%s.", suite, arch) | 281 | "Skipping unmodified Contents file for %s/%s.", suite, arch) |
143 | 282 | 282 | ||
144 | === modified file 'lib/lp/archivepublisher/tests/test_ddtp_tarball.py' | |||
145 | --- lib/lp/archivepublisher/tests/test_ddtp_tarball.py 2012-07-03 17:32:59 +0000 | |||
146 | +++ lib/lp/archivepublisher/tests/test_ddtp_tarball.py 2016-02-05 16:55:09 +0000 | |||
147 | @@ -1,4 +1,4 @@ | |||
149 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
150 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
151 | 3 | 3 | ||
152 | 4 | """Test ddtp-tarball custom uploads. | 4 | """Test ddtp-tarball custom uploads. |
153 | @@ -30,8 +30,8 @@ | |||
154 | 30 | self.temp_dir = self.makeTemporaryDirectory() | 30 | self.temp_dir = self.makeTemporaryDirectory() |
155 | 31 | self.pubconf = FakeConfig(self.temp_dir) | 31 | self.pubconf = FakeConfig(self.temp_dir) |
156 | 32 | self.suite = "distroseries" | 32 | self.suite = "distroseries" |
159 | 33 | # CustomUpload.installFiles requires a umask of 022. | 33 | # CustomUpload.installFiles requires a umask of 0o022. |
160 | 34 | old_umask = os.umask(022) | 34 | old_umask = os.umask(0o022) |
161 | 35 | self.addCleanup(os.umask, old_umask) | 35 | self.addCleanup(os.umask, old_umask) |
162 | 36 | 36 | ||
163 | 37 | def openArchive(self, version): | 37 | def openArchive(self, version): |
164 | 38 | 38 | ||
165 | === modified file 'lib/lp/archivepublisher/tests/test_debian_installer.py' | |||
166 | --- lib/lp/archivepublisher/tests/test_debian_installer.py 2012-06-28 16:32:27 +0000 | |||
167 | +++ lib/lp/archivepublisher/tests/test_debian_installer.py 2016-02-05 16:55:09 +0000 | |||
168 | @@ -1,4 +1,4 @@ | |||
170 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
171 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
172 | 3 | 3 | ||
173 | 4 | """Test debian-installer custom uploads. | 4 | """Test debian-installer custom uploads. |
174 | @@ -34,8 +34,8 @@ | |||
175 | 34 | self.temp_dir = self.makeTemporaryDirectory() | 34 | self.temp_dir = self.makeTemporaryDirectory() |
176 | 35 | self.pubconf = FakeConfig(self.temp_dir) | 35 | self.pubconf = FakeConfig(self.temp_dir) |
177 | 36 | self.suite = "distroseries" | 36 | self.suite = "distroseries" |
180 | 37 | # CustomUpload.installFiles requires a umask of 022. | 37 | # CustomUpload.installFiles requires a umask of 0o022. |
181 | 38 | old_umask = os.umask(022) | 38 | old_umask = os.umask(0o022) |
182 | 39 | self.addCleanup(os.umask, old_umask) | 39 | self.addCleanup(os.umask, old_umask) |
183 | 40 | 40 | ||
184 | 41 | def openArchive(self): | 41 | def openArchive(self): |
185 | @@ -82,10 +82,10 @@ | |||
186 | 82 | self.assertRaises(CustomUploadAlreadyExists, self.process) | 82 | self.assertRaises(CustomUploadAlreadyExists, self.process) |
187 | 83 | 83 | ||
188 | 84 | def test_bad_umask(self): | 84 | def test_bad_umask(self): |
190 | 85 | # The umask must be 022 to avoid incorrect permissions. | 85 | # The umask must be 0o022 to avoid incorrect permissions. |
191 | 86 | self.openArchive() | 86 | self.openArchive() |
192 | 87 | self.addFile("dir/file", "foo") | 87 | self.addFile("dir/file", "foo") |
194 | 88 | os.umask(002) # cleanup already handled by setUp | 88 | os.umask(0o002) # cleanup already handled by setUp |
195 | 89 | self.assertRaises(CustomUploadBadUmask, self.process) | 89 | self.assertRaises(CustomUploadBadUmask, self.process) |
196 | 90 | 90 | ||
197 | 91 | def test_current_symlink(self): | 91 | def test_current_symlink(self): |
198 | @@ -133,18 +133,18 @@ | |||
199 | 133 | self.getInstallerPath(link_to_dir_path)))) | 133 | self.getInstallerPath(link_to_dir_path)))) |
200 | 134 | 134 | ||
201 | 135 | def test_top_level_permissions(self): | 135 | def test_top_level_permissions(self): |
203 | 136 | # Top-level directories are set to mode 0755 (see bug 107068). | 136 | # Top-level directories are set to mode 0o755 (see bug 107068). |
204 | 137 | self.openArchive() | 137 | self.openArchive() |
205 | 138 | self.addFile("hello", "world") | 138 | self.addFile("hello", "world") |
206 | 139 | self.process() | 139 | self.process() |
207 | 140 | installer_path = self.getInstallerPath() | 140 | installer_path = self.getInstallerPath() |
209 | 141 | self.assertEqual(0755, os.stat(installer_path).st_mode & 0777) | 141 | self.assertEqual(0o755, os.stat(installer_path).st_mode & 0o777) |
210 | 142 | self.assertEqual( | 142 | self.assertEqual( |
213 | 143 | 0755, | 143 | 0o755, |
214 | 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) |
215 | 145 | 145 | ||
216 | 146 | def test_extracted_permissions(self): | 146 | def test_extracted_permissions(self): |
218 | 147 | # Extracted files and directories are set to 0644/0755. | 147 | # Extracted files and directories are set to 0o644/0o755. |
219 | 148 | self.openArchive() | 148 | self.openArchive() |
220 | 149 | directory = ("images/netboot/ubuntu-installer/i386/" | 149 | directory = ("images/netboot/ubuntu-installer/i386/" |
221 | 150 | "pxelinux.cfg.serial-9600") | 150 | "pxelinux.cfg.serial-9600") |
222 | @@ -152,9 +152,9 @@ | |||
223 | 152 | self.addFile(filename, "hey") | 152 | self.addFile(filename, "hey") |
224 | 153 | self.process() | 153 | self.process() |
225 | 154 | self.assertEqual( | 154 | self.assertEqual( |
227 | 155 | 0644, os.stat(self.getInstallerPath(filename)).st_mode & 0777) | 155 | 0o644, os.stat(self.getInstallerPath(filename)).st_mode & 0o777) |
228 | 156 | self.assertEqual( | 156 | self.assertEqual( |
230 | 157 | 0755, os.stat(self.getInstallerPath(directory)).st_mode & 0777) | 157 | 0o755, os.stat(self.getInstallerPath(directory)).st_mode & 0o777) |
231 | 158 | 158 | ||
232 | 159 | def test_getSeriesKey_extracts_architecture(self): | 159 | def test_getSeriesKey_extracts_architecture(self): |
233 | 160 | # getSeriesKey extracts the architecture from an upload's filename. | 160 | # getSeriesKey extracts the architecture from an upload's filename. |
234 | 161 | 161 | ||
235 | === modified file 'lib/lp/archivepublisher/tests/test_dist_upgrader.py' | |||
236 | --- lib/lp/archivepublisher/tests/test_dist_upgrader.py 2012-06-28 16:32:27 +0000 | |||
237 | +++ lib/lp/archivepublisher/tests/test_dist_upgrader.py 2016-02-05 16:55:09 +0000 | |||
238 | @@ -1,4 +1,4 @@ | |||
240 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
241 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
242 | 3 | 3 | ||
243 | 4 | """Test dist-upgrader custom uploads. | 4 | """Test dist-upgrader custom uploads. |
244 | @@ -35,8 +35,8 @@ | |||
245 | 35 | self.temp_dir = self.makeTemporaryDirectory() | 35 | self.temp_dir = self.makeTemporaryDirectory() |
246 | 36 | self.pubconf = FakeConfig(self.temp_dir) | 36 | self.pubconf = FakeConfig(self.temp_dir) |
247 | 37 | self.suite = "distroseries" | 37 | self.suite = "distroseries" |
250 | 38 | # CustomUpload.installFiles requires a umask of 022. | 38 | # CustomUpload.installFiles requires a umask of 0o022. |
251 | 39 | old_umask = os.umask(022) | 39 | old_umask = os.umask(0o022) |
252 | 40 | self.addCleanup(os.umask, old_umask) | 40 | self.addCleanup(os.umask, old_umask) |
253 | 41 | 41 | ||
254 | 42 | def openArchive(self, version): | 42 | def openArchive(self, version): |
255 | @@ -68,10 +68,10 @@ | |||
256 | 68 | self.assertRaises(CustomUploadAlreadyExists, self.process) | 68 | self.assertRaises(CustomUploadAlreadyExists, self.process) |
257 | 69 | 69 | ||
258 | 70 | def test_bad_umask(self): | 70 | def test_bad_umask(self): |
260 | 71 | # The umask must be 022 to avoid incorrect permissions. | 71 | # The umask must be 0o022 to avoid incorrect permissions. |
261 | 72 | self.openArchive("20060302.0120") | 72 | self.openArchive("20060302.0120") |
262 | 73 | self.archive.add_file("20060302.0120/file", "foo") | 73 | self.archive.add_file("20060302.0120/file", "foo") |
264 | 74 | os.umask(002) # cleanup already handled by setUp | 74 | os.umask(0o002) # cleanup already handled by setUp |
265 | 75 | self.assertRaises(CustomUploadBadUmask, self.process) | 75 | self.assertRaises(CustomUploadBadUmask, self.process) |
266 | 76 | 76 | ||
267 | 77 | def test_current_symlink(self): | 77 | def test_current_symlink(self): |
268 | 78 | 78 | ||
269 | === modified file 'lib/lp/archivepublisher/tests/test_publish_ftpmaster.py' | |||
270 | --- lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2016-02-04 19:46:52 +0000 | |||
271 | +++ lib/lp/archivepublisher/tests/test_publish_ftpmaster.py 2016-02-05 16:55:09 +0000 | |||
272 | @@ -320,7 +320,7 @@ | |||
273 | 320 | script_file = file(script_path, "w") | 320 | script_file = file(script_path, "w") |
274 | 321 | script_file.write(script_code) | 321 | script_file.write(script_code) |
275 | 322 | script_file.close() | 322 | script_file.close() |
277 | 323 | os.chmod(script_path, 0755) | 323 | os.chmod(script_path, 0o755) |
278 | 324 | 324 | ||
279 | 325 | def test_script_runs_successfully(self): | 325 | def test_script_runs_successfully(self): |
280 | 326 | self.prepareUbuntu() | 326 | self.prepareUbuntu() |
281 | 327 | 327 | ||
282 | === modified file 'lib/lp/archivepublisher/tests/test_uefi.py' | |||
283 | --- lib/lp/archivepublisher/tests/test_uefi.py 2012-11-09 12:50:09 +0000 | |||
284 | +++ lib/lp/archivepublisher/tests/test_uefi.py 2016-02-05 16:55:09 +0000 | |||
285 | @@ -1,4 +1,4 @@ | |||
287 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
288 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
289 | 3 | 3 | ||
290 | 4 | """Test UEFI custom uploads.""" | 4 | """Test UEFI custom uploads.""" |
291 | @@ -33,8 +33,8 @@ | |||
292 | 33 | self.uefi_dir = self.makeTemporaryDirectory() | 33 | self.uefi_dir = self.makeTemporaryDirectory() |
293 | 34 | self.pubconf = FakeConfig(self.temp_dir, self.uefi_dir) | 34 | self.pubconf = FakeConfig(self.temp_dir, self.uefi_dir) |
294 | 35 | self.suite = "distroseries" | 35 | self.suite = "distroseries" |
297 | 36 | # CustomUpload.installFiles requires a umask of 022. | 36 | # CustomUpload.installFiles requires a umask of 0o022. |
298 | 37 | old_umask = os.umask(022) | 37 | old_umask = os.umask(0o022) |
299 | 38 | self.addCleanup(os.umask, old_umask) | 38 | self.addCleanup(os.umask, old_umask) |
300 | 39 | 39 | ||
301 | 40 | def setUpKeyAndCert(self): | 40 | def setUpKeyAndCert(self): |
302 | @@ -97,11 +97,11 @@ | |||
303 | 97 | self.assertRaises(CustomUploadAlreadyExists, self.process) | 97 | self.assertRaises(CustomUploadAlreadyExists, self.process) |
304 | 98 | 98 | ||
305 | 99 | def test_bad_umask(self): | 99 | def test_bad_umask(self): |
307 | 100 | # The umask must be 022 to avoid incorrect permissions. | 100 | # The umask must be 0o022 to avoid incorrect permissions. |
308 | 101 | self.setUpKeyAndCert() | 101 | self.setUpKeyAndCert() |
309 | 102 | self.openArchive("test", "1.0", "amd64") | 102 | self.openArchive("test", "1.0", "amd64") |
310 | 103 | self.archive.add_file("1.0/dir/file.efi", "foo") | 103 | self.archive.add_file("1.0/dir/file.efi", "foo") |
312 | 104 | os.umask(002) # cleanup already handled by setUp | 104 | os.umask(0o002) # cleanup already handled by setUp |
313 | 105 | self.assertRaises(CustomUploadBadUmask, self.process) | 105 | self.assertRaises(CustomUploadBadUmask, self.process) |
314 | 106 | 106 | ||
315 | 107 | def test_correct_signing_command(self): | 107 | def test_correct_signing_command(self): |
316 | 108 | 108 | ||
317 | === modified file 'lib/lp/archiveuploader/tests/test_dscfile.py' | |||
318 | --- lib/lp/archiveuploader/tests/test_dscfile.py 2015-07-29 01:59:43 +0000 | |||
319 | +++ lib/lp/archiveuploader/tests/test_dscfile.py 2016-02-05 16:55:09 +0000 | |||
320 | @@ -1,4 +1,4 @@ | |||
322 | 1 | # Copyright 2010-2014 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the |
323 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
324 | 3 | 3 | ||
325 | 4 | """Test dscfile.py""" | 4 | """Test dscfile.py""" |
326 | @@ -219,12 +219,12 @@ | |||
327 | 219 | def test_ReadOnlyCWD(self): | 219 | def test_ReadOnlyCWD(self): |
328 | 220 | """Processing a file should work when cwd is read-only.""" | 220 | """Processing a file should work when cwd is read-only.""" |
329 | 221 | tempdir = self.useTempDir() | 221 | tempdir = self.useTempDir() |
331 | 222 | os.chmod(tempdir, 0555) | 222 | os.chmod(tempdir, 0o555) |
332 | 223 | try: | 223 | try: |
333 | 224 | dsc_file = self.getDscFile('bar_1.0-1') | 224 | dsc_file = self.getDscFile('bar_1.0-1') |
334 | 225 | list(dsc_file.verify()) | 225 | list(dsc_file.verify()) |
335 | 226 | finally: | 226 | finally: |
337 | 227 | os.chmod(tempdir, 0755) | 227 | os.chmod(tempdir, 0o755) |
338 | 228 | 228 | ||
339 | 229 | 229 | ||
340 | 230 | class BaseTestSourceFileVerification(TestCase): | 230 | class BaseTestSourceFileVerification(TestCase): |
341 | @@ -400,7 +400,7 @@ | |||
342 | 400 | os.mkdir(unpacked_dir) | 400 | os.mkdir(unpacked_dir) |
343 | 401 | bar_path = os.path.join(unpacked_dir, "bar_1.0") | 401 | bar_path = os.path.join(unpacked_dir, "bar_1.0") |
344 | 402 | os.mkdir(bar_path) | 402 | os.mkdir(bar_path) |
347 | 403 | os.chmod(bar_path, 0600) | 403 | os.chmod(bar_path, 0o600) |
348 | 404 | os.chmod(unpacked_dir, 0600) | 404 | os.chmod(unpacked_dir, 0o600) |
349 | 405 | cleanup_unpacked_dir(unpacked_dir) | 405 | cleanup_unpacked_dir(unpacked_dir) |
350 | 406 | self.assertFalse(os.path.exists(unpacked_dir)) | 406 | self.assertFalse(os.path.exists(unpacked_dir)) |
351 | 407 | 407 | ||
352 | === modified file 'lib/lp/bugs/doc/checkwatches-batching.txt' | |||
353 | --- lib/lp/bugs/doc/checkwatches-batching.txt 2010-10-18 22:24:59 +0000 | |||
354 | +++ lib/lp/bugs/doc/checkwatches-batching.txt 2016-02-05 16:55:09 +0000 | |||
355 | @@ -80,7 +80,7 @@ | |||
356 | 80 | ... return remote_bug_ids[::2] | 80 | ... return remote_bug_ids[::2] |
357 | 81 | 81 | ||
358 | 82 | >>> remote = QueryableRemoteSystem() | 82 | >>> remote = QueryableRemoteSystem() |
360 | 83 | >>> now = datetime(2010, 01, 13, 16, 52, tzinfo=UTC) | 83 | >>> now = datetime(2010, 1, 13, 16, 52, tzinfo=UTC) |
361 | 84 | 84 | ||
362 | 85 | When there are no bug watches to check, the result is empty, and the | 85 | When there are no bug watches to check, the result is empty, and the |
363 | 86 | remote system is not queried. | 86 | remote system is not queried. |
364 | 87 | 87 | ||
365 | === modified file 'lib/lp/bugs/doc/externalbugtracker.txt' | |||
366 | --- lib/lp/bugs/doc/externalbugtracker.txt 2015-07-08 16:05:11 +0000 | |||
367 | +++ lib/lp/bugs/doc/externalbugtracker.txt 2016-02-05 16:55:09 +0000 | |||
368 | @@ -518,7 +518,7 @@ | |||
369 | 518 | will then be passed on to initializeRemoteBugDB(). | 518 | will then be passed on to initializeRemoteBugDB(). |
370 | 519 | 519 | ||
371 | 520 | >>> some_time_ago = datetime( | 520 | >>> some_time_ago = datetime( |
373 | 521 | ... 2007, 03, 17, 16, 00, tzinfo=pytz.timezone('UTC')) | 521 | ... 2007, 3, 17, 16, 0, tzinfo=pytz.timezone('UTC')) |
374 | 522 | >>> for bug_watch in bug_watches: | 522 | >>> for bug_watch in bug_watches: |
375 | 523 | ... bug_watch.lastchecked = some_time_ago | 523 | ... bug_watch.lastchecked = some_time_ago |
376 | 524 | >>> transaction.commit() | 524 | >>> transaction.commit() |
377 | 525 | 525 | ||
378 | === modified file 'lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt' | |||
379 | --- lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2013-05-09 08:53:01 +0000 | |||
380 | +++ lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.txt 2016-02-05 16:55:09 +0000 | |||
381 | @@ -71,7 +71,7 @@ | |||
382 | 71 | >>> login('foo.bar@canonical.com') | 71 | >>> login('foo.bar@canonical.com') |
383 | 72 | >>> watch = getUtility(IBugWatchSet).get(2) | 72 | >>> watch = getUtility(IBugWatchSet).get(2) |
384 | 73 | >>> removeSecurityProxy(watch).next_check = datetime( | 73 | >>> removeSecurityProxy(watch).next_check = datetime( |
386 | 74 | ... 2010, 4, 8, 16, 07, tzinfo=utc) | 74 | ... 2010, 4, 8, 16, 7, tzinfo=utc) |
387 | 75 | >>> logout() | 75 | >>> logout() |
388 | 76 | 76 | ||
389 | 77 | >>> admin_browser.open('http://bugs.launchpad.dev/bugs/1/+watch/2') | 77 | >>> admin_browser.open('http://bugs.launchpad.dev/bugs/1/+watch/2') |
390 | 78 | 78 | ||
391 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py' | |||
392 | --- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-01-20 12:21:21 +0000 | |||
393 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2016-02-05 16:55:09 +0000 | |||
394 | @@ -1200,10 +1200,10 @@ | |||
395 | 1200 | recipe=recipe, distroseries=self.squirrel, archive=archive) | 1200 | recipe=recipe, distroseries=self.squirrel, archive=archive) |
396 | 1201 | build.updateStatus( | 1201 | build.updateStatus( |
397 | 1202 | BuildStatus.BUILDING, | 1202 | BuildStatus.BUILDING, |
399 | 1203 | date_started=datetime(2010, 03, 16, tzinfo=UTC)) | 1203 | date_started=datetime(2010, 3, 16, tzinfo=UTC)) |
400 | 1204 | build.updateStatus( | 1204 | build.updateStatus( |
401 | 1205 | BuildStatus.FULLYBUILT, | 1205 | BuildStatus.FULLYBUILT, |
403 | 1206 | date_finished=datetime(2010, 03, 16, tzinfo=UTC)) | 1206 | date_finished=datetime(2010, 3, 16, tzinfo=UTC)) |
404 | 1207 | return build | 1207 | return build |
405 | 1208 | 1208 | ||
406 | 1209 | def test_index(self): | 1209 | def test_index(self): |
407 | @@ -1290,10 +1290,10 @@ | |||
408 | 1290 | binary_build.queueBuild() | 1290 | binary_build.queueBuild() |
409 | 1291 | binary_build.updateStatus( | 1291 | binary_build.updateStatus( |
410 | 1292 | BuildStatus.BUILDING, | 1292 | BuildStatus.BUILDING, |
412 | 1293 | date_started=datetime(2010, 04, 16, tzinfo=UTC)) | 1293 | date_started=datetime(2010, 4, 16, tzinfo=UTC)) |
413 | 1294 | binary_build.updateStatus( | 1294 | binary_build.updateStatus( |
414 | 1295 | BuildStatus.FULLYBUILT, | 1295 | BuildStatus.FULLYBUILT, |
416 | 1296 | date_finished=datetime(2010, 04, 16, tzinfo=UTC)) | 1296 | date_finished=datetime(2010, 4, 16, tzinfo=UTC)) |
417 | 1297 | binary_build.setLog(self.factory.makeLibraryFileAlias()) | 1297 | binary_build.setLog(self.factory.makeLibraryFileAlias()) |
418 | 1298 | 1298 | ||
419 | 1299 | self.assertTextMatchesExpressionIgnoreWhitespace("""\ | 1299 | self.assertTextMatchesExpressionIgnoreWhitespace("""\ |
420 | @@ -1360,7 +1360,7 @@ | |||
421 | 1360 | # We create builds in time ascending order (oldest first) since we | 1360 | # We create builds in time ascending order (oldest first) since we |
422 | 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. |
423 | 1362 | date_gen = time_counter( | 1362 | date_gen = time_counter( |
425 | 1363 | datetime(2010, 03, 16, tzinfo=UTC), timedelta(days=1)) | 1363 | datetime(2010, 3, 16, tzinfo=UTC), timedelta(days=1)) |
426 | 1364 | build1 = self.makeBuildJob(recipe, date_gen.next()) | 1364 | build1 = self.makeBuildJob(recipe, date_gen.next()) |
427 | 1365 | build2 = self.makeBuildJob(recipe, date_gen.next()) | 1365 | build2 = self.makeBuildJob(recipe, date_gen.next()) |
428 | 1366 | build3 = self.makeBuildJob(recipe, date_gen.next()) | 1366 | build3 = self.makeBuildJob(recipe, date_gen.next()) |
429 | 1367 | 1367 | ||
430 | === modified file 'lib/lp/code/feed/tests/test_revision.py' | |||
431 | --- lib/lp/code/feed/tests/test_revision.py 2012-01-01 02:58:52 +0000 | |||
432 | +++ lib/lp/code/feed/tests/test_revision.py 2016-02-05 16:55:09 +0000 | |||
433 | @@ -1,4 +1,4 @@ | |||
435 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
436 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
437 | 3 | 3 | ||
438 | 4 | """Tests for the revision feeds.""" | 4 | """Tests for the revision feeds.""" |
439 | @@ -32,7 +32,7 @@ | |||
440 | 32 | def test_format(self): | 32 | def test_format(self): |
441 | 33 | # The id contains the iso format of the date part of the revision | 33 | # The id contains the iso format of the date part of the revision |
442 | 34 | # date, and the revision id. | 34 | # date, and the revision id. |
444 | 35 | revision_date = datetime(2009, 07, 21, 12, tzinfo=UTC) | 35 | revision_date = datetime(2009, 7, 21, 12, tzinfo=UTC) |
445 | 36 | revision = self.factory.makeRevision( | 36 | revision = self.factory.makeRevision( |
446 | 37 | revision_date=revision_date, rev_id="test_revision_id") | 37 | revision_date=revision_date, rev_id="test_revision_id") |
447 | 38 | feed_id = revision_feed_id(revision) | 38 | feed_id = revision_feed_id(revision) |
448 | 39 | 39 | ||
449 | === modified file 'lib/lp/code/model/tests/test_gitjob.py' | |||
450 | --- lib/lp/code/model/tests/test_gitjob.py 2015-10-28 17:32:49 +0000 | |||
451 | +++ lib/lp/code/model/tests/test_gitjob.py 2016-02-05 16:55:09 +0000 | |||
452 | @@ -1,4 +1,4 @@ | |||
454 | 1 | # Copyright 2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the |
455 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
456 | 3 | 3 | ||
457 | 4 | """Tests for `GitJob`s.""" | 4 | """Tests for `GitJob`s.""" |
458 | @@ -162,7 +162,7 @@ | |||
459 | 162 | job = GitRefScanJob.create(repository) | 162 | job = GitRefScanJob.create(repository) |
460 | 163 | paths = (u"refs/heads/master", u"refs/tags/1.0") | 163 | paths = (u"refs/heads/master", u"refs/tags/1.0") |
461 | 164 | author = repository.owner | 164 | author = repository.owner |
463 | 165 | author_date_start = datetime(2015, 01, 01, tzinfo=pytz.UTC) | 165 | author_date_start = datetime(2015, 1, 1, tzinfo=pytz.UTC) |
464 | 166 | author_date_gen = time_counter(author_date_start, timedelta(days=1)) | 166 | author_date_gen = time_counter(author_date_start, timedelta(days=1)) |
465 | 167 | hosting_client = FakeGitHostingClient( | 167 | hosting_client = FakeGitHostingClient( |
466 | 168 | self.makeFakeRefs(paths), | 168 | self.makeFakeRefs(paths), |
467 | 169 | 169 | ||
468 | === modified file 'lib/lp/code/model/tests/test_gitrepository.py' | |||
469 | --- lib/lp/code/model/tests/test_gitrepository.py 2016-01-20 12:21:21 +0000 | |||
470 | +++ lib/lp/code/model/tests/test_gitrepository.py 2016-02-05 16:55:09 +0000 | |||
471 | @@ -724,7 +724,7 @@ | |||
472 | 724 | # When a GitRepository receives an object modified event, the last | 724 | # When a GitRepository receives an object modified event, the last |
473 | 725 | # modified date is set to UTC_NOW. | 725 | # modified date is set to UTC_NOW. |
474 | 726 | repository = self.factory.makeGitRepository( | 726 | repository = self.factory.makeGitRepository( |
476 | 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)) |
477 | 728 | notify(ObjectModifiedEvent( | 728 | notify(ObjectModifiedEvent( |
478 | 729 | removeSecurityProxy(repository), repository, | 729 | removeSecurityProxy(repository), repository, |
479 | 730 | [IGitRepository["name"]], user=repository.owner)) | 730 | [IGitRepository["name"]], user=repository.owner)) |
480 | @@ -733,7 +733,7 @@ | |||
481 | 733 | 733 | ||
482 | 734 | def test_create_ref_sets_date_last_modified(self): | 734 | def test_create_ref_sets_date_last_modified(self): |
483 | 735 | repository = self.factory.makeGitRepository( | 735 | repository = self.factory.makeGitRepository( |
485 | 736 | date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC)) | 736 | date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC)) |
486 | 737 | [ref] = self.factory.makeGitRefs(repository=repository) | 737 | [ref] = self.factory.makeGitRefs(repository=repository) |
487 | 738 | new_refs_info = { | 738 | new_refs_info = { |
488 | 739 | ref.path: { | 739 | ref.path: { |
489 | @@ -747,7 +747,7 @@ | |||
490 | 747 | 747 | ||
491 | 748 | def test_update_ref_sets_date_last_modified(self): | 748 | def test_update_ref_sets_date_last_modified(self): |
492 | 749 | repository = self.factory.makeGitRepository( | 749 | repository = self.factory.makeGitRepository( |
494 | 750 | date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC)) | 750 | date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC)) |
495 | 751 | [ref] = self.factory.makeGitRefs(repository=repository) | 751 | [ref] = self.factory.makeGitRefs(repository=repository) |
496 | 752 | new_refs_info = { | 752 | new_refs_info = { |
497 | 753 | u"refs/heads/new": { | 753 | u"refs/heads/new": { |
498 | @@ -761,7 +761,7 @@ | |||
499 | 761 | 761 | ||
500 | 762 | def test_remove_ref_sets_date_last_modified(self): | 762 | def test_remove_ref_sets_date_last_modified(self): |
501 | 763 | repository = self.factory.makeGitRepository( | 763 | repository = self.factory.makeGitRepository( |
503 | 764 | date_created=datetime(2015, 06, 01, tzinfo=pytz.UTC)) | 764 | date_created=datetime(2015, 6, 1, tzinfo=pytz.UTC)) |
504 | 765 | [ref] = self.factory.makeGitRefs(repository=repository) | 765 | [ref] = self.factory.makeGitRefs(repository=repository) |
505 | 766 | repository.removeRefs(set([ref.path])) | 766 | repository.removeRefs(set([ref.path])) |
506 | 767 | self.assertSqlAttributeEqualsDate( | 767 | self.assertSqlAttributeEqualsDate( |
507 | 768 | 768 | ||
508 | === modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py' | |||
509 | --- lib/lp/code/xmlrpc/tests/test_codehosting.py 2015-10-19 10:56:16 +0000 | |||
510 | +++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2016-02-05 16:55:09 +0000 | |||
511 | @@ -1,4 +1,4 @@ | |||
513 | 1 | # Copyright 2009-2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
514 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
515 | 3 | 3 | ||
516 | 4 | """Tests for the internal codehosting API.""" | 4 | """Tests for the internal codehosting API.""" |
517 | @@ -230,8 +230,8 @@ | |||
518 | 230 | 230 | ||
519 | 231 | def test_recordSuccess(self): | 231 | def test_recordSuccess(self): |
520 | 232 | # recordSuccess must insert the given data into ScriptActivity. | 232 | # recordSuccess must insert the given data into ScriptActivity. |
523 | 233 | started = datetime.datetime(2007, 07, 05, 19, 32, 1, tzinfo=UTC) | 233 | started = datetime.datetime(2007, 7, 5, 19, 32, 1, tzinfo=UTC) |
524 | 234 | completed = datetime.datetime(2007, 07, 05, 19, 34, 24, tzinfo=UTC) | 234 | completed = datetime.datetime(2007, 7, 5, 19, 34, 24, tzinfo=UTC) |
525 | 235 | started_tuple = tuple(started.utctimetuple()) | 235 | started_tuple = tuple(started.utctimetuple()) |
526 | 236 | completed_tuple = tuple(completed.utctimetuple()) | 236 | completed_tuple = tuple(completed.utctimetuple()) |
527 | 237 | success = self.codehosting_api.recordSuccess( | 237 | success = self.codehosting_api.recordSuccess( |
528 | 238 | 238 | ||
529 | === modified file 'lib/lp/codehosting/codeimport/tests/servers.py' | |||
530 | --- lib/lp/codehosting/codeimport/tests/servers.py 2012-09-06 09:25:47 +0000 | |||
531 | +++ lib/lp/codehosting/codeimport/tests/servers.py 2016-02-05 16:55:09 +0000 | |||
532 | @@ -1,4 +1,4 @@ | |||
534 | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
535 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
536 | 3 | 3 | ||
537 | 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.""" |
538 | @@ -277,7 +277,7 @@ | |||
539 | 277 | in tree_contents] | 277 | in tree_contents] |
540 | 278 | repo.object_store.add_objects(blobs) | 278 | repo.object_store.add_objects(blobs) |
541 | 279 | root_id = dulwich.index.commit_tree(repo.object_store, [ | 279 | root_id = dulwich.index.commit_tree(repo.object_store, [ |
543 | 280 | (filename, b.id, stat.S_IFREG | 0644) | 280 | (filename, b.id, stat.S_IFREG | 0o644) |
544 | 281 | for (b, filename) in blobs]) | 281 | for (b, filename) in blobs]) |
545 | 282 | repo.do_commit(committer='Joe Foo <joe@foo.com>', | 282 | repo.do_commit(committer='Joe Foo <joe@foo.com>', |
546 | 283 | message=u'<The commit message>', tree=root_id) | 283 | message=u'<The commit message>', tree=root_id) |
547 | 284 | 284 | ||
548 | === modified file 'lib/lp/codehosting/tests/servers.py' | |||
549 | --- lib/lp/codehosting/tests/servers.py 2012-08-14 23:27:07 +0000 | |||
550 | +++ lib/lp/codehosting/tests/servers.py 2016-02-05 16:55:09 +0000 | |||
551 | @@ -1,4 +1,4 @@ | |||
553 | 1 | # Copyright 2009-2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
554 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
555 | 3 | 3 | ||
556 | 4 | """Server used in codehosting acceptance tests.""" | 4 | """Server used in codehosting acceptance tests.""" |
557 | @@ -67,7 +67,7 @@ | |||
558 | 67 | """Clear the branch areas.""" | 67 | """Clear the branch areas.""" |
559 | 68 | if os.path.isdir(self._mirror_root): | 68 | if os.path.isdir(self._mirror_root): |
560 | 69 | shutil.rmtree(self._mirror_root) | 69 | shutil.rmtree(self._mirror_root) |
562 | 70 | os.makedirs(self._mirror_root, 0700) | 70 | os.makedirs(self._mirror_root, 0o700) |
563 | 71 | 71 | ||
564 | 72 | def setUpRoot(self): | 72 | def setUpRoot(self): |
565 | 73 | self.clear() | 73 | self.clear() |
566 | @@ -112,7 +112,7 @@ | |||
567 | 112 | shutil.copyfile( | 112 | shutil.copyfile( |
568 | 113 | sibpath(__file__, 'id_dsa.pub'), | 113 | sibpath(__file__, 'id_dsa.pub'), |
569 | 114 | os.path.join(user_home, '.ssh', 'id_dsa.pub')) | 114 | os.path.join(user_home, '.ssh', 'id_dsa.pub')) |
571 | 115 | os.chmod(os.path.join(user_home, '.ssh', 'id_dsa'), 0600) | 115 | os.chmod(os.path.join(user_home, '.ssh', 'id_dsa'), 0o600) |
572 | 116 | real_home, os.environ['HOME'] = os.environ['HOME'], user_home | 116 | real_home, os.environ['HOME'] = os.environ['HOME'], user_home |
573 | 117 | return real_home, user_home | 117 | return real_home, user_home |
574 | 118 | 118 | ||
575 | 119 | 119 | ||
576 | === modified file 'lib/lp/codehosting/tests/test_sftp.py' | |||
577 | --- lib/lp/codehosting/tests/test_sftp.py 2015-01-06 12:47:59 +0000 | |||
578 | +++ lib/lp/codehosting/tests/test_sftp.py 2016-02-05 16:55:09 +0000 | |||
579 | @@ -1,4 +1,4 @@ | |||
581 | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
582 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
583 | 3 | 3 | ||
584 | 4 | """Tests for the transport-backed SFTP server implementation.""" | 4 | """Tests for the transport-backed SFTP server implementation.""" |
585 | @@ -138,7 +138,7 @@ | |||
586 | 138 | branch_name = self.factory.getUniqueString() | 138 | branch_name = self.factory.getUniqueString() |
587 | 139 | deferred = server.makeDirectory( | 139 | deferred = server.makeDirectory( |
588 | 140 | '~%s/%s/%s' % (avatar.username, product.name, branch_name), | 140 | '~%s/%s/%s' % (avatar.username, product.name, branch_name), |
590 | 141 | {'permissions': 0777}) | 141 | {'permissions': 0o777}) |
591 | 142 | return deferred | 142 | return deferred |
592 | 143 | 143 | ||
593 | 144 | 144 | ||
594 | @@ -507,12 +507,12 @@ | |||
595 | 507 | # makeDirectory makes the directory. | 507 | # makeDirectory makes the directory. |
596 | 508 | directory = self.getPathSegment() | 508 | directory = self.getPathSegment() |
597 | 509 | deferred = self.sftp_server.makeDirectory( | 509 | deferred = self.sftp_server.makeDirectory( |
599 | 510 | directory, {'permissions': 0777}) | 510 | directory, {'permissions': 0o777}) |
600 | 511 | 511 | ||
601 | 512 | def assertDirectoryExists(ignored): | 512 | def assertDirectoryExists(ignored): |
602 | 513 | self.assertTrue( | 513 | self.assertTrue( |
603 | 514 | os.path.isdir(directory), '%r is not a directory' % directory) | 514 | os.path.isdir(directory), '%r is not a directory' % directory) |
605 | 515 | self.assertEqual(040777, os.stat(directory).st_mode) | 515 | self.assertEqual(0o40777, os.stat(directory).st_mode) |
606 | 516 | 516 | ||
607 | 517 | return deferred.addCallback(assertDirectoryExists) | 517 | return deferred.addCallback(assertDirectoryExists) |
608 | 518 | 518 | ||
609 | @@ -521,7 +521,7 @@ | |||
610 | 521 | nonexistent = self.getPathSegment() | 521 | nonexistent = self.getPathSegment() |
611 | 522 | nonexistent_child = '%s/%s' % (nonexistent, self.getPathSegment()) | 522 | nonexistent_child = '%s/%s' % (nonexistent, self.getPathSegment()) |
612 | 523 | deferred = self.sftp_server.makeDirectory( | 523 | deferred = self.sftp_server.makeDirectory( |
614 | 524 | nonexistent_child, {'permissions': 0777}) | 524 | nonexistent_child, {'permissions': 0o777}) |
615 | 525 | return assert_fails_with(deferred, filetransfer.SFTPError) | 525 | return assert_fails_with(deferred, filetransfer.SFTPError) |
616 | 526 | 526 | ||
617 | 527 | def test_removeDirectory(self): | 527 | def test_removeDirectory(self): |
618 | 528 | 528 | ||
619 | === modified file 'lib/lp/hardwaredb/doc/hwdb.txt' | |||
620 | --- lib/lp/hardwaredb/doc/hwdb.txt 2016-01-26 15:47:37 +0000 | |||
621 | +++ lib/lp/hardwaredb/doc/hwdb.txt 2016-02-05 16:55:09 +0000 | |||
622 | @@ -159,8 +159,8 @@ | |||
623 | 159 | ... HWSubmissionFormat, | 159 | ... HWSubmissionFormat, |
624 | 160 | ... IHWSubmissionSet, | 160 | ... IHWSubmissionSet, |
625 | 161 | ... ) | 161 | ... ) |
628 | 162 | >>> date_created = datetime(2007, 04, 01, tzinfo=pytz.timezone('UTC')) | 162 | >>> date_created = datetime(2007, 4, 1, tzinfo=pytz.timezone('UTC')) |
629 | 163 | >>> date_submitted = datetime(2007, 04, 02, tzinfo=pytz.timezone('UTC')) | 163 | >>> date_submitted = datetime(2007, 4, 2, tzinfo=pytz.timezone('UTC')) |
630 | 164 | >>> submission_data = 'submission data' | 164 | >>> submission_data = 'submission data' |
631 | 165 | >>> hw_submission_set = getUtility(IHWSubmissionSet) | 165 | >>> hw_submission_set = getUtility(IHWSubmissionSet) |
632 | 166 | >>> submission = hw_submission_set.createSubmission( | 166 | >>> submission = hw_submission_set.createSubmission( |
633 | 167 | 167 | ||
634 | === modified file 'lib/lp/registry/browser/tests/productseries-views.txt' | |||
635 | --- lib/lp/registry/browser/tests/productseries-views.txt 2012-11-08 03:55:11 +0000 | |||
636 | +++ lib/lp/registry/browser/tests/productseries-views.txt 2016-02-05 16:55:09 +0000 | |||
637 | @@ -214,7 +214,7 @@ | |||
638 | 214 | >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities | 214 | >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities |
639 | 215 | >>> celebrities = getUtility(ILaunchpadCelebrities) | 215 | >>> celebrities = getUtility(ILaunchpadCelebrities) |
640 | 216 | 216 | ||
642 | 217 | >>> test_date = datetime(2009, 05, 01, 19, 34, 24, tzinfo=UTC) | 217 | >>> test_date = datetime(2009, 5, 1, 19, 34, 24, tzinfo=UTC) |
643 | 218 | >>> product = factory.makeProduct(name="field", displayname='Field') | 218 | >>> product = factory.makeProduct(name="field", displayname='Field') |
644 | 219 | >>> productseries = factory.makeProductSeries( | 219 | >>> productseries = factory.makeProductSeries( |
645 | 220 | ... product=product, name='rabbit', date_created=test_date) | 220 | ... product=product, name='rabbit', date_created=test_date) |
646 | 221 | 221 | ||
647 | === modified file 'lib/lp/registry/browser/tests/test_announcements.py' | |||
648 | --- lib/lp/registry/browser/tests/test_announcements.py 2012-01-01 02:58:52 +0000 | |||
649 | +++ lib/lp/registry/browser/tests/test_announcements.py 2016-02-05 16:55:09 +0000 | |||
650 | @@ -1,4 +1,4 @@ | |||
652 | 1 | # Copyright 2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2016 Canonical Ltd. This software is licensed under the |
653 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
654 | 3 | 3 | ||
655 | 4 | """Tests for +announcement views.""" | 4 | """Tests for +announcement views.""" |
656 | @@ -36,7 +36,7 @@ | |||
657 | 36 | def test_announcement_info_with_publication_date(self): | 36 | def test_announcement_info_with_publication_date(self): |
658 | 37 | product = self.factory.makeProduct(displayname=u"Foo") | 37 | product = self.factory.makeProduct(displayname=u"Foo") |
659 | 38 | announcer = self.factory.makePerson(displayname=u"Bar Baz") | 38 | announcer = self.factory.makePerson(displayname=u"Bar Baz") |
661 | 39 | announced = datetime(2007, 01, 12, tzinfo=utc) | 39 | announced = datetime(2007, 1, 12, tzinfo=utc) |
662 | 40 | announcement = product.announce( | 40 | announcement = product.announce( |
663 | 41 | announcer, "Hello World", publication_date=announced) | 41 | announcer, "Hello World", publication_date=announced) |
664 | 42 | view = create_initialized_view(announcement, "+index") | 42 | view = create_initialized_view(announcement, "+index") |
665 | 43 | 43 | ||
666 | === modified file 'lib/lp/registry/doc/distribution-mirror.txt' | |||
667 | --- lib/lp/registry/doc/distribution-mirror.txt 2016-01-26 15:47:37 +0000 | |||
668 | +++ lib/lp/registry/doc/distribution-mirror.txt 2016-02-05 16:55:09 +0000 | |||
669 | @@ -576,8 +576,8 @@ | |||
670 | 576 | ... warty.components[0]) | 576 | ... warty.components[0]) |
671 | 577 | >>> warty_i386_mirror = removeSecurityProxy(warty_i386_mirror) | 577 | >>> warty_i386_mirror = removeSecurityProxy(warty_i386_mirror) |
672 | 578 | >>> recent_freshness, threshold = warty_i386_mirror.freshness_times[0] | 578 | >>> recent_freshness, threshold = warty_i386_mirror.freshness_times[0] |
675 | 579 | >>> start = datetime(2005, 06, 20, tzinfo=utc) | 579 | >>> start = datetime(2005, 6, 20, tzinfo=utc) |
676 | 580 | >>> end = datetime(2005, 06, 20, tzinfo=utc) + timedelta(hours=0.5) | 580 | >>> end = datetime(2005, 6, 20, tzinfo=utc) + timedelta(hours=0.5) |
677 | 581 | >>> time_interval = (start, end) | 581 | >>> time_interval = (start, end) |
678 | 582 | >>> upload = warty_i386_mirror.getLatestPublishingEntry( | 582 | >>> upload = warty_i386_mirror.getLatestPublishingEntry( |
679 | 583 | ... time_interval, deb_only=False) | 583 | ... time_interval, deb_only=False) |
680 | 584 | 584 | ||
681 | === modified file 'lib/lp/registry/doc/poll.txt' | |||
682 | --- lib/lp/registry/doc/poll.txt 2011-12-30 06:14:56 +0000 | |||
683 | +++ lib/lp/registry/doc/poll.txt 2016-02-05 16:55:09 +0000 | |||
684 | @@ -39,7 +39,7 @@ | |||
685 | 39 | >>> pollsubset = IPollSubset(team) | 39 | >>> pollsubset = IPollSubset(team) |
686 | 40 | 40 | ||
687 | 41 | Now we create a new poll on this team. | 41 | Now we create a new poll on this team. |
689 | 42 | >>> opendate = datetime(2005, 01, 01, tzinfo=pytz.timezone('UTC')) | 42 | >>> opendate = datetime(2005, 1, 1, tzinfo=pytz.timezone('UTC')) |
690 | 43 | >>> closedate = opendate + timedelta(weeks=2) | 43 | >>> closedate = opendate + timedelta(weeks=2) |
691 | 44 | >>> title = "2005 Leader's Elections" | 44 | >>> title = "2005 Leader's Elections" |
692 | 45 | >>> proposition = "Who's going to be the next leader?" | 45 | >>> proposition = "Who's going to be the next leader?" |
693 | 46 | 46 | ||
694 | === modified file 'lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt' | |||
695 | --- lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt 2016-01-26 15:47:37 +0000 | |||
696 | +++ lib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt 2016-02-05 16:55:09 +0000 | |||
697 | @@ -214,7 +214,7 @@ | |||
698 | 214 | >>> logintoken = LoginToken.selectOneBy( | 214 | >>> logintoken = LoginToken.selectOneBy( |
699 | 215 | ... _token=hashlib.sha256(token_value).hexdigest()) | 215 | ... _token=hashlib.sha256(token_value).hexdigest()) |
700 | 216 | >>> logintoken.date_created = datetime.datetime( | 216 | >>> logintoken.date_created = datetime.datetime( |
702 | 217 | ... 2005,04,01, 12,00,00, tzinfo=pytz.timezone('UTC')) | 217 | ... 2005, 4, 1, 12, 0, 0, tzinfo=pytz.timezone('UTC')) |
703 | 218 | >>> logintoken.sync() | 218 | >>> logintoken.sync() |
704 | 219 | 219 | ||
705 | 220 | Back to Sample User. They visit the token URL and is asked to sign some | 220 | Back to Sample User. They visit the token URL and is asked to sign some |
706 | 221 | 221 | ||
707 | === modified file 'lib/lp/registry/tests/test_distributionmirror_prober.py' | |||
708 | --- lib/lp/registry/tests/test_distributionmirror_prober.py 2015-02-18 18:44:32 +0000 | |||
709 | +++ lib/lp/registry/tests/test_distributionmirror_prober.py 2016-02-05 16:55:09 +0000 | |||
710 | @@ -1,4 +1,4 @@ | |||
712 | 1 | # Copyright 2009-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
713 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
714 | 3 | 3 | ||
715 | 4 | """distributionmirror-prober tests.""" | 4 | """distributionmirror-prober tests.""" |
716 | @@ -930,7 +930,7 @@ | |||
717 | 930 | 930 | ||
718 | 931 | def _fake_gettime(self): | 931 | def _fake_gettime(self): |
719 | 932 | # Fake the current time. | 932 | # Fake the current time. |
721 | 933 | fake_time = datetime(2004, 10, 20, 12, 00, 00, 000000) | 933 | fake_time = datetime(2004, 10, 20, 12, 0, 0, 0) |
722 | 934 | return fake_time | 934 | return fake_time |
723 | 935 | 935 | ||
724 | 936 | def test_logMessage_output(self): | 936 | def test_logMessage_output(self): |
725 | 937 | 937 | ||
726 | === modified file 'lib/lp/scripts/runlaunchpad.py' | |||
727 | --- lib/lp/scripts/runlaunchpad.py 2014-01-06 06:52:41 +0000 | |||
728 | +++ lib/lp/scripts/runlaunchpad.py 2016-02-05 16:55:09 +0000 | |||
729 | @@ -1,4 +1,4 @@ | |||
731 | 1 | # Copyright 2009-2014 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
732 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
733 | 3 | 3 | ||
734 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
735 | @@ -273,7 +273,7 @@ | |||
736 | 273 | 273 | ||
737 | 274 | def prepare_for_librarian(): | 274 | def prepare_for_librarian(): |
738 | 275 | if not os.path.isdir(config.librarian_server.root): | 275 | if not os.path.isdir(config.librarian_server.root): |
740 | 276 | os.makedirs(config.librarian_server.root, 0700) | 276 | os.makedirs(config.librarian_server.root, 0o700) |
741 | 277 | 277 | ||
742 | 278 | 278 | ||
743 | 279 | SERVICES = { | 279 | SERVICES = { |
744 | 280 | 280 | ||
745 | === modified file 'lib/lp/scripts/tests/test_garbo.py' | |||
746 | --- lib/lp/scripts/tests/test_garbo.py 2015-12-15 15:58:49 +0000 | |||
747 | +++ lib/lp/scripts/tests/test_garbo.py 2016-02-05 16:55:09 +0000 | |||
748 | @@ -1,4 +1,4 @@ | |||
750 | 1 | # Copyright 2009-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
751 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
752 | 3 | 3 | ||
753 | 4 | """Test the database garbage collector.""" | 4 | """Test the database garbage collector.""" |
754 | @@ -735,7 +735,7 @@ | |||
755 | 735 | self.factory.makePerson(name='test-unlinked-person-new') | 735 | self.factory.makePerson(name='test-unlinked-person-new') |
756 | 736 | person_old = self.factory.makePerson(name='test-unlinked-person-old') | 736 | person_old = self.factory.makePerson(name='test-unlinked-person-old') |
757 | 737 | removeSecurityProxy(person_old).datecreated = datetime( | 737 | removeSecurityProxy(person_old).datecreated = datetime( |
759 | 738 | 2008, 01, 01, tzinfo=UTC) | 738 | 2008, 1, 1, tzinfo=UTC) |
760 | 739 | 739 | ||
761 | 740 | # Normally, the garbage collector will do nothing because the | 740 | # Normally, the garbage collector will do nothing because the |
762 | 741 | # PersonPruner is experimental | 741 | # PersonPruner is experimental |
763 | @@ -1030,7 +1030,7 @@ | |||
764 | 1030 | path="sample path")))) | 1030 | path="sample path")))) |
765 | 1031 | # One to clean and one to keep | 1031 | # One to clean and one to keep |
766 | 1032 | store.add(TimeLimitedToken(path="sample path", token="foo", | 1032 | store.add(TimeLimitedToken(path="sample path", token="foo", |
768 | 1033 | created=datetime(2008, 01, 01, tzinfo=UTC))) | 1033 | created=datetime(2008, 1, 1, tzinfo=UTC))) |
769 | 1034 | store.add(TimeLimitedToken(path="sample path", token="bar")), | 1034 | store.add(TimeLimitedToken(path="sample path", token="bar")), |
770 | 1035 | store.commit() | 1035 | store.commit() |
771 | 1036 | self.assertEqual(2, len(list(store.find(TimeLimitedToken, | 1036 | self.assertEqual(2, len(list(store.find(TimeLimitedToken, |
772 | 1037 | 1037 | ||
773 | === modified file 'lib/lp/services/librarianserver/testing/server.py' | |||
774 | --- lib/lp/services/librarianserver/testing/server.py 2012-02-28 05:36:01 +0000 | |||
775 | +++ lib/lp/services/librarianserver/testing/server.py 2016-02-05 16:55:09 +0000 | |||
776 | @@ -1,4 +1,4 @@ | |||
778 | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
779 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
780 | 3 | 3 | ||
781 | 4 | """Fixture for the librarians.""" | 4 | """Fixture for the librarians.""" |
782 | @@ -130,7 +130,7 @@ | |||
783 | 130 | root_fixture = FunctionFixture(tempfile.mkdtemp, shutil.rmtree) | 130 | root_fixture = FunctionFixture(tempfile.mkdtemp, shutil.rmtree) |
784 | 131 | self.useFixture(root_fixture) | 131 | self.useFixture(root_fixture) |
785 | 132 | self._root = root_fixture.fn_result | 132 | self._root = root_fixture.fn_result |
787 | 133 | os.chmod(self.root, 0700) | 133 | os.chmod(self.root, 0o700) |
788 | 134 | # Give the root to the new librarian. | 134 | # Give the root to the new librarian. |
789 | 135 | os.environ['LP_LIBRARIAN_ROOT'] = self._root | 135 | os.environ['LP_LIBRARIAN_ROOT'] = self._root |
790 | 136 | else: | 136 | else: |
791 | @@ -139,7 +139,7 @@ | |||
792 | 139 | if os.path.exists(self.root): | 139 | if os.path.exists(self.root): |
793 | 140 | self.tearDownRoot() | 140 | self.tearDownRoot() |
794 | 141 | self.addCleanup(self.tearDownRoot) | 141 | self.addCleanup(self.tearDownRoot) |
796 | 142 | os.makedirs(self.root, 0700) | 142 | os.makedirs(self.root, 0o700) |
797 | 143 | 143 | ||
798 | 144 | def _waitForDaemonStartup(self): | 144 | def _waitForDaemonStartup(self): |
799 | 145 | super(LibrarianServerFixture, self)._waitForDaemonStartup() | 145 | super(LibrarianServerFixture, self)._waitForDaemonStartup() |
800 | 146 | 146 | ||
801 | === modified file 'lib/lp/services/librarianserver/tests/test_web.py' | |||
802 | --- lib/lp/services/librarianserver/tests/test_web.py 2015-12-27 03:42:08 +0000 | |||
803 | +++ lib/lp/services/librarianserver/tests/test_web.py 2016-02-05 16:55:09 +0000 | |||
804 | @@ -1,4 +1,4 @@ | |||
806 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
807 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
808 | 3 | 3 | ||
809 | 4 | from cStringIO import StringIO | 4 | from cStringIO import StringIO |
810 | @@ -223,7 +223,7 @@ | |||
811 | 223 | file_alias = IMasterStore(LibraryFileAlias).get( | 223 | file_alias = IMasterStore(LibraryFileAlias).get( |
812 | 224 | LibraryFileAlias, file_alias_id) | 224 | LibraryFileAlias, file_alias_id) |
813 | 225 | file_alias.date_created = datetime( | 225 | file_alias.date_created = datetime( |
815 | 226 | 2001, 01, 30, 13, 45, 59, tzinfo=pytz.utc) | 226 | 2001, 1, 30, 13, 45, 59, tzinfo=pytz.utc) |
816 | 227 | 227 | ||
817 | 228 | # Commit so the file is available from the Librarian. | 228 | # Commit so the file is available from the Librarian. |
818 | 229 | self.commit() | 229 | self.commit() |
819 | @@ -419,7 +419,7 @@ | |||
820 | 419 | file_alias = IMasterStore(LibraryFileAlias).get( | 419 | file_alias = IMasterStore(LibraryFileAlias).get( |
821 | 420 | LibraryFileAlias, fileAlias) | 420 | LibraryFileAlias, fileAlias) |
822 | 421 | file_alias.date_created = datetime( | 421 | file_alias.date_created = datetime( |
824 | 422 | 2001, 01, 30, 13, 45, 59, tzinfo=pytz.utc) | 422 | 2001, 1, 30, 13, 45, 59, tzinfo=pytz.utc) |
825 | 423 | # Commit the update. | 423 | # Commit the update. |
826 | 424 | self.commit() | 424 | self.commit() |
827 | 425 | # Fetch the file via HTTP, recording the interesting headers | 425 | # Fetch the file via HTTP, recording the interesting headers |
828 | 426 | 426 | ||
829 | === modified file 'lib/lp/services/osutils.py' | |||
830 | --- lib/lp/services/osutils.py 2012-12-26 02:03:56 +0000 | |||
831 | +++ lib/lp/services/osutils.py 2016-02-05 16:55:09 +0000 | |||
832 | @@ -1,4 +1,4 @@ | |||
834 | 1 | # Copyright 2009-2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
835 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
836 | 3 | 3 | ||
837 | 4 | """Utilities for doing the sort of thing the os module does.""" | 4 | """Utilities for doing the sort of thing the os module does.""" |
838 | @@ -64,7 +64,7 @@ | |||
839 | 64 | set_environ(old_values) | 64 | set_environ(old_values) |
840 | 65 | 65 | ||
841 | 66 | 66 | ||
843 | 67 | def ensure_directory_exists(directory, mode=0777): | 67 | def ensure_directory_exists(directory, mode=0o777): |
844 | 68 | """Create 'directory' if it doesn't exist. | 68 | """Create 'directory' if it doesn't exist. |
845 | 69 | 69 | ||
846 | 70 | :return: True if the directory had to be created, False otherwise. | 70 | :return: True if the directory had to be created, False otherwise. |
847 | @@ -78,7 +78,7 @@ | |||
848 | 78 | return True | 78 | return True |
849 | 79 | 79 | ||
850 | 80 | 80 | ||
852 | 81 | def open_for_writing(filename, mode, dirmode=0777): | 81 | def open_for_writing(filename, mode, dirmode=0o777): |
853 | 82 | """Open 'filename' for writing, creating directories if necessary. | 82 | """Open 'filename' for writing, creating directories if necessary. |
854 | 83 | 83 | ||
855 | 84 | :param filename: The path of the file to open. | 84 | :param filename: The path of the file to open. |
856 | 85 | 85 | ||
857 | === modified file 'lib/lp/services/tarfile_helpers.py' | |||
858 | --- lib/lp/services/tarfile_helpers.py 2012-05-25 13:22:27 +0000 | |||
859 | +++ lib/lp/services/tarfile_helpers.py 2016-02-05 16:55:09 +0000 | |||
860 | @@ -1,4 +1,4 @@ | |||
862 | 1 | # Copyright 2010-2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the |
863 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
864 | 3 | 3 | ||
865 | 4 | """Helpers to work with tar files more easily.""" | 4 | """Helpers to work with tar files more easily.""" |
866 | @@ -87,7 +87,7 @@ | |||
867 | 87 | except KeyError: | 87 | except KeyError: |
868 | 88 | tarinfo = self._make_skeleton_tarinfo(joined_path, now) | 88 | tarinfo = self._make_skeleton_tarinfo(joined_path, now) |
869 | 89 | tarinfo.type = tarfile.DIRTYPE | 89 | tarinfo.type = tarfile.DIRTYPE |
871 | 90 | tarinfo.mode = 0755 | 90 | tarinfo.mode = 0o755 |
872 | 91 | self.tarfile.addfile(tarinfo) | 91 | self.tarfile.addfile(tarinfo) |
873 | 92 | 92 | ||
874 | 93 | def add_directory(self, path): | 93 | def add_directory(self, path): |
875 | @@ -105,7 +105,7 @@ | |||
876 | 105 | self._ensure_directories(path, now) | 105 | self._ensure_directories(path, now) |
877 | 106 | 106 | ||
878 | 107 | tarinfo = self._make_skeleton_tarinfo(path, now) | 107 | tarinfo = self._make_skeleton_tarinfo(path, now) |
880 | 108 | tarinfo.mode = 0644 | 108 | tarinfo.mode = 0o644 |
881 | 109 | tarinfo.size = len(contents) | 109 | tarinfo.size = len(contents) |
882 | 110 | self.tarfile.addfile(tarinfo, StringIO(contents)) | 110 | self.tarfile.addfile(tarinfo, StringIO(contents)) |
883 | 111 | 111 | ||
884 | 112 | 112 | ||
885 | === modified file 'lib/lp/services/webapp/tests/test_batching.py' | |||
886 | --- lib/lp/services/webapp/tests/test_batching.py 2015-10-01 10:25:19 +0000 | |||
887 | +++ lib/lp/services/webapp/tests/test_batching.py 2016-02-05 16:55:09 +0000 | |||
888 | @@ -1,4 +1,4 @@ | |||
890 | 1 | # Copyright 2011 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2016 Canonical Ltd. This software is licensed under the |
891 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
892 | 3 | 3 | ||
893 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
894 | @@ -395,7 +395,7 @@ | |||
895 | 395 | range_factory = StormRangeFactory(resultset, self.logError) | 395 | range_factory = StormRangeFactory(resultset, self.logError) |
896 | 396 | order_by = [ | 396 | order_by = [ |
897 | 397 | Person.id, Person.datecreated, Person.name, Person.display_name] | 397 | Person.id, Person.datecreated, Person.name, Person.display_name] |
899 | 398 | limits = [1, datetime(2011, 07, 25, 0, 0, 0), 'foo', 'bar'] | 398 | limits = [1, datetime(2011, 7, 25, 0, 0, 0), 'foo', 'bar'] |
900 | 399 | result = range_factory.limitsGroupedByOrderDirection(order_by, limits) | 399 | result = range_factory.limitsGroupedByOrderDirection(order_by, limits) |
901 | 400 | self.assertEqual([(order_by, limits)], result) | 400 | self.assertEqual([(order_by, limits)], result) |
902 | 401 | order_by = [ | 401 | order_by = [ |
903 | @@ -443,7 +443,7 @@ | |||
904 | 443 | Person.id, Person.datecreated, Desc(Person.name), | 443 | Person.id, Person.datecreated, Desc(Person.name), |
905 | 444 | Desc(Person.display_name)] | 444 | Desc(Person.display_name)] |
906 | 445 | limits = [ | 445 | limits = [ |
908 | 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'] |
909 | 447 | limits = range_factory.limitsGroupedByOrderDirection(order_by, limits) | 447 | limits = range_factory.limitsGroupedByOrderDirection(order_by, limits) |
910 | 448 | equals_expressions = range_factory.equalsExpressionsFromLimits(limits) | 448 | equals_expressions = range_factory.equalsExpressionsFromLimits(limits) |
911 | 449 | equals_expressions = map(compile, equals_expressions) | 449 | equals_expressions = map(compile, equals_expressions) |
912 | 450 | 450 | ||
913 | === modified file 'lib/lp/snappy/tests/test_snapbuild.py' | |||
914 | --- lib/lp/snappy/tests/test_snapbuild.py 2016-02-04 00:45:12 +0000 | |||
915 | +++ lib/lp/snappy/tests/test_snapbuild.py 2016-02-05 16:55:09 +0000 | |||
916 | @@ -1,4 +1,4 @@ | |||
918 | 1 | # Copyright 2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2015-2016 Canonical Ltd. This software is licensed under the |
919 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
920 | 3 | 3 | ||
921 | 4 | """Test snap package build features.""" | 4 | """Test snap package build features.""" |
922 | @@ -238,7 +238,7 @@ | |||
923 | 238 | build = self.factory.makeSnapBuild( | 238 | build = self.factory.makeSnapBuild( |
924 | 239 | name=u"snap-1", requester=person, owner=person, | 239 | name=u"snap-1", requester=person, owner=person, |
925 | 240 | distroarchseries=distroarchseries, | 240 | distroarchseries=distroarchseries, |
927 | 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), |
928 | 242 | status=BuildStatus.FAILEDTOBUILD, | 242 | status=BuildStatus.FAILEDTOBUILD, |
929 | 243 | builder=self.factory.makeBuilder(name="bob"), | 243 | builder=self.factory.makeBuilder(name="bob"), |
930 | 244 | duration=timedelta(minutes=10)) | 244 | duration=timedelta(minutes=10)) |
931 | @@ -332,7 +332,7 @@ | |||
932 | 332 | # The basic properties of a SnapBuild are sensible. | 332 | # The basic properties of a SnapBuild are sensible. |
933 | 333 | db_build = self.factory.makeSnapBuild( | 333 | db_build = self.factory.makeSnapBuild( |
934 | 334 | requester=self.person, | 334 | requester=self.person, |
936 | 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)) |
937 | 336 | build_url = api_url(db_build) | 336 | build_url = api_url(db_build) |
938 | 337 | logout() | 337 | logout() |
939 | 338 | build = self.webservice.get(build_url).jsonBody() | 338 | build = self.webservice.get(build_url).jsonBody() |
940 | 339 | 339 | ||
941 | === modified file 'lib/lp/soyuz/model/queue.py' | |||
942 | --- lib/lp/soyuz/model/queue.py 2016-01-26 15:47:37 +0000 | |||
943 | +++ lib/lp/soyuz/model/queue.py 2016-02-05 16:55:09 +0000 | |||
944 | @@ -1,4 +1,4 @@ | |||
946 | 1 | # Copyright 2009-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
947 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
948 | 3 | 3 | ||
949 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
950 | @@ -1444,7 +1444,7 @@ | |||
951 | 1444 | dest_file = os.path.join( | 1444 | dest_file = os.path.join( |
952 | 1445 | archive_config.metaroot, self.libraryfilealias.filename) | 1445 | archive_config.metaroot, self.libraryfilealias.filename) |
953 | 1446 | if not os.path.isdir(archive_config.metaroot): | 1446 | if not os.path.isdir(archive_config.metaroot): |
955 | 1447 | os.makedirs(archive_config.metaroot, 0755) | 1447 | os.makedirs(archive_config.metaroot, 0o755) |
956 | 1448 | 1448 | ||
957 | 1449 | # At this point we now have a directory of the format: | 1449 | # At this point we now have a directory of the format: |
958 | 1450 | # <person_name>/meta/<ppa_name> | 1450 | # <person_name>/meta/<ppa_name> |
959 | 1451 | 1451 | ||
960 | === modified file 'lib/lp/soyuz/tests/test_binarypackagename.py' | |||
961 | --- lib/lp/soyuz/tests/test_binarypackagename.py 2012-09-26 08:12:48 +0000 | |||
962 | +++ lib/lp/soyuz/tests/test_binarypackagename.py 2016-02-05 16:55:09 +0000 | |||
963 | @@ -1,4 +1,4 @@ | |||
965 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the |
966 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
967 | 3 | 3 | ||
968 | 4 | """Test BinaryPackageName.""" | 4 | """Test BinaryPackageName.""" |
969 | @@ -169,10 +169,10 @@ | |||
970 | 169 | name = self.factory.makeBinaryPackageName() | 169 | name = self.factory.makeBinaryPackageName() |
971 | 170 | self.factory.makeBinaryPackageRelease( | 170 | self.factory.makeBinaryPackageRelease( |
972 | 171 | binarypackagename=name, description="foo", | 171 | binarypackagename=name, description="foo", |
974 | 172 | date_created=datetime(1980, 01, 01, tzinfo=pytz.UTC)) | 172 | date_created=datetime(1980, 1, 1, tzinfo=pytz.UTC)) |
975 | 173 | self.factory.makeBinaryPackageRelease( | 173 | self.factory.makeBinaryPackageRelease( |
976 | 174 | binarypackagename=name, description="bar", | 174 | binarypackagename=name, description="bar", |
978 | 175 | date_created=datetime(2000, 01, 01, tzinfo=pytz.UTC)) | 175 | date_created=datetime(2000, 1, 1, tzinfo=pytz.UTC)) |
979 | 176 | self.assertEqual( | 176 | self.assertEqual( |
980 | 177 | {name.name: "bar"}, | 177 | {name.name: "bar"}, |
981 | 178 | getBinaryPackageDescriptions([name], max_title_length=3)) | 178 | getBinaryPackageDescriptions([name], max_title_length=3)) |
982 | 179 | 179 | ||
983 | === modified file 'lib/lp/soyuz/tests/test_build.py' | |||
984 | --- lib/lp/soyuz/tests/test_build.py 2015-09-11 12:21:16 +0000 | |||
985 | +++ lib/lp/soyuz/tests/test_build.py 2016-02-05 16:55:09 +0000 | |||
986 | @@ -1,4 +1,4 @@ | |||
988 | 1 | # Copyright 2011-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2011-2016 Canonical Ltd. This software is licensed under the |
989 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
990 | 3 | 3 | ||
991 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
992 | @@ -112,10 +112,10 @@ | |||
993 | 112 | self.assertEquals( | 112 | self.assertEquals( |
994 | 113 | PackageUploadStatus.DONE, build.package_upload.status) | 113 | PackageUploadStatus.DONE, build.package_upload.status) |
995 | 114 | self.assertEquals( | 114 | self.assertEquals( |
997 | 115 | datetime(2008, 01, 01, 0, 0, 0, tzinfo=pytz.UTC), | 115 | datetime(2008, 1, 1, 0, 0, 0, tzinfo=pytz.UTC), |
998 | 116 | build.date_started) | 116 | build.date_started) |
999 | 117 | self.assertEquals( | 117 | self.assertEquals( |
1001 | 118 | datetime(2008, 01, 01, 0, 5, 0, tzinfo=pytz.UTC), | 118 | datetime(2008, 1, 1, 0, 5, 0, tzinfo=pytz.UTC), |
1002 | 119 | build.date_finished) | 119 | build.date_finished) |
1003 | 120 | self.assertEquals(timedelta(minutes=5), build.duration) | 120 | self.assertEquals(timedelta(minutes=5), build.duration) |
1004 | 121 | expected_buildlog = 'buildlog_%s-%s-%s.%s_%s_FULLYBUILT.txt.gz' % ( | 121 | expected_buildlog = 'buildlog_%s-%s-%s.%s_%s_FULLYBUILT.txt.gz' % ( |
1005 | 122 | 122 | ||
1006 | === modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py' | |||
1007 | --- lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py 2012-07-02 16:11:15 +0000 | |||
1008 | +++ lib/lp/soyuz/tests/test_distroseriesqueue_ddtp_tarball.py 2016-02-05 16:55:09 +0000 | |||
1009 | @@ -1,4 +1,4 @@ | |||
1011 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
1012 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1013 | 3 | 3 | ||
1014 | 4 | """Test upload and queue manipulation of DDTP tarballs. | 4 | """Test upload and queue manipulation of DDTP tarballs. |
1015 | @@ -36,8 +36,8 @@ | |||
1016 | 36 | def setUp(self): | 36 | def setUp(self): |
1017 | 37 | super(TestDistroSeriesQueueDdtpTarball, self).setUp() | 37 | super(TestDistroSeriesQueueDdtpTarball, self).setUp() |
1018 | 38 | import_public_test_keys() | 38 | import_public_test_keys() |
1021 | 39 | # CustomUpload.installFiles requires a umask of 022. | 39 | # CustomUpload.installFiles requires a umask of 0o022. |
1022 | 40 | old_umask = os.umask(022) | 40 | old_umask = os.umask(0o022) |
1023 | 41 | self.addCleanup(os.umask, old_umask) | 41 | self.addCleanup(os.umask, old_umask) |
1024 | 42 | self.anything_policy = getPolicy( | 42 | self.anything_policy = getPolicy( |
1025 | 43 | name="anything", distro="ubuntutest", distroseries=None) | 43 | name="anything", distro="ubuntutest", distroseries=None) |
1026 | 44 | 44 | ||
1027 | === modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py' | |||
1028 | --- lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py 2015-08-26 13:41:21 +0000 | |||
1029 | +++ lib/lp/soyuz/tests/test_distroseriesqueue_debian_installer.py 2016-02-05 16:55:09 +0000 | |||
1030 | @@ -1,4 +1,4 @@ | |||
1032 | 1 | # Copyright 2012-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
1033 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1034 | 3 | 3 | ||
1035 | 4 | """Test upload and queue manipulation of debian-installer custom uploads. | 4 | """Test upload and queue manipulation of debian-installer custom uploads. |
1036 | @@ -29,8 +29,8 @@ | |||
1037 | 29 | def setUp(self): | 29 | def setUp(self): |
1038 | 30 | super(TestDistroSeriesQueueDebianInstaller, self).setUp() | 30 | super(TestDistroSeriesQueueDebianInstaller, self).setUp() |
1039 | 31 | import_public_test_keys() | 31 | import_public_test_keys() |
1042 | 32 | # CustomUpload.installFiles requires a umask of 022. | 32 | # CustomUpload.installFiles requires a umask of 0o022. |
1043 | 33 | old_umask = os.umask(022) | 33 | old_umask = os.umask(0o022) |
1044 | 34 | self.addCleanup(os.umask, old_umask) | 34 | self.addCleanup(os.umask, old_umask) |
1045 | 35 | self.anything_policy = getPolicy( | 35 | self.anything_policy = getPolicy( |
1046 | 36 | name="anything", distro="ubuntutest", distroseries=None) | 36 | name="anything", distro="ubuntutest", distroseries=None) |
1047 | 37 | 37 | ||
1048 | === modified file 'lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py' | |||
1049 | --- lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py 2015-09-02 12:05:15 +0000 | |||
1050 | +++ lib/lp/soyuz/tests/test_distroseriesqueue_dist_upgrader.py 2016-02-05 16:55:09 +0000 | |||
1051 | @@ -1,4 +1,4 @@ | |||
1053 | 1 | # Copyright 2012 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the |
1054 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1055 | 3 | 3 | ||
1056 | 4 | """Test upload and queue manipulation of dist-upgrader tarballs. | 4 | """Test upload and queue manipulation of dist-upgrader tarballs. |
1057 | @@ -32,8 +32,8 @@ | |||
1058 | 32 | def setUp(self): | 32 | def setUp(self): |
1059 | 33 | super(TestDistroSeriesQueueDistUpgrader, self).setUp() | 33 | super(TestDistroSeriesQueueDistUpgrader, self).setUp() |
1060 | 34 | import_public_test_keys() | 34 | import_public_test_keys() |
1063 | 35 | # CustomUpload.installFiles requires a umask of 022. | 35 | # CustomUpload.installFiles requires a umask of 0o022. |
1064 | 36 | old_umask = os.umask(022) | 36 | old_umask = os.umask(0o022) |
1065 | 37 | self.addCleanup(os.umask, old_umask) | 37 | self.addCleanup(os.umask, old_umask) |
1066 | 38 | self.anything_policy = getPolicy( | 38 | self.anything_policy = getPolicy( |
1067 | 39 | name="anything", distro="ubuntutest", distroseries=None) | 39 | name="anything", distro="ubuntutest", distroseries=None) |
1068 | 40 | 40 | ||
1069 | === modified file 'lib/lp/soyuz/tests/test_livefs.py' | |||
1070 | --- lib/lp/soyuz/tests/test_livefs.py 2015-09-15 20:16:47 +0000 | |||
1071 | +++ lib/lp/soyuz/tests/test_livefs.py 2016-02-05 16:55:09 +0000 | |||
1072 | @@ -1,4 +1,4 @@ | |||
1074 | 1 | # Copyright 2014-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the |
1075 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1076 | 3 | 3 | ||
1077 | 4 | """Test live filesystems.""" | 4 | """Test live filesystems.""" |
1078 | @@ -96,14 +96,14 @@ | |||
1079 | 96 | def test_initial_date_last_modified(self): | 96 | def test_initial_date_last_modified(self): |
1080 | 97 | # The initial value of date_last_modified is date_created. | 97 | # The initial value of date_last_modified is date_created. |
1081 | 98 | livefs = self.factory.makeLiveFS( | 98 | livefs = self.factory.makeLiveFS( |
1083 | 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)) |
1084 | 100 | self.assertEqual(livefs.date_created, livefs.date_last_modified) | 100 | self.assertEqual(livefs.date_created, livefs.date_last_modified) |
1085 | 101 | 101 | ||
1086 | 102 | def test_modifiedevent_sets_date_last_modified(self): | 102 | def test_modifiedevent_sets_date_last_modified(self): |
1087 | 103 | # When a LiveFS receives an object modified event, the last modified | 103 | # When a LiveFS receives an object modified event, the last modified |
1088 | 104 | # date is set to UTC_NOW. | 104 | # date is set to UTC_NOW. |
1089 | 105 | livefs = self.factory.makeLiveFS( | 105 | livefs = self.factory.makeLiveFS( |
1091 | 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)) |
1092 | 107 | notify(ObjectModifiedEvent( | 107 | notify(ObjectModifiedEvent( |
1093 | 108 | removeSecurityProxy(livefs), livefs, [ILiveFS["name"]])) | 108 | removeSecurityProxy(livefs), livefs, [ILiveFS["name"]])) |
1094 | 109 | self.assertSqlAttributeEqualsDate( | 109 | self.assertSqlAttributeEqualsDate( |
1095 | 110 | 110 | ||
1096 | === modified file 'lib/lp/soyuz/tests/test_livefsbuild.py' | |||
1097 | --- lib/lp/soyuz/tests/test_livefsbuild.py 2015-09-11 12:20:23 +0000 | |||
1098 | +++ lib/lp/soyuz/tests/test_livefsbuild.py 2016-02-05 16:55:09 +0000 | |||
1099 | @@ -1,4 +1,4 @@ | |||
1101 | 1 | # Copyright 2014-2015 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the |
1102 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1103 | 3 | 3 | ||
1104 | 4 | """Test live filesystem build features.""" | 4 | """Test live filesystem build features.""" |
1105 | @@ -240,7 +240,7 @@ | |||
1106 | 240 | build = self.factory.makeLiveFSBuild( | 240 | build = self.factory.makeLiveFSBuild( |
1107 | 241 | name=u"livefs-1", requester=person, owner=person, | 241 | name=u"livefs-1", requester=person, owner=person, |
1108 | 242 | distroarchseries=distroarchseries, | 242 | distroarchseries=distroarchseries, |
1110 | 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), |
1111 | 244 | status=BuildStatus.FAILEDTOBUILD, | 244 | status=BuildStatus.FAILEDTOBUILD, |
1112 | 245 | builder=self.factory.makeBuilder(name="bob"), | 245 | builder=self.factory.makeBuilder(name="bob"), |
1113 | 246 | duration=timedelta(minutes=10)) | 246 | duration=timedelta(minutes=10)) |
1114 | @@ -338,7 +338,7 @@ | |||
1115 | 338 | db_build = self.factory.makeLiveFSBuild( | 338 | db_build = self.factory.makeLiveFSBuild( |
1116 | 339 | requester=self.person, unique_key=u"foo", | 339 | requester=self.person, unique_key=u"foo", |
1117 | 340 | metadata_override={"image_format": "plain"}, | 340 | metadata_override={"image_format": "plain"}, |
1119 | 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)) |
1120 | 342 | build_url = api_url(db_build) | 342 | build_url = api_url(db_build) |
1121 | 343 | logout() | 343 | logout() |
1122 | 344 | build = self.webservice.get(build_url).jsonBody() | 344 | build = self.webservice.get(build_url).jsonBody() |
1123 | 345 | 345 | ||
1124 | === modified file 'lib/lp/soyuz/tests/test_livefsbuildbehaviour.py' | |||
1125 | --- lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2015-10-21 09:37:08 +0000 | |||
1126 | +++ lib/lp/soyuz/tests/test_livefsbuildbehaviour.py 2016-02-05 16:55:09 +0000 | |||
1127 | @@ -1,4 +1,4 @@ | |||
1129 | 1 | # Copyright 2014 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the |
1130 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1131 | 3 | 3 | ||
1132 | 4 | """Test live filesystem build behaviour.""" | 4 | """Test live filesystem build behaviour.""" |
1133 | @@ -160,7 +160,7 @@ | |||
1134 | 160 | def test_extraBuildArgs(self): | 160 | def test_extraBuildArgs(self): |
1135 | 161 | # _extraBuildArgs returns a reasonable set of additional arguments. | 161 | # _extraBuildArgs returns a reasonable set of additional arguments. |
1136 | 162 | job = self.makeJob( | 162 | job = self.makeJob( |
1138 | 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), |
1139 | 164 | metadata={"project": "distro", "subproject": "special"}) | 164 | metadata={"project": "distro", "subproject": "special"}) |
1140 | 165 | expected_archives = get_sources_list_for_building( | 165 | expected_archives = get_sources_list_for_building( |
1141 | 166 | job.build, job.build.distro_arch_series, None) | 166 | job.build, job.build.distro_arch_series, None) |
1142 | 167 | 167 | ||
1143 | === modified file 'lib/lp/testing/tests/test_factory.py' | |||
1144 | --- lib/lp/testing/tests/test_factory.py 2013-06-20 05:50:00 +0000 | |||
1145 | +++ lib/lp/testing/tests/test_factory.py 2016-02-05 16:55:09 +0000 | |||
1146 | @@ -1,4 +1,4 @@ | |||
1148 | 1 | # Copyright 2010-2013 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2010-2016 Canonical Ltd. This software is licensed under the |
1149 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1150 | 3 | 3 | ||
1151 | 4 | """Tests for the Launchpad object factory.""" | 4 | """Tests for the Launchpad object factory.""" |
1152 | @@ -326,7 +326,7 @@ | |||
1153 | 326 | self.assertEqual(110, bpr.installedsize) | 326 | self.assertEqual(110, bpr.installedsize) |
1154 | 327 | 327 | ||
1155 | 328 | def test_makeBinaryPackageName_uses_date_created(self): | 328 | def test_makeBinaryPackageName_uses_date_created(self): |
1157 | 329 | date_created = datetime(2000, 01, 01, tzinfo=pytz.UTC) | 329 | date_created = datetime(2000, 1, 1, tzinfo=pytz.UTC) |
1158 | 330 | bpr = self.factory.makeBinaryPackageRelease( | 330 | bpr = self.factory.makeBinaryPackageRelease( |
1159 | 331 | date_created=date_created) | 331 | date_created=date_created) |
1160 | 332 | self.assertEqual(date_created, bpr.datecreated) | 332 | self.assertEqual(date_created, bpr.datecreated) |
1161 | 333 | 333 | ||
1162 | === modified file 'lib/lp/translations/browser/tests/test_translationmessage_view.py' | |||
1163 | --- lib/lp/translations/browser/tests/test_translationmessage_view.py 2014-06-10 11:25:51 +0000 | |||
1164 | +++ lib/lp/translations/browser/tests/test_translationmessage_view.py 2016-02-05 16:55:09 +0000 | |||
1165 | @@ -1,4 +1,4 @@ | |||
1167 | 1 | # Copyright 2009-2014 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2009-2016 Canonical Ltd. This software is licensed under the |
1168 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
1169 | 3 | 3 | ||
1170 | 4 | from __future__ import with_statement | 4 | from __future__ import with_statement |
1171 | @@ -329,7 +329,7 @@ | |||
1172 | 329 | view = self._makeView() | 329 | view = self._makeView() |
1173 | 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' |
1174 | 331 | self.assertEqual( | 331 | self.assertEqual( |
1176 | 332 | datetime(2010, 01, 01, tzinfo=pytz.utc), | 332 | datetime(2010, 1, 1, tzinfo=pytz.utc), |
1177 | 333 | view._extractLockTimestamp()) | 333 | view._extractLockTimestamp()) |
1178 | 334 | 334 | ||
1179 | 335 | def test_extractLockTimestamp_returns_None_by_default(self): | 335 | def test_extractLockTimestamp_returns_None_by_default(self): |
1180 | 336 | 336 | ||
1181 | === modified file 'lib/lp/translations/doc/poexport-language-pack.txt' | |||
1182 | --- lib/lp/translations/doc/poexport-language-pack.txt 2015-01-16 16:44:27 +0000 | |||
1183 | +++ lib/lp/translations/doc/poexport-language-pack.txt 2016-02-05 16:55:09 +0000 | |||
1184 | @@ -91,8 +91,8 @@ | |||
1185 | 91 | Directory permissions allow correct use of those directories: | 91 | Directory permissions allow correct use of those directories: |
1186 | 92 | 92 | ||
1187 | 93 | >>> directory = tarfile.getmember('rosetta-hoary') | 93 | >>> directory = tarfile.getmember('rosetta-hoary') |
1190 | 94 | >>> oct(directory.mode) | 94 | >>> '0o%o' % directory.mode |
1191 | 95 | '0755' | 95 | '0o755' |
1192 | 96 | 96 | ||
1193 | 97 | And one of the included .po files look like what we expected. | 97 | And one of the included .po files look like what we expected. |
1194 | 98 | 98 |