Merge lp:~cjwatson/launchpad/deprecated-assert-methods-2 into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18529
Proposed branch: lp:~cjwatson/launchpad/deprecated-assert-methods-2
Merge into: lp:launchpad
Diff against target: 9487 lines (+1327/-1359)
157 files modified
lib/lp/answers/browser/tests/test_breadcrumbs.py (+8/-8)
lib/lp/answers/tests/test_publisher.py (+1/-1)
lib/lp/answers/tests/test_question_notifications.py (+1/-1)
lib/lp/answers/tests/test_question_workflow.py (+26/-27)
lib/lp/app/browser/tests/test_inlineeditpickerwidget.py (+3/-3)
lib/lp/app/browser/tests/test_launchpad.py (+2/-2)
lib/lp/app/browser/tests/test_launchpadroot.py (+1/-1)
lib/lp/app/tests/test_tales.py (+1/-1)
lib/lp/archivepublisher/tests/test_debversion.py (+8/-8)
lib/lp/archivepublisher/tests/test_htaccess.py (+1/-1)
lib/lp/archiveuploader/tests/test_changesfile.py (+17/-17)
lib/lp/archiveuploader/tests/test_dscfile.py (+4/-4)
lib/lp/archiveuploader/tests/test_nascentupload.py (+1/-1)
lib/lp/archiveuploader/tests/test_nascentuploadfile.py (+30/-30)
lib/lp/archiveuploader/tests/test_ppauploadprocessor.py (+1/-1)
lib/lp/archiveuploader/tests/test_recipeuploads.py (+1/-1)
lib/lp/archiveuploader/tests/test_uploadpolicy.py (+3/-3)
lib/lp/archiveuploader/tests/test_uploadprocessor.py (+17/-18)
lib/lp/archiveuploader/tests/test_utils.py (+50/-50)
lib/lp/blueprints/browser/tests/test_breadcrumbs.py (+6/-7)
lib/lp/blueprints/model/tests/test_specification.py (+1/-1)
lib/lp/bugs/adapters/tests/test_bugchange.py (+9/-19)
lib/lp/bugs/browser/tests/test_breadcrumbs.py (+10/-10)
lib/lp/bugs/browser/tests/test_bug_views.py (+1/-1)
lib/lp/bugs/browser/tests/test_bugnomination.py (+1/-1)
lib/lp/bugs/browser/tests/test_bugtask.py (+2/-2)
lib/lp/bugs/browser/tests/test_expose.py (+1/-1)
lib/lp/bugs/mail/tests/test_handler.py (+3/-3)
lib/lp/bugs/model/tests/test_bugtask.py (+4/-4)
lib/lp/bugs/scripts/checkwatches/tests/test_core.py (+2/-2)
lib/lp/bugs/scripts/tests/test_bugnotification.py (+22/-22)
lib/lp/buildmaster/browser/tests/test_processor.py (+2/-2)
lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py (+1/-1)
lib/lp/buildmaster/tests/test_processor.py (+4/-4)
lib/lp/buildmaster/tests/test_queuedepth.py (+12/-12)
lib/lp/buildmaster/tests/test_webservice.py (+2/-2)
lib/lp/code/browser/tests/test_branch.py (+1/-1)
lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+1/-1)
lib/lp/code/model/tests/test_branch.py (+2/-2)
lib/lp/code/model/tests/test_branchmergeproposal.py (+2/-2)
lib/lp/code/model/tests/test_codeimportjob.py (+4/-4)
lib/lp/code/model/tests/test_recipebuilder.py (+1/-1)
lib/lp/code/model/tests/test_revision.py (+1/-1)
lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+8/-8)
lib/lp/code/tests/test_branch_webservice.py (+2/-2)
lib/lp/code/tests/test_bzr.py (+2/-2)
lib/lp/code/xmlrpc/tests/test_codehosting.py (+1/-1)
lib/lp/codehosting/codeimport/tests/test_worker.py (+17/-17)
lib/lp/codehosting/scanner/tests/test_buglinks.py (+9/-9)
lib/lp/codehosting/scanner/tests/test_bzrsync.py (+6/-6)
lib/lp/codehosting/sshserver/tests/test_session.py (+1/-1)
lib/lp/codehosting/tests/test_safe_open.py (+14/-18)
lib/lp/registry/browser/tests/test_distroseries.py (+5/-5)
lib/lp/registry/browser/tests/test_person.py (+2/-2)
lib/lp/registry/browser/tests/test_person_webservice.py (+1/-1)
lib/lp/registry/tests/test_distribution.py (+10/-10)
lib/lp/registry/tests/test_distributionmirror_prober.py (+19/-19)
lib/lp/registry/tests/test_distroseries.py (+4/-4)
lib/lp/registry/tests/test_distroseriesdifference.py (+2/-2)
lib/lp/registry/tests/test_distroseriesparent.py (+1/-1)
lib/lp/registry/tests/test_initderiveddistroseries.py (+1/-1)
lib/lp/registry/tests/test_milestonetag.py (+2/-2)
lib/lp/registry/tests/test_person.py (+1/-1)
lib/lp/registry/tests/test_person_vocabularies.py (+2/-2)
lib/lp/registry/tests/test_personroles.py (+1/-1)
lib/lp/registry/tests/test_personset.py (+5/-5)
lib/lp/registry/tests/test_pillar.py (+1/-1)
lib/lp/registry/tests/test_prf_filter.py (+10/-10)
lib/lp/registry/tests/test_prf_hose.py (+15/-16)
lib/lp/registry/tests/test_prf_log.py (+4/-4)
lib/lp/registry/tests/test_prf_walker.py (+38/-38)
lib/lp/registry/tests/test_project_milestone.py (+1/-1)
lib/lp/registry/tests/test_teammembership.py (+1/-1)
lib/lp/scripts/tests/test_runlaunchpad.py (+2/-2)
lib/lp/scripts/utilities/js/tests/test_combo.py (+19/-19)
lib/lp/services/config/tests/test_config_lookup.py (+2/-2)
lib/lp/services/database/tests/test_storm.py (+1/-1)
lib/lp/services/features/tests/test_flags.py (+4/-4)
lib/lp/services/features/tests/test_scopes.py (+3/-3)
lib/lp/services/features/tests/test_webapp.py (+3/-3)
lib/lp/services/librarian/tests/test_libraryfilealias.py (+2/-2)
lib/lp/services/librarian/tests/test_smoketest.py (+3/-3)
lib/lp/services/librarianserver/tests/test_gc.py (+11/-11)
lib/lp/services/librarianserver/tests/test_swift.py (+8/-8)
lib/lp/services/mail/tests/test_sendmail.py (+7/-7)
lib/lp/services/oauth/tests/test_oauth.py (+1/-1)
lib/lp/services/oauth/tests/test_tokens.py (+35/-40)
lib/lp/services/openid/tests/test_baseopenidstore.py (+17/-17)
lib/lp/services/profile/tests.py (+16/-16)
lib/lp/services/session/tests/test_session.py (+1/-1)
lib/lp/services/tests/test_utils.py (+4/-4)
lib/lp/services/twistedsupport/tests/test_processmonitor.py (+1/-1)
lib/lp/services/verification/browser/tests/test_logintoken.py (+5/-5)
lib/lp/services/verification/tests/test_token_creation.py (+1/-1)
lib/lp/services/webapp/tests/test_authentication.py (+3/-3)
lib/lp/services/webapp/tests/test_authutility.py (+3/-3)
lib/lp/services/webapp/tests/test_batching.py (+6/-6)
lib/lp/services/webapp/tests/test_breadcrumbs.py (+9/-9)
lib/lp/services/webapp/tests/test_error.py (+6/-7)
lib/lp/services/webapp/tests/test_haproxy.py (+6/-6)
lib/lp/services/webapp/tests/test_login.py (+46/-46)
lib/lp/services/webapp/tests/test_login_account.py (+6/-7)
lib/lp/services/webapp/tests/test_menu.py (+6/-6)
lib/lp/services/webapp/tests/test_pgsession.py (+1/-1)
lib/lp/services/webapp/tests/test_publication.py (+2/-2)
lib/lp/services/webapp/tests/test_servers.py (+23/-22)
lib/lp/services/webapp/tests/test_sighup.py (+2/-2)
lib/lp/services/webservice/tests/test_json.py (+2/-2)
lib/lp/services/worlddata/tests/test_language.py (+4/-4)
lib/lp/soyuz/browser/tests/test_archive_packages.py (+4/-4)
lib/lp/soyuz/browser/tests/test_breadcrumbs.py (+8/-8)
lib/lp/soyuz/browser/tests/test_build_views.py (+30/-30)
lib/lp/soyuz/browser/tests/test_queue.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_initialize_distroseries.py (+3/-3)
lib/lp/soyuz/scripts/tests/test_ppakeygenerator.py (+2/-2)
lib/lp/soyuz/scripts/tests/test_ppareport.py (+14/-14)
lib/lp/soyuz/tests/test_binarypackagerelease.py (+4/-4)
lib/lp/soyuz/tests/test_build.py (+40/-40)
lib/lp/soyuz/tests/test_build_depwait.py (+3/-3)
lib/lp/soyuz/tests/test_build_privacy.py (+2/-2)
lib/lp/soyuz/tests/test_build_set.py (+16/-16)
lib/lp/soyuz/tests/test_build_start_estimation.py (+3/-3)
lib/lp/soyuz/tests/test_distroseriesdifferencejob.py (+2/-2)
lib/lp/soyuz/tests/test_hasbuildrecords.py (+12/-12)
lib/lp/soyuz/tests/test_packagetranslationsuploadjob.py (+2/-2)
lib/lp/soyuz/tests/test_publishing_models.py (+4/-4)
lib/lp/soyuz/tests/test_sourcepackagerelease.py (+4/-4)
lib/lp/testing/swift/tests/test_fixture.py (+2/-2)
lib/lp/testing/tests/test_factory.py (+17/-18)
lib/lp/testing/tests/test_fixture.py (+2/-2)
lib/lp/testing/tests/test_layers_functional.py (+1/-1)
lib/lp/testing/tests/test_matchers.py (+1/-1)
lib/lp/translations/browser/tests/test_baseexportview.py (+9/-11)
lib/lp/translations/browser/tests/test_distroserieslanguage_views.py (+6/-6)
lib/lp/translations/browser/tests/test_product_view.py (+1/-1)
lib/lp/translations/browser/tests/test_productserieslanguage_views.py (+12/-12)
lib/lp/translations/scripts/tests/test_migrate_current_flag.py (+3/-3)
lib/lp/translations/scripts/tests/test_translations_to_branch.py (+4/-4)
lib/lp/translations/tests/test_hastranslationtemplates.py (+16/-16)
lib/lp/translations/tests/test_helpers.py (+20/-20)
lib/lp/translations/tests/test_pofile.py (+121/-122)
lib/lp/translations/tests/test_potemplate.py (+2/-2)
lib/lp/translations/tests/test_potmsgset.py (+46/-46)
lib/lp/translations/tests/test_productserieslanguage.py (+11/-13)
lib/lp/translations/tests/test_publisher.py (+1/-1)
lib/lp/translations/tests/test_setcurrenttranslation.py (+57/-57)
lib/lp/translations/tests/test_shared_potemplate.py (+20/-20)
lib/lp/translations/tests/test_suggestions.py (+17/-17)
lib/lp/translations/tests/test_translationimportqueue.py (+11/-11)
lib/lp/translations/tests/test_translationmessage.py (+2/-2)
lib/lp/translations/tests/test_translationtemplatesbuild.py (+1/-1)
lib/lp/translations/utilities/tests/test_export_file_storage.py (+3/-3)
lib/lp/translations/utilities/tests/test_xpi_dtd_format.py (+2/-3)
lib/lp/translations/utilities/tests/test_xpi_import.py (+35/-35)
lib/lp/translations/utilities/tests/test_xpi_po_exporter.py (+1/-1)
lib/lp/translations/utilities/tests/test_xpi_properties_format.py (+14/-15)
lib/lp/translations/utilities/tests/test_xpi_search.py (+6/-6)
To merge this branch: bzr merge lp:~cjwatson/launchpad/deprecated-assert-methods-2
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+335630@code.launchpad.net

Commit message

Use modern equivalents of various deprecated TestCase.assert* methods.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This is even longer and less interesting than the previous one (it's mostly mechanical assertEquals → assertEqual).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py'
2--- lib/lp/answers/browser/tests/test_breadcrumbs.py 2017-10-25 10:02:12 +0000
3+++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
4@@ -37,21 +37,21 @@
5 crumbs = self.getBreadcrumbsForObject(
6 self.product, rootsite='answers')
7 last_crumb = crumbs[-1]
8- self.assertEquals(last_crumb.url, self.product_questions_url)
9- self.assertEquals(last_crumb.text, 'Questions')
10+ self.assertEqual(last_crumb.url, self.product_questions_url)
11+ self.assertEqual(last_crumb.text, 'Questions')
12
13 def test_project(self):
14 crumbs = self.getBreadcrumbsForObject(
15 self.project, rootsite='answers')
16 last_crumb = crumbs[-1]
17- self.assertEquals(last_crumb.url, self.project_questions_url)
18- self.assertEquals(last_crumb.text, 'Questions')
19+ self.assertEqual(last_crumb.url, self.project_questions_url)
20+ self.assertEqual(last_crumb.text, 'Questions')
21
22 def test_person(self):
23 crumbs = self.getBreadcrumbsForObject(self.person, rootsite='answers')
24 last_crumb = crumbs[-1]
25- self.assertEquals(last_crumb.url, self.person_questions_url)
26- self.assertEquals(last_crumb.text, 'Questions')
27+ self.assertEqual(last_crumb.url, self.person_questions_url)
28+ self.assertEqual(last_crumb.text, 'Questions')
29
30
31 class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):
32@@ -68,11 +68,11 @@
33 self.question_url = canonical_url(self.question, rootsite='answers')
34 crumbs = self.getBreadcrumbsForObject(self.question)
35 last_crumb = crumbs[-1]
36- self.assertEquals(last_crumb.text, 'Question #%d' % self.question.id)
37+ self.assertEqual(last_crumb.text, 'Question #%d' % self.question.id)
38
39 def test_faq(self):
40 self.faq = self.factory.makeFAQ(target=self.product, title='Seedless')
41 self.faq_url = canonical_url(self.faq, rootsite='answers')
42 crumbs = self.getBreadcrumbsForObject(self.faq)
43 last_crumb = crumbs[-1]
44- self.assertEquals(last_crumb.text, 'FAQ #%d' % self.faq.id)
45+ self.assertEqual(last_crumb.text, 'FAQ #%d' % self.faq.id)
46
47=== modified file 'lib/lp/answers/tests/test_publisher.py'
48--- lib/lp/answers/tests/test_publisher.py 2017-10-25 10:02:12 +0000
49+++ lib/lp/answers/tests/test_publisher.py 2018-01-02 16:24:23 +0000
50@@ -47,6 +47,6 @@
51 # Responses to requests to answers pages have the 'Vary' header set to
52 # include Accept-Language.
53 request = AnswersBrowserRequest(io.StringIO(''), {})
54- self.assertEquals(
55+ self.assertEqual(
56 request.response.getHeader('Vary'),
57 'Cookie, Authorization, Accept-Language')
58
59=== modified file 'lib/lp/answers/tests/test_question_notifications.py'
60--- lib/lp/answers/tests/test_question_notifications.py 2017-10-25 10:02:12 +0000
61+++ lib/lp/answers/tests/test_question_notifications.py 2018-01-02 16:24:23 +0000
62@@ -102,7 +102,7 @@
63
64 def test_getSubject(self):
65 """getSubject() when there is no message added to the question."""
66- self.assertEquals(
67+ self.assertEqual(
68 'Re: [Question #1]: Question title',
69 self.notification.getSubject())
70
71
72=== modified file 'lib/lp/answers/tests/test_question_workflow.py'
73--- lib/lp/answers/tests/test_question_workflow.py 2018-01-02 10:54:31 +0000
74+++ lib/lp/answers/tests/test_question_workflow.py 2018-01-02 16:24:23 +0000
75@@ -242,19 +242,18 @@
76 """
77 self.assertTrue(verifyObject(IQuestionMessage, message))
78
79- self.assertEquals("Re: Help!", message.subject)
80- self.assertEquals(expected_owner, message.owner)
81- self.assertEquals(expected_action, message.action)
82- self.assertEquals(expected_status, message.new_status)
83+ self.assertEqual("Re: Help!", message.subject)
84+ self.assertEqual(expected_owner, message.owner)
85+ self.assertEqual(expected_action, message.action)
86+ self.assertEqual(expected_status, message.new_status)
87
88- self.assertEquals(message, self.question.messages[-1])
89- self.assertEquals(expected_status, self.question.status)
90+ self.assertEqual(message, self.question.messages[-1])
91+ self.assertEqual(expected_status, self.question.status)
92
93 if expected_owner == self.question.owner:
94- self.assertEquals(message.datecreated,
95- self.question.datelastquery)
96+ self.assertEqual(message.datecreated, self.question.datelastquery)
97 else:
98- self.assertEquals(
99+ self.assertEqual(
100 message.datecreated, self.question.datelastresponse)
101
102 def checkTransitionEvents(self, message, edited_fields, status_name):
103@@ -487,9 +486,9 @@
104 """Check additional attributes set when the owner gives the
105 answers.
106 """
107- self.assertEquals(None, self.question.answer)
108- self.assertEquals(self.owner, self.question.answerer)
109- self.assertEquals(message.datecreated, self.question.date_solved)
110+ self.assertIsNone(self.question.answer)
111+ self.assertEqual(self.owner, self.question.answerer)
112+ self.assertEqual(message.datecreated, self.question.date_solved)
113
114 self._testValidTransition(
115 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
116@@ -538,7 +537,7 @@
117 # changes based on departure state.
118 def checkFAQ(message):
119 """Check that the FAQ attribute was set correctly."""
120- self.assertEquals(self.question.faq, self.faq)
121+ self.assertEqual(self.question.faq, self.faq)
122
123 self._testValidTransition(
124 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
125@@ -559,8 +558,8 @@
126 answers.
127 """
128 checkFAQ(message)
129- self.assertEquals(self.owner, self.question.answerer)
130- self.assertEquals(message.datecreated, self.question.date_solved)
131+ self.assertEqual(self.owner, self.question.answerer)
132+ self.assertEqual(message.datecreated, self.question.date_solved)
133
134 self._testValidTransition(
135 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
136@@ -642,9 +641,9 @@
137
138 def checkAnswerMessage(message):
139 # Check the attributes that are set when an answer is confirmed.
140- self.assertEquals(answer_message, self.question.answer)
141- self.assertEquals(self.answerer, self.question.answerer)
142- self.assertEquals(message.datecreated, self.question.date_solved)
143+ self.assertEqual(answer_message, self.question.answer)
144+ self.assertEqual(self.answerer, self.question.answerer)
145+ self.assertEqual(message.datecreated, self.question.date_solved)
146
147 self._testValidTransition(
148 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
149@@ -672,13 +671,13 @@
150 self.question.giveAnswer(
151 self.owner, 'I solved my own problem.',
152 datecreated=self.nowPlus(2))
153- self.assertEquals(self.question.status, QuestionStatus.SOLVED)
154+ self.assertEqual(self.question.status, QuestionStatus.SOLVED)
155
156 def checkAnswerMessage(message):
157 # Check the attributes that are set when an answer is confirmed.
158- self.assertEquals(answer_message, self.question.answer)
159- self.assertEquals(self.answerer, self.question.answerer)
160- self.assertEquals(message.datecreated, self.question.date_solved)
161+ self.assertEqual(answer_message, self.question.answer)
162+ self.assertEqual(self.answerer, self.question.answerer)
163+ self.assertEqual(message.datecreated, self.question.date_solved)
164
165 self._testValidTransition(
166 [QuestionStatus.SOLVED],
167@@ -765,7 +764,7 @@
168 self.question.giveAnswer(
169 self.owner, 'I solved my own problem.',
170 datecreated=self.nowPlus(0))
171- self.assertEquals(self.question.status, QuestionStatus.SOLVED)
172+ self.assertEqual(self.question.status, QuestionStatus.SOLVED)
173
174 # Clear previous events.
175 self.collected_events = []
176@@ -793,7 +792,7 @@
177 self.answerer, 'Press the any key.', datecreated=self.nowPlus(0))
178 self.question.confirmAnswer("That answer worked!.",
179 answer=answer_message, datecreated=self.nowPlus(1))
180- self.assertEquals(self.question.status, QuestionStatus.SOLVED)
181+ self.assertEqual(self.question.status, QuestionStatus.SOLVED)
182
183 # Clear previous events.
184 self.collected_events = []
185@@ -890,9 +889,9 @@
186 def checkRejectMessageIsAnAnswer(message):
187 # Check that the rejection message was considered answering
188 # the question.
189- self.assertEquals(message, self.question.answer)
190- self.assertEquals(self.answerer, self.question.answerer)
191- self.assertEquals(message.datecreated, self.question.date_solved)
192+ self.assertEqual(message, self.question.answer)
193+ self.assertEqual(self.answerer, self.question.answerer)
194+ self.assertEqual(message.datecreated, self.question.date_solved)
195
196 self._testValidTransition(
197 valid_statuses,
198
199=== modified file 'lib/lp/app/browser/tests/test_inlineeditpickerwidget.py'
200--- lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2015-07-08 16:05:11 +0000
201+++ lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2018-01-02 16:24:23 +0000
202@@ -42,7 +42,7 @@
203 # Make sure that when given a vocabulary which supports vocab filters,
204 # the vocab filters are include in the widget config.
205 widget = self.getWidget(vocabulary='ValidPersonOrTeam')
206- self.assertEquals([
207+ self.assertEqual([
208 {'name': 'ALL',
209 'title': 'All',
210 'description': 'Display all search results'},
211@@ -87,13 +87,13 @@
212 # The widget has the correct meta value for a person value.
213 widget_value = self.factory.makePerson()
214 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')
215- self.assertEquals('person', widget.config['selected_value_metadata'])
216+ self.assertEqual('person', widget.config['selected_value_metadata'])
217
218 def test_team_selected_value_meta(self):
219 # The widget has the correct meta value for a team value.
220 widget_value = self.factory.makeTeam()
221 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')
222- self.assertEquals('team', widget.config['selected_value_metadata'])
223+ self.assertEqual('team', widget.config['selected_value_metadata'])
224
225 def test_required_fields_dont_have_a_remove_link(self):
226 widget = self.getWidget(
227
228=== modified file 'lib/lp/app/browser/tests/test_launchpad.py'
229--- lib/lp/app/browser/tests/test_launchpad.py 2016-06-20 22:29:24 +0000
230+++ lib/lp/app/browser/tests/test_launchpad.py 2018-01-02 16:24:23 +0000
231@@ -77,10 +77,10 @@
232
233 notifications = request.notifications
234 if notification is None:
235- self.assertEquals(len(notifications), 0)
236+ self.assertEqual(len(notifications), 0)
237 return
238 self.assertEqual(len(notifications), 1)
239- self.assertEquals(notifications[0].level, level)
240+ self.assertEqual(notifications[0].level, level)
241 self.assertEqual(notification, notifications[0].message)
242
243 def assertDisplaysNotification(
244
245=== modified file 'lib/lp/app/browser/tests/test_launchpadroot.py'
246--- lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 10:54:31 +0000
247+++ lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 16:24:23 +0000
248@@ -84,7 +84,7 @@
249 def test_featured_projects_view_requires_edit(self):
250 view = create_view(self.root, '+featuredprojects')
251 checker = selectChecker(view)
252- self.assertEquals('launchpad.Edit', checker.permission_id('__call__'))
253+ self.assertEqual('launchpad.Edit', checker.permission_id('__call__'))
254
255 def test_featured_projects_manage_link_requires_edit(self):
256 self.setUpRegistryExpert()
257
258=== modified file 'lib/lp/app/tests/test_tales.py'
259--- lib/lp/app/tests/test_tales.py 2018-01-02 10:54:31 +0000
260+++ lib/lp/app/tests/test_tales.py 2018-01-02 16:24:23 +0000
261@@ -395,7 +395,7 @@
262 ircID = ircset.new(person, "<b>irc.canonical.com</b>", "fred")
263 expected_html = test_tales(
264 'nick/fmt:formatted_displayname', nick=ircID)
265- self.assertEquals(
266+ self.assertEqual(
267 u'<strong>fred</strong>\n'
268 '<span class="lesser"> on </span>\n'
269 '<strong>&lt;b&gt;irc.canonical.com&lt;/b&gt;</strong>\n',
270
271=== modified file 'lib/lp/archivepublisher/tests/test_debversion.py'
272--- lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 10:54:31 +0000
273+++ lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 16:24:23 +0000
274@@ -62,15 +62,15 @@
275
276 def testReturnString(self):
277 """Version should convert to a string."""
278- self.assertEquals(str(Version("1.0")), "1.0")
279+ self.assertEqual(str(Version("1.0")), "1.0")
280
281 def testAcceptsInteger(self):
282 """Version should accept an integer."""
283- self.assertEquals(str(Version(1)), "1")
284+ self.assertEqual(str(Version(1)), "1")
285
286 def testAcceptsNumber(self):
287 """Version should accept a number."""
288- self.assertEquals(str(Version(1.2)), "1.2")
289+ self.assertEqual(str(Version(1.2)), "1.2")
290
291 def testNotEmpty(self):
292 """Version should fail with empty input."""
293@@ -107,8 +107,8 @@
294 def testRevisionNotEmpty(self):
295 """Version should not allow an empty revision."""
296 v = Version("1-")
297- self.assertEquals("1-", v.upstream_version)
298- self.assertEquals(None, v.debian_version)
299+ self.assertEqual("1-", v.upstream_version)
300+ self.assertIsNone(v.debian_version)
301
302 def testRevisionInvalid(self):
303 """Version should fail when revision contains a bad character."""
304@@ -118,7 +118,7 @@
305 """Version should give same input as output."""
306 for value in self.VALUES:
307 result = str(Version(value))
308- self.assertEquals(value, result)
309+ self.assertEqual(value, result)
310
311 def testComparisons(self):
312 """Sample Version comparisons should pass."""
313@@ -127,10 +127,10 @@
314
315 def testNullEpochIsZero(self):
316 """Version should treat an omitted epoch as a zero one."""
317- self.assertEquals(Version("1.0"), Version("0:1.0"))
318+ self.assertEqual(Version("1.0"), Version("0:1.0"))
319
320 def notestNullRevisionIsZero(self):
321 """Version should treat an omitted revision as being equal to zero.
322 """
323- self.assertEquals(Version("1.0"), Version("1.0-0"))
324+ self.assertEqual(Version("1.0"), Version("1.0-0"))
325 self.assertTrue(Version("1.0") == Version("1.0-0"))
326
327=== modified file 'lib/lp/archivepublisher/tests/test_htaccess.py'
328--- lib/lp/archivepublisher/tests/test_htaccess.py 2017-10-09 11:33:11 +0000
329+++ lib/lp/archivepublisher/tests/test_htaccess.py 2018-01-02 16:24:23 +0000
330@@ -101,7 +101,7 @@
331 # If there are no ArchiveAuthTokens for an archive just
332 # the buildd secret is returned.
333 self.ppa.buildd_secret = "sekr1t"
334- self.assertEquals(
335+ self.assertEqual(
336 [("buildd", "sekr1t", "bu")],
337 list(htpasswd_credentials_for_archive(self.ppa)))
338
339
340=== modified file 'lib/lp/archiveuploader/tests/test_changesfile.py'
341--- lib/lp/archiveuploader/tests/test_changesfile.py 2017-09-17 10:35:57 +0000
342+++ lib/lp/archiveuploader/tests/test_changesfile.py 2018-01-02 16:24:23 +0000
343@@ -50,25 +50,25 @@
344
345 def testSourceFile(self):
346 # A non-DSC source file is a SourceUploadFile.
347- self.assertEquals(
348+ self.assertEqual(
349 ('foo', SourceUploadFile),
350 determine_file_class_and_name('foo_1.0.diff.gz'))
351
352 def testDSCFile(self):
353 # A DSC is a DSCFile, since they're special.
354- self.assertEquals(
355+ self.assertEqual(
356 ('foo', DSCFile),
357 determine_file_class_and_name('foo_1.0.dsc'))
358
359 def testDEBFile(self):
360 # A binary file is the appropriate PackageUploadFile subclass.
361- self.assertEquals(
362+ self.assertEqual(
363 ('foo', DebBinaryUploadFile),
364 determine_file_class_and_name('foo_1.0_all.deb'))
365- self.assertEquals(
366+ self.assertEqual(
367 ('foo', DdebBinaryUploadFile),
368 determine_file_class_and_name('foo_1.0_all.ddeb'))
369- self.assertEquals(
370+ self.assertEqual(
371 ('foo', UdebBinaryUploadFile),
372 determine_file_class_and_name('foo_1.0_all.udeb'))
373
374@@ -219,43 +219,43 @@
375 # checkFileName() yields an UploadError if the filename is invalid.
376 contents = self.getBaseChanges()
377 changes = self.createChangesFile("mypkg_0.1_i386.changes", contents)
378- self.assertEquals([], list(changes.checkFileName()))
379+ self.assertEqual([], list(changes.checkFileName()))
380 changes = self.createChangesFile("mypkg_0.1.changes", contents)
381 errors = list(changes.checkFileName())
382 self.assertIsInstance(errors[0], UploadError)
383- self.assertEquals(1, len(errors))
384+ self.assertEqual(1, len(errors))
385
386 def test_filename(self):
387 # Filename gets set to the basename of the changes file on disk.
388 changes = self.createChangesFile(
389 "mypkg_0.1_i386.changes", self.getBaseChanges())
390- self.assertEquals("mypkg_0.1_i386.changes", changes.filename)
391+ self.assertEqual("mypkg_0.1_i386.changes", changes.filename)
392
393 def test_suite_name(self):
394 # The suite name gets extracted from the changes file.
395 changes = self.createChangesFile(
396 "mypkg_0.1_i386.changes", self.getBaseChanges())
397- self.assertEquals("nifty", changes.suite_name)
398+ self.assertEqual("nifty", changes.suite_name)
399
400 def test_version(self):
401 # The version gets extracted from the changes file.
402 changes = self.createChangesFile(
403 "mypkg_0.1_i386.changes", self.getBaseChanges())
404- self.assertEquals("0.1", changes.version)
405+ self.assertEqual("0.1", changes.version)
406
407 def test_architectures(self):
408 # The architectures get extracted from the changes file
409 # and parsed correctly.
410 changes = self.createChangesFile(
411 "mypkg_0.1_i386.changes", self.getBaseChanges())
412- self.assertEquals("i386", changes.architecture_line)
413- self.assertEquals(set(["i386"]), changes.architectures)
414+ self.assertEqual("i386", changes.architecture_line)
415+ self.assertEqual(set(["i386"]), changes.architectures)
416
417 def test_source(self):
418 # The source package name gets extracted from the changes file.
419 changes = self.createChangesFile(
420 "mypkg_0.1_i386.changes", self.getBaseChanges())
421- self.assertEquals("mypkg", changes.source)
422+ self.assertEqual("mypkg", changes.source)
423
424 def test_processAddresses(self):
425 # processAddresses parses the changes file and sets the
426@@ -263,9 +263,9 @@
427 contents = self.getBaseChanges()
428 changes = self.createChangesFile(
429 "mypkg_0.1_i386.changes", contents)
430- self.assertEquals(None, changes.changed_by)
431+ self.assertIsNone(changes.changed_by)
432 errors = list(changes.processAddresses())
433- self.assertEquals(0, len(errors), "Errors: %r" % errors)
434+ self.assertEqual(0, len(errors), "Errors: %r" % errors)
435 self.assertThat(
436 changes.changed_by,
437 MatchesDict({
438@@ -280,8 +280,8 @@
439 contents = self.getBaseChanges()
440 changes = self.createChangesFile(
441 "mypkg_0.1_i386.changes", contents)
442- self.assertEquals([], list(changes.processAddresses()))
443- self.assertEquals(
444+ self.assertEqual([], list(changes.processAddresses()))
445+ self.assertEqual(
446 "Something changed\n\n"
447 " -- Somebody <somebody@ubuntu.com> "
448 "Fri, 25 Jun 2010 11:20:22 -0600",
449
450=== modified file 'lib/lp/archiveuploader/tests/test_dscfile.py'
451--- lib/lp/archiveuploader/tests/test_dscfile.py 2016-06-01 01:59:32 +0000
452+++ lib/lp/archiveuploader/tests/test_dscfile.py 2018-01-02 16:24:23 +0000
453@@ -76,7 +76,7 @@
454 file.write(copyright)
455 file.close()
456
457- self.assertEquals(
458+ self.assertEqual(
459 copyright, find_copyright(self.tmpdir, DevNullLogger()))
460
461 def testBadDebianChangelog(self):
462@@ -98,7 +98,7 @@
463 file.write(changelog)
464 file.close()
465
466- self.assertEquals(
467+ self.assertEqual(
468 changelog, find_changelog(self.tmpdir, DevNullLogger()))
469
470 def testOversizedFile(self):
471@@ -252,7 +252,7 @@
472 DEBIAN_TARBALL: 0,
473 }
474 full_files.update(files)
475- self.assertEquals(
476+ self.assertEqual(
477 expected,
478 [str(e) for e in format_to_file_checker_map[self.format](
479 'foo_1.dsc', full_files, components, component_signatures,
480@@ -408,7 +408,7 @@
481 unpacked_dir = unpack_source(
482 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')))
483 try:
484- self.assertEquals(["bar-1.0"], os.listdir(unpacked_dir))
485+ self.assertEqual(["bar-1.0"], os.listdir(unpacked_dir))
486 self.assertContentEqual(
487 ["THIS_IS_BAR", "debian"],
488 os.listdir(os.path.join(unpacked_dir, "bar-1.0")))
489
490=== modified file 'lib/lp/archiveuploader/tests/test_nascentupload.py'
491--- lib/lp/archiveuploader/tests/test_nascentupload.py 2014-06-11 08:29:40 +0000
492+++ lib/lp/archiveuploader/tests/test_nascentupload.py 2018-01-02 16:24:23 +0000
493@@ -52,7 +52,7 @@
494 return file
495
496 def assertMatchDDEBErrors(self, error_list):
497- self.assertEquals(
498+ self.assertEqual(
499 error_list, [str(e) for e in self.upload._matchDDEBs()])
500
501 def testNoLinksWithNoBinaries(self):
502
503=== modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py'
504--- lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2016-11-17 16:46:04 +0000
505+++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2018-01-02 16:24:23 +0000
506@@ -124,7 +124,7 @@
507 # The mime type gets set according to PackageUploadCustomFormat.
508 uploadfile = self.createCustomUploadFile(
509 "bla.txt", "data", "main/raw-installer", "extra")
510- self.assertEquals(
511+ self.assertEqual(
512 PackageUploadCustomFormat.DEBIAN_INSTALLER,
513 uploadfile.custom_type)
514
515@@ -132,10 +132,10 @@
516 # storeInDatabase creates a library file.
517 uploadfile = self.createCustomUploadFile(
518 "bla.txt", "data", "main/raw-installer", "extra")
519- self.assertEquals("application/octet-stream", uploadfile.content_type)
520+ self.assertEqual("application/octet-stream", uploadfile.content_type)
521 libraryfile = uploadfile.storeInDatabase()
522- self.assertEquals("bla.txt", libraryfile.filename)
523- self.assertEquals("application/octet-stream", libraryfile.mimetype)
524+ self.assertEqual("bla.txt", libraryfile.filename)
525+ self.assertEqual("application/octet-stream", libraryfile.mimetype)
526
527 def test_debian_installer_verify(self):
528 # debian-installer uploads are required to have sensible filenames.
529@@ -236,7 +236,7 @@
530 priority_name, package, version, changes):
531 (path, md5, sha1, size) = self.writeUploadFile(filename, dsc.dump())
532 if changes:
533- self.assertEquals([], list(changes.processAddresses()))
534+ self.assertEqual([], list(changes.processAddresses()))
535 return DSCFile(
536 path, dict(MD5=md5), size, component_and_section, priority_name,
537 package, version, changes, self.policy, self.logger)
538@@ -246,7 +246,7 @@
539 dsc = self.getBaseDsc()
540 uploadfile = self.createDSCFile(
541 "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42", None)
542- self.assertEquals(
543+ self.assertEqual(
544 "text/x-debian-source-package", uploadfile.content_type)
545
546 def test_storeInDatabase(self):
547@@ -260,8 +260,8 @@
548 uploadfile.changelog = "DUMMY"
549 uploadfile.files = []
550 release = uploadfile.storeInDatabase(None)
551- self.assertEquals("0.42", release.version)
552- self.assertEquals("dpkg, bzr", release.builddepends)
553+ self.assertEqual("0.42", release.version)
554+ self.assertEqual("dpkg, bzr", release.builddepends)
555
556 def test_storeInDatabase_case_sensitivity(self):
557 # storeInDatabase supports field names with different cases,
558@@ -275,7 +275,7 @@
559 uploadfile.files = []
560 uploadfile.changelog = "DUMMY"
561 release = uploadfile.storeInDatabase(None)
562- self.assertEquals("dpkg, bzr", release.builddepends)
563+ self.assertEqual("dpkg, bzr", release.builddepends)
564
565 def test_user_defined_fields(self):
566 # storeInDatabase updates user_defined_fields.
567@@ -289,7 +289,7 @@
568 uploadfile.files = []
569 release = uploadfile.storeInDatabase(None)
570 # DSCFile lowercases the field names
571- self.assertEquals(
572+ self.assertEqual(
573 [["Python-Version", u"2.5"]], release.user_defined_fields)
574
575 def test_homepage(self):
576@@ -303,7 +303,7 @@
577 uploadfile.changelog = "DUMMY"
578 uploadfile.files = []
579 release = uploadfile.storeInDatabase(None)
580- self.assertEquals(u"http://samba.org/~jelmer/bzr", release.homepage)
581+ self.assertEqual(u"http://samba.org/~jelmer/bzr", release.homepage)
582
583 def test_checkBuild(self):
584 # checkBuild() verifies consistency with a build.
585@@ -320,7 +320,7 @@
586 uploadfile.checkBuild(build)
587 # checkBuild() sets the build status to FULLYBUILT and
588 # removes the upload log.
589- self.assertEquals(BuildStatus.FULLYBUILT, build.status)
590+ self.assertEqual(BuildStatus.FULLYBUILT, build.status)
591 self.assertIs(None, build.upload_log)
592
593 def test_checkBuild_inconsistent(self):
594@@ -399,7 +399,7 @@
595 # Unknown priorities automatically get changed to 'extra'.
596 uploadfile = self.createDebBinaryUploadFile(
597 "foo_0.42_i386.deb", "main/net", "unknown", "mypkg", "0.42", None)
598- self.assertEquals("extra", uploadfile.priority_name)
599+ self.assertEqual("extra", uploadfile.priority_name)
600
601 def test_parseControl(self):
602 # parseControl sets various fields on DebBinaryUploadFile.
603@@ -408,10 +408,10 @@
604 None)
605 control = self.getBaseControl()
606 uploadfile.parseControl(control)
607- self.assertEquals("python", uploadfile.section_name)
608- self.assertEquals("dulwich", uploadfile.source_name)
609- self.assertEquals("0.42", uploadfile.source_version)
610- self.assertEquals("0.42", uploadfile.control_version)
611+ self.assertEqual("python", uploadfile.section_name)
612+ self.assertEqual("dulwich", uploadfile.source_name)
613+ self.assertEqual("0.42", uploadfile.source_version)
614+ self.assertEqual("0.42", uploadfile.control_version)
615
616 def test_verifyFormat_control_xz(self):
617 # verifyFormat accepts .debs with an xz-compressed control member.
618@@ -452,15 +452,15 @@
619 uploadfile.parseControl(control)
620 build = self.factory.makeBinaryPackageBuild()
621 bpr = uploadfile.storeInDatabase(build)
622- self.assertEquals(u'python (<< 2.7), python (>= 2.5)', bpr.depends)
623- self.assertEquals(
624+ self.assertEqual(u'python (<< 2.7), python (>= 2.5)', bpr.depends)
625+ self.assertEqual(
626 u"Dulwich is a Python implementation of the file formats "
627 u"and protocols", bpr.description)
628- self.assertEquals(False, bpr.essential)
629- self.assertEquals(524, bpr.installedsize)
630- self.assertEquals(True, bpr.architecturespecific)
631- self.assertEquals(u"", bpr.recommends)
632- self.assertEquals("0.42", bpr.version)
633+ self.assertEqual(False, bpr.essential)
634+ self.assertEqual(524, bpr.installedsize)
635+ self.assertEqual(True, bpr.architecturespecific)
636+ self.assertEqual(u"", bpr.recommends)
637+ self.assertEqual("0.42", bpr.version)
638
639 def test_user_defined_fields(self):
640 # storeInDatabase stores user defined fields.
641@@ -472,7 +472,7 @@
642 uploadfile.parseControl(control)
643 build = self.factory.makeBinaryPackageBuild()
644 bpr = uploadfile.storeInDatabase(build)
645- self.assertEquals(
646+ self.assertEqual(
647 [[u"Python-Version", u"2.5"]], bpr.user_defined_fields)
648
649 def test_user_defined_fields_newlines(self):
650@@ -485,7 +485,7 @@
651 uploadfile.parseControl(control)
652 build = self.factory.makeBinaryPackageBuild()
653 bpr = uploadfile.storeInDatabase(build)
654- self.assertEquals(
655+ self.assertEqual(
656 [
657 [u"RandomData", u"Foo\nbar\nbla\n"],
658 ], bpr.user_defined_fields)
659@@ -500,7 +500,7 @@
660 uploadfile.parseControl(control)
661 build = self.factory.makeBinaryPackageBuild()
662 bpr = uploadfile.storeInDatabase(build)
663- self.assertEquals(
664+ self.assertEqual(
665 u"http://samba.org/~jelmer/dulwich", bpr.homepage)
666
667 def test_checkBuild(self):
668@@ -516,7 +516,7 @@
669 uploadfile.checkBuild(build)
670 # checkBuild() sets the build status to FULLYBUILT and
671 # removes the upload log.
672- self.assertEquals(BuildStatus.FULLYBUILT, build.status)
673+ self.assertEqual(BuildStatus.FULLYBUILT, build.status)
674 self.assertIs(None, build.upload_log)
675
676 def test_checkBuild_inconsistent(self):
677@@ -549,7 +549,7 @@
678 control = self.getBaseControl()
679 control["Source"] = "foo"
680 uploadfile.parseControl(control)
681- self.assertEquals(
682+ self.assertEqual(
683 spph.sourcepackagerelease, uploadfile.findSourcePackageRelease())
684
685 def test_findSourcePackageRelease_no_spph(self):
686@@ -594,5 +594,5 @@
687 control = self.getBaseControl()
688 control["Source"] = "foo"
689 uploadfile.parseControl(control)
690- self.assertEquals(
691+ self.assertEqual(
692 spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease())
693
694=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
695--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2016-07-02 07:55:26 +0000
696+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2018-01-02 16:24:23 +0000
697@@ -1146,7 +1146,7 @@
698 # primary archive.
699 upload_dir = self.queueUpload(
700 "bar_1.0-2_3.0-quilt_without_orig", "~name16/ubuntu")
701- self.assertEquals(
702+ self.assertEqual(
703 self.processUpload(self.uploadprocessor, upload_dir),
704 ['accepted'])
705
706
707=== modified file 'lib/lp/archiveuploader/tests/test_recipeuploads.py'
708--- lib/lp/archiveuploader/tests/test_recipeuploads.py 2015-04-20 15:59:52 +0000
709+++ lib/lp/archiveuploader/tests/test_recipeuploads.py 2018-01-02 16:24:23 +0000
710@@ -60,7 +60,7 @@
711 '%d/ubuntu/bar_1.0-1_source.changes' % self.build.archive.id)
712 self.layer.txn.commit()
713
714- self.assertEquals(UploadStatusEnum.ACCEPTED, result,
715+ self.assertEqual(UploadStatusEnum.ACCEPTED, result,
716 "Source upload failed\nGot: %s" % self.log.getLogBuffer())
717
718 self.assertEqual(BuildStatus.FULLYBUILT, self.build.status)
719
720=== modified file 'lib/lp/archiveuploader/tests/test_uploadpolicy.py'
721--- lib/lp/archiveuploader/tests/test_uploadpolicy.py 2017-05-02 23:02:41 +0000
722+++ lib/lp/archiveuploader/tests/test_uploadpolicy.py 2018-01-02 16:24:23 +0000
723@@ -70,7 +70,7 @@
724
725 policy.validateUploadType(upload)
726
727- self.assertEquals([], upload.rejections)
728+ self.assertEqual([], upload.rejections)
729
730 def test_binaryful_accepted(self):
731 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)
732@@ -78,7 +78,7 @@
733
734 policy.validateUploadType(upload)
735
736- self.assertEquals([], upload.rejections)
737+ self.assertEqual([], upload.rejections)
738
739 def test_mixed_accepted(self):
740 policy = make_policy(accepted_type=ArchiveUploadType.MIXED_ONLY)
741@@ -86,7 +86,7 @@
742
743 policy.validateUploadType(upload)
744
745- self.assertEquals([], upload.rejections)
746+ self.assertEqual([], upload.rejections)
747
748 def test_sourceful_not_accepted(self):
749 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)
750
751=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
752--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2017-09-17 10:35:57 +0000
753+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2018-01-02 16:24:23 +0000
754@@ -1778,7 +1778,7 @@
755 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)
756 spph = self.publishPackage("bar", "1.0-1")
757
758- self.assertEquals(
759+ self.assertEqual(
760 sorted((sprf.libraryfile.filename, sprf.filetype)
761 for sprf in spph.sourcepackagerelease.files),
762 [('bar_1.0-1.debian.tar.bz2',
763@@ -1819,11 +1819,11 @@
764
765 # Upload another source sharing the same (component) orig.
766 upload_dir = self.queueUpload("bar_1.0-2_3.0-quilt_without_orig")
767- self.assertEquals(
768+ self.assertEqual(
769 self.processUpload(uploadprocessor, upload_dir), ['accepted'])
770
771 queue_item = uploadprocessor.last_processed_upload.queue_root
772- self.assertEquals(
773+ self.assertEqual(
774 sorted((sprf.libraryfile.filename, sprf.filetype) for sprf
775 in queue_item.sources[0].sourcepackagerelease.files),
776 [('bar_1.0-2.debian.tar.bz2',
777@@ -1859,7 +1859,7 @@
778 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)
779 spph = self.publishPackage("bar", "1.0")
780
781- self.assertEquals(
782+ self.assertEqual(
783 sorted((sprf.libraryfile.filename, sprf.filetype)
784 for sprf in spph.sourcepackagerelease.files),
785 [('bar_1.0.dsc',
786@@ -2194,10 +2194,9 @@
787 self.options.builds = True
788 BuildUploadHandler(self.uploadprocessor, self.incoming_folder,
789 leaf_name).process()
790- self.assertEquals(1, len(self.oopses))
791- self.assertEquals(
792- BuildStatus.FAILEDTOUPLOAD, build.status)
793- self.assertEquals(builder, build.builder)
794+ self.assertEqual(1, len(self.oopses))
795+ self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
796+ self.assertEqual(builder, build.builder)
797 self.assertIsNot(None, build.duration)
798 log_contents = build.upload_log.read()
799 self.assertTrue('ERROR Exception while processing upload '
800@@ -2254,7 +2253,7 @@
801 build = self.factory.makeSourcePackageRecipeBuild(sourcename=u"bar",
802 distroseries=self.breezy, archive=archive,
803 requester=archive.owner)
804- self.assertEquals(archive.owner, build.requester)
805+ self.assertEqual(archive.owner, build.requester)
806 self.switchToUploader()
807 # Commit so the build cookie has the right ids.
808 self.layer.txn.commit()
809@@ -2279,8 +2278,8 @@
810 # Properly uploaded source packages should result in the
811 # build status changing to FULLYBUILT.
812 build = self.doSuccessRecipeBuild()
813- self.assertEquals(BuildStatus.FULLYBUILT, build.status)
814- self.assertEquals(None, build.builder)
815+ self.assertEqual(BuildStatus.FULLYBUILT, build.status)
816+ self.assertIsNone(build.builder)
817 self.assertIsNot(None, build.duration)
818 # Upon full build the upload log is unset.
819 self.assertIs(None, build.upload_log)
820@@ -2319,8 +2318,8 @@
821
822 def testSourcePackageRecipeBuild_fail(self):
823 build = self.doFailureRecipeBuild()
824- self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status)
825- self.assertEquals(None, build.builder)
826+ self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
827+ self.assertIsNone(build.builder)
828 self.assertIsNot(None, build.duration)
829 self.assertIsNot(None, build.upload_log)
830
831@@ -2366,8 +2365,8 @@
832
833 def testSourcePackageRecipeBuild_deleted_recipe(self):
834 build = self.doDeletedRecipeBuild()
835- self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status)
836- self.assertEquals(None, build.builder)
837+ self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
838+ self.assertIsNone(build.builder)
839 self.assertIsNot(None, build.duration)
840 self.assertIs(None, build.upload_log)
841
842@@ -2437,7 +2436,7 @@
843 # The build status is not changed
844 self.assertTrue(
845 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))
846- self.assertEquals(BuildStatus.BUILDING, build.status)
847+ self.assertEqual(BuildStatus.BUILDING, build.status)
848 self.assertLogContains("Build status is BUILDING. Ignoring.")
849
850 def testBuildWithInvalidStatus(self):
851@@ -2451,7 +2450,7 @@
852 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))
853 self.assertTrue(
854 os.path.exists(os.path.join(self.failed_folder, leaf_name)))
855- self.assertEquals(BuildStatus.NEEDSBUILD, build.status)
856+ self.assertEqual(BuildStatus.NEEDSBUILD, build.status)
857 self.assertLogContains(
858 "Expected build status to be UPLOADING or BUILDING, was "
859 "NEEDSBUILD.")
860@@ -2486,7 +2485,7 @@
861 """Tests for parse_build_upload_leaf_name."""
862
863 def test_valid(self):
864- self.assertEquals(
865+ self.assertEqual(
866 ('PACKAGEBUILD', 60),
867 parse_build_upload_leaf_name("20100812-PACKAGEBUILD-60"))
868
869
870=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
871--- lib/lp/archiveuploader/tests/test_utils.py 2016-06-01 01:59:32 +0000
872+++ lib/lp/archiveuploader/tests/test_utils.py 2018-01-02 16:24:23 +0000
873@@ -30,116 +30,116 @@
874 """lp.archiveuploader.utils.determine_source_file_type should work."""
875
876 # .dsc -> DSC
877- self.assertEquals(
878+ self.assertEqual(
879 determine_source_file_type('foo_1.0-1.dsc'),
880 SourcePackageFileType.DSC)
881
882 # .diff.gz -> DIFF
883- self.assertEquals(
884+ self.assertEqual(
885 determine_source_file_type('foo_1.0-1.diff.gz'),
886 SourcePackageFileType.DIFF)
887
888 # DIFFs can only be gzipped.
889- self.assertEquals(
890+ self.assertEqual(
891 determine_source_file_type('foo_1.0.diff.bz2'), None)
892
893 # Plain original tarballs can be gzipped or bzip2ed.
894- self.assertEquals(
895+ self.assertEqual(
896 determine_source_file_type('foo_1.0.orig.tar.gz'),
897 SourcePackageFileType.ORIG_TARBALL)
898- self.assertEquals(
899+ self.assertEqual(
900 determine_source_file_type('foo_1.0.orig.tar.bz2'),
901 SourcePackageFileType.ORIG_TARBALL)
902- self.assertEquals(
903+ self.assertEqual(
904 determine_source_file_type('foo_1.0.orig.tar.xz'),
905 SourcePackageFileType.ORIG_TARBALL)
906
907 # Component original tarballs too.
908- self.assertEquals(
909+ self.assertEqual(
910 determine_source_file_type('foo_1.0.orig-foo.tar.gz'),
911 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
912- self.assertEquals(
913+ self.assertEqual(
914 determine_source_file_type('foo_1.0.orig-bar.tar.bz2'),
915 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
916- self.assertEquals(
917+ self.assertEqual(
918 determine_source_file_type('foo_1.0.orig-bar.tar.xz'),
919 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
920
921 # And Debian tarballs...
922- self.assertEquals(
923+ self.assertEqual(
924 determine_source_file_type('foo_1.0-1.debian.tar.gz'),
925 SourcePackageFileType.DEBIAN_TARBALL)
926- self.assertEquals(
927+ self.assertEqual(
928 determine_source_file_type('foo_1.0-2.debian.tar.bz2'),
929 SourcePackageFileType.DEBIAN_TARBALL)
930- self.assertEquals(
931+ self.assertEqual(
932 determine_source_file_type('foo_1.0-2.debian.tar.xz'),
933 SourcePackageFileType.DEBIAN_TARBALL)
934
935 # And even native tarballs!
936- self.assertEquals(
937+ self.assertEqual(
938 determine_source_file_type('foo_1.0.tar.gz'),
939 SourcePackageFileType.NATIVE_TARBALL)
940- self.assertEquals(
941+ self.assertEqual(
942 determine_source_file_type('foo_1.0.tar.bz2'),
943 SourcePackageFileType.NATIVE_TARBALL)
944- self.assertEquals(
945+ self.assertEqual(
946 determine_source_file_type('foo_1.0.tar.xz'),
947 SourcePackageFileType.NATIVE_TARBALL)
948
949 # (Component) original tarball signatures are detected for any
950 # supported compression method.
951- self.assertEquals(
952+ self.assertEqual(
953 determine_source_file_type('foo_1.0.orig.tar.gz.asc'),
954 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
955- self.assertEquals(
956+ self.assertEqual(
957 determine_source_file_type('foo_1.0.orig.tar.bz2.asc'),
958 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
959- self.assertEquals(
960+ self.assertEqual(
961 determine_source_file_type('foo_1.0.orig.tar.xz.asc'),
962 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
963- self.assertEquals(
964+ self.assertEqual(
965 determine_source_file_type('foo_1.0.orig-foo.tar.gz.asc'),
966 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
967- self.assertEquals(
968+ self.assertEqual(
969 determine_source_file_type('foo_1.0.orig-bar.tar.bz2.asc'),
970 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
971- self.assertEquals(
972+ self.assertEqual(
973 determine_source_file_type('foo_1.0.orig-bar.tar.xz.asc'),
974 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
975
976- self.assertEquals(None, determine_source_file_type('foo_1.0'))
977- self.assertEquals(None, determine_source_file_type('foo_1.0.blah.gz'))
978+ self.assertIsNone(determine_source_file_type('foo_1.0'))
979+ self.assertIsNone(determine_source_file_type('foo_1.0.blah.gz'))
980
981 def test_determine_binary_file_type(self):
982 """lp.archiveuploader.utils.determine_binary_file_type should work."""
983 # .deb -> DEB
984- self.assertEquals(
985+ self.assertEqual(
986 determine_binary_file_type('foo_1.0-1_all.deb'),
987 BinaryPackageFileType.DEB)
988
989 # .ddeb -> DDEB
990- self.assertEquals(
991+ self.assertEqual(
992 determine_binary_file_type('foo_1.0-1_all.ddeb'),
993 BinaryPackageFileType.DDEB)
994
995 # .udeb -> UDEB
996- self.assertEquals(
997+ self.assertEqual(
998 determine_binary_file_type('foo_1.0-1_all.udeb'),
999 BinaryPackageFileType.UDEB)
1000
1001- self.assertEquals(determine_binary_file_type('foo_1.0'), None)
1002- self.assertEquals(determine_binary_file_type('foo_1.0.notdeb'), None)
1003+ self.assertEqual(determine_binary_file_type('foo_1.0'), None)
1004+ self.assertEqual(determine_binary_file_type('foo_1.0.notdeb'), None)
1005
1006 def testPrefixMultilineString(self):
1007 """lp.archiveuploader.utils.prefix_multi_line_string should work"""
1008 from lp.archiveuploader.utils import prefix_multi_line_string
1009- self.assertEquals("A:foo\nA:bar",
1010- prefix_multi_line_string("foo\nbar", "A:"))
1011- self.assertEquals("A:foo\nA:bar",
1012- prefix_multi_line_string("foo\n\nbar", "A:"))
1013- self.assertEquals("A:foo\nA:\nA:bar",
1014- prefix_multi_line_string("foo\n\nbar", "A:", 1))
1015+ self.assertEqual("A:foo\nA:bar",
1016+ prefix_multi_line_string("foo\nbar", "A:"))
1017+ self.assertEqual("A:foo\nA:bar",
1018+ prefix_multi_line_string("foo\n\nbar", "A:"))
1019+ self.assertEqual("A:foo\nA:\nA:bar",
1020+ prefix_multi_line_string("foo\n\nbar", "A:", 1))
1021
1022 def testExtractComponent(self):
1023 """lp.archiveuploader.utils.extract_component_from_section should work
1024@@ -147,21 +147,21 @@
1025 from lp.archiveuploader.utils import extract_component_from_section
1026
1027 (sect, comp) = extract_component_from_section("libs")
1028- self.assertEquals(sect, "libs")
1029- self.assertEquals(comp, "main")
1030+ self.assertEqual(sect, "libs")
1031+ self.assertEqual(comp, "main")
1032
1033 (sect, comp) = extract_component_from_section("restricted/libs")
1034- self.assertEquals(sect, "libs")
1035- self.assertEquals(comp, "restricted")
1036+ self.assertEqual(sect, "libs")
1037+ self.assertEqual(comp, "restricted")
1038
1039 (sect, comp) = extract_component_from_section("libs", "multiverse")
1040- self.assertEquals(sect, "libs")
1041- self.assertEquals(comp, "multiverse")
1042+ self.assertEqual(sect, "libs")
1043+ self.assertEqual(comp, "multiverse")
1044
1045 (sect, comp) = extract_component_from_section("restricted/libs",
1046 "multiverse")
1047- self.assertEquals(sect, "libs")
1048- self.assertEquals(comp, "restricted")
1049+ self.assertEqual(sect, "libs")
1050+ self.assertEqual(comp, "restricted")
1051
1052 def testParseMaintainerOkay(self):
1053 """lp.archiveuploader.utils.parse_maintainer should parse correctly
1054@@ -224,9 +224,9 @@
1055
1056 for case in cases:
1057 (name, email) = parse_maintainer_bytes(case[0], 'Maintainer')
1058- self.assertEquals(case[2], name)
1059- self.assertEquals(case[3], email)
1060- self.assertEquals(case[1], rfc822_encode_address(name, email))
1061+ self.assertEqual(case[2], name)
1062+ self.assertEqual(case[3], email)
1063+ self.assertEqual(case[1], rfc822_encode_address(name, email))
1064
1065 def testParseMaintainerRaises(self):
1066 """lp.archiveuploader.utils.parse_maintainer should raise on incorrect
1067@@ -251,7 +251,7 @@
1068 def test_re_isadeb(self):
1069 # Verify that the three binary extensions match the regexp.
1070 for extension in ('deb', 'ddeb', 'udeb'):
1071- self.assertEquals(
1072+ self.assertEqual(
1073 ('foo-bar', '1.0', 'i386', extension),
1074 re_isadeb.match('foo-bar_1.0_i386.%s' % extension).groups())
1075
1076@@ -270,13 +270,13 @@
1077 'orig-foo_bar.tar.gz',
1078 'debian.tar.gz', 'debian.tar.bz2', 'debian.tar.xz')
1079 for extension in extensions:
1080- self.assertEquals(
1081+ self.assertEqual(
1082 ('foo-bar', '1.0', extension),
1083 re_issource.match('foo-bar_1.0.%s' % extension).groups())
1084
1085 # While orig-*.tar.gz is all interpreted as extension, *orig-*.tar.gz
1086 # is taken to have an extension of just 'tar.gz'.
1087- self.assertEquals(
1088+ self.assertEqual(
1089 ('foo-bar', '1.0.porig-bar', 'tar.gz'),
1090 re_issource.match('foo-bar_1.0.porig-bar.tar.gz').groups())
1091
1092@@ -301,7 +301,7 @@
1093 extract_dpkg_source(
1094 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')),
1095 temp_dir)
1096- self.assertEquals(["bar-1.0"], os.listdir(temp_dir))
1097+ self.assertEqual(["bar-1.0"], os.listdir(temp_dir))
1098 self.assertContentEqual(
1099 ["THIS_IS_BAR", "debian"],
1100 os.listdir(os.path.join(temp_dir, "bar-1.0")))
1101@@ -311,4 +311,4 @@
1102 err = self.assertRaises(
1103 DpkgSourceError, extract_dpkg_source,
1104 "thispathdoesntexist", temp_dir)
1105- self.assertEquals(2, err.result)
1106+ self.assertEqual(2, err.result)
1107
1108=== modified file 'lib/lp/blueprints/browser/tests/test_breadcrumbs.py'
1109--- lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2017-10-25 13:10:41 +0000
1110+++ lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
1111@@ -27,15 +27,15 @@
1112 crumbs = self.getBreadcrumbsForObject(
1113 self.product, rootsite='blueprints')
1114 last_crumb = crumbs[-1]
1115- self.assertEquals(last_crumb.url, self.product_specs_url)
1116- self.assertEquals(last_crumb.text, 'Blueprints')
1117+ self.assertEqual(last_crumb.url, self.product_specs_url)
1118+ self.assertEqual(last_crumb.text, 'Blueprints')
1119
1120 def test_person(self):
1121 crumbs = self.getBreadcrumbsForObject(
1122 self.person, rootsite='blueprints')
1123 last_crumb = crumbs[-1]
1124- self.assertEquals(last_crumb.url, self.person_specs_url)
1125- self.assertEquals(last_crumb.text, 'Blueprints')
1126+ self.assertEqual(last_crumb.url, self.person_specs_url)
1127+ self.assertEqual(last_crumb.text, 'Blueprints')
1128
1129
1130 class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase):
1131@@ -53,6 +53,5 @@
1132 def test_specification(self):
1133 crumbs = self.getBreadcrumbsForObject(self.specification)
1134 last_crumb = crumbs[-1]
1135- self.assertEquals(last_crumb.url, self.specification_url)
1136- self.assertEquals(
1137- last_crumb.text, self.specification.title)
1138+ self.assertEqual(last_crumb.url, self.specification_url)
1139+ self.assertEqual(last_crumb.text, self.specification.title)
1140
1141=== modified file 'lib/lp/blueprints/model/tests/test_specification.py'
1142--- lib/lp/blueprints/model/tests/test_specification.py 2017-10-25 13:10:41 +0000
1143+++ lib/lp/blueprints/model/tests/test_specification.py 2018-01-02 16:24:23 +0000
1144@@ -495,7 +495,7 @@
1145 assignee=None, milestone=milestone)
1146
1147 # We start with no work items.
1148- self.assertEquals([], list(spec.work_items))
1149+ self.assertEqual([], list(spec.work_items))
1150
1151 login_person(spec.owner)
1152 spec.updateWorkItems([work_item1_data, work_item2_data])
1153
1154=== modified file 'lib/lp/bugs/adapters/tests/test_bugchange.py'
1155--- lib/lp/bugs/adapters/tests/test_bugchange.py 2012-03-13 00:45:33 +0000
1156+++ lib/lp/bugs/adapters/tests/test_bugchange.py 2018-01-02 16:24:23 +0000
1157@@ -71,8 +71,7 @@
1158
1159 change = list(get_bug_changes(bug_delta))[0]
1160 self.assertTrue(isinstance(change, BugDescriptionChange))
1161- self.assertEquals(
1162- BugNotificationLevel.METADATA, change.change_level)
1163+ self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
1164
1165 def test_change_level_lifecycle_status_closing(self):
1166 # Changing a bug task status from NEW to FIXRELEASED makes this
1167@@ -87,8 +86,7 @@
1168 bugtask_deltas=bugtask_delta)
1169
1170 change = list(get_bug_changes(bug_delta))[0]
1171- self.assertEquals(
1172- BugNotificationLevel.LIFECYCLE, change.change_level)
1173+ self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
1174
1175 def test_change_level_lifecycle_status_reopening(self):
1176 # Changing a bug task status from FIXRELEASED to TRIAGED makes this
1177@@ -103,9 +101,7 @@
1178 bugtask_deltas=bugtask_delta)
1179
1180 change = list(get_bug_changes(bug_delta))[0]
1181- self.assertEquals(
1182- BugNotificationLevel.LIFECYCLE,
1183- change.change_level)
1184+ self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
1185
1186 def test_change_level_metadata_status_worked_on(self):
1187 # Changing a bug task status from TRIAGED to FIXCOMMITTED makes this
1188@@ -120,8 +116,7 @@
1189 bugtask_deltas=bugtask_delta)
1190
1191 change = list(get_bug_changes(bug_delta))[0]
1192- self.assertEquals(
1193- BugNotificationLevel.METADATA, change.change_level)
1194+ self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
1195
1196 def test_change_level_metadata_status_stays_closed(self):
1197 # Changing a bug task status from OPINION to WONTFIX makes this
1198@@ -136,8 +131,7 @@
1199 bugtask_deltas=bugtask_delta)
1200
1201 change = list(get_bug_changes(bug_delta))[0]
1202- self.assertEquals(
1203- BugNotificationLevel.METADATA, change.change_level)
1204+ self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
1205
1206 def test_change_level_metadata_duplicate_of_unresolved(self):
1207 # Marking a bug as a duplicate of an unresolved bug is a
1208@@ -153,8 +147,7 @@
1209 })
1210
1211 change = list(get_bug_changes(bug_delta))[0]
1212- self.assertEquals(
1213- BugNotificationLevel.METADATA, change.change_level)
1214+ self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
1215
1216 def test_change_level_lifecycle_duplicate_of_resolved(self):
1217 # Marking a bug as a duplicate of a resolved bug is
1218@@ -170,8 +163,7 @@
1219 })
1220
1221 change = list(get_bug_changes(bug_delta))[0]
1222- self.assertEquals(
1223- BugNotificationLevel.LIFECYCLE, change.change_level)
1224+ self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
1225
1226 def test_change_level_metadata_not_duplicate_of_unresolved(self):
1227 # Un-marking a bug as a duplicate of an unresolved bug is a
1228@@ -187,8 +179,7 @@
1229 })
1230
1231 change = list(get_bug_changes(bug_delta))[0]
1232- self.assertEquals(
1233- BugNotificationLevel.METADATA, change.change_level)
1234+ self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
1235
1236 def test_change_level_lifecycle_not_duplicate_of_resolved(self):
1237 # Un-marking a bug as a duplicate of a resolved bug is
1238@@ -203,5 +194,4 @@
1239 'old': duplicate_of})
1240
1241 change = list(get_bug_changes(bug_delta))[0]
1242- self.assertEquals(
1243- BugNotificationLevel.LIFECYCLE, change.change_level)
1244+ self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
1245
1246=== modified file 'lib/lp/bugs/browser/tests/test_breadcrumbs.py'
1247--- lib/lp/bugs/browser/tests/test_breadcrumbs.py 2014-02-19 00:35:25 +0000
1248+++ lib/lp/bugs/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
1249@@ -24,17 +24,17 @@
1250 def test_bugtask(self):
1251 crumbs = self.getBreadcrumbsForObject(self.bugtask)
1252 last_crumb = crumbs[-1]
1253- self.assertEquals(self.bugtask_url, last_crumb.url)
1254- self.assertEquals("Bug #%d" % self.bug.id, last_crumb.text)
1255- self.assertEquals(
1256+ self.assertEqual(self.bugtask_url, last_crumb.url)
1257+ self.assertEqual("Bug #%d" % self.bug.id, last_crumb.text)
1258+ self.assertEqual(
1259 u"Bug #%d \u201cborked\u201d" % self.bug.id, last_crumb.detail)
1260
1261 def test_bugtask_child(self):
1262 crumbs = self.getBreadcrumbsForObject(
1263 self.bugtask, view_name='+activity')
1264- self.assertEquals(crumbs[-1].url, "%s/+activity" % self.bugtask_url)
1265- self.assertEquals(crumbs[-2].url, self.bugtask_url)
1266- self.assertEquals(crumbs[-2].text, "Bug #%d" % self.bug.id)
1267+ self.assertEqual(crumbs[-1].url, "%s/+activity" % self.bugtask_url)
1268+ self.assertEqual(crumbs[-2].url, self.bugtask_url)
1269+ self.assertEqual(crumbs[-2].text, "Bug #%d" % self.bug.id)
1270
1271 def test_bugtask_comment(self):
1272 login_person(self.bug.owner)
1273@@ -88,13 +88,13 @@
1274 person_bugs_url = canonical_url(person, rootsite='bugs')
1275 crumbs = self.getBreadcrumbsForObject(person, rootsite='bugs')
1276 last_crumb = crumbs[-1]
1277- self.assertEquals(person_bugs_url, last_crumb.url)
1278- self.assertEquals("Bugs", last_crumb.text)
1279+ self.assertEqual(person_bugs_url, last_crumb.url)
1280+ self.assertEqual("Bugs", last_crumb.text)
1281
1282 def test_bugtarget(self):
1283 project = self.factory.makeProduct(name='fnord')
1284 project_bugs_url = canonical_url(project, rootsite='bugs')
1285 crumbs = self.getBreadcrumbsForObject(project, rootsite='bugs')
1286 last_crumb = crumbs[-1]
1287- self.assertEquals(project_bugs_url, last_crumb.url)
1288- self.assertEquals("Bugs", last_crumb.text)
1289+ self.assertEqual(project_bugs_url, last_crumb.url)
1290+ self.assertEqual("Bugs", last_crumb.text)
1291
1292=== modified file 'lib/lp/bugs/browser/tests/test_bug_views.py'
1293--- lib/lp/bugs/browser/tests/test_bug_views.py 2017-10-21 18:14:14 +0000
1294+++ lib/lp/bugs/browser/tests/test_bug_views.py 2018-01-02 16:24:23 +0000
1295@@ -654,7 +654,7 @@
1296 view = create_initialized_view(
1297 bug.default_bugtask, '+addcomment', form=form)
1298 expected_error = u'Either a comment or attachment must be provided.'
1299- self.assertEquals(view.errors[0], expected_error)
1300+ self.assertEqual(view.errors[0], expected_error)
1301
1302 def test_whitespaces_message_with_attached_file(self):
1303 # If the message only contains whitespaces but a file
1304
1305=== modified file 'lib/lp/bugs/browser/tests/test_bugnomination.py'
1306--- lib/lp/bugs/browser/tests/test_bugnomination.py 2016-10-05 08:44:13 +0000
1307+++ lib/lp/bugs/browser/tests/test_bugnomination.py 2018-01-02 16:24:23 +0000
1308@@ -243,7 +243,7 @@
1309 return view
1310
1311 def assertApproves(self, nomination):
1312- self.assertEquals(
1313+ self.assertEqual(
1314 302,
1315 self.getNominationEditView(
1316 nomination,
1317
1318=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
1319--- lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 10:54:31 +0000
1320+++ lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 16:24:23 +0000
1321@@ -1751,7 +1751,7 @@
1322 self.setAttribute(
1323 task, 'assignee',
1324 self.factory.makePerson(displayname="Foo &<>", name='foo'))
1325- self.assertEquals(
1326+ self.assertEqual(
1327 "nobody &#8594; Foo &amp;&lt;&gt; (foo)",
1328 BugActivityItem(task.bug.activity[-1]).change_details)
1329
1330@@ -1759,7 +1759,7 @@
1331 with celebrity_logged_in('admin'):
1332 bug = self.factory.makeBug(title="foo")
1333 self.setAttribute(bug, 'title', "bar &<>")
1334- self.assertEquals(
1335+ self.assertEqual(
1336 "- foo<br />+ bar &amp;&lt;&gt;",
1337 BugActivityItem(bug.activity[-1]).change_details)
1338
1339
1340=== modified file 'lib/lp/bugs/browser/tests/test_expose.py'
1341--- lib/lp/bugs/browser/tests/test_expose.py 2015-09-09 16:47:34 +0000
1342+++ lib/lp/bugs/browser/tests/test_expose.py 2018-01-02 16:24:23 +0000
1343@@ -249,7 +249,7 @@
1344 expose_user_administered_teams_to_js(self.request, self.user, context,
1345 absoluteURL=fake_absoluteURL)
1346 team_info = self.request.objects['administratedTeams']
1347- self.assertEquals(len(team_info), 0)
1348+ self.assertEqual(len(team_info), 0)
1349
1350 def test_teams_for_distro_with_bug_super(self):
1351 self._setup_teams(self.user)
1352
1353=== modified file 'lib/lp/bugs/mail/tests/test_handler.py'
1354--- lib/lp/bugs/mail/tests/test_handler.py 2016-03-23 17:55:39 +0000
1355+++ lib/lp/bugs/mail/tests/test_handler.py 2018-01-02 16:24:23 +0000
1356@@ -98,7 +98,7 @@
1357 # NB SignedMessage by default isn't actually signed, it just has the
1358 # capability of knowing about signing.
1359 message = self.factory.makeSignedMessage(body=' affects malone\nhi!')
1360- self.assertEquals(message.signature, None)
1361+ self.assertEqual(message.signature, None)
1362
1363 # Pretend that the mail auth has given us a logged-in user.
1364 handler = MaloneHandler()
1365@@ -106,8 +106,8 @@
1366 mail_handled, add_comment_to_bug, commands = \
1367 handler.extractAndAuthenticateCommands(message,
1368 'new@bugs.launchpad.net')
1369- self.assertEquals(mail_handled, None)
1370- self.assertEquals(map(str, commands), [
1371+ self.assertEqual(mail_handled, None)
1372+ self.assertEqual(map(str, commands), [
1373 'bug new',
1374 'affects malone',
1375 ])
1376
1377=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
1378--- lib/lp/bugs/model/tests/test_bugtask.py 2017-05-08 11:38:20 +0000
1379+++ lib/lp/bugs/model/tests/test_bugtask.py 2018-01-02 16:24:23 +0000
1380@@ -729,7 +729,7 @@
1381 names = set(
1382 name for interface in providedBy(delta) for name in interface)
1383 for name in names:
1384- self.assertEquals(getattr(delta, name), expected_delta.get(name))
1385+ self.assertEqual(getattr(delta, name), expected_delta.get(name))
1386
1387 def test_get_bugwatch_delta(self):
1388 # Exercise getDelta() with a change to bugwatch.
1389@@ -1199,8 +1199,8 @@
1390
1391 # Get a debbugs watch.
1392 watch_debbugs_327452 = bugwatchset.get(9)
1393- self.assertEquals(watch_debbugs_327452.bugtracker.name, "debbugs")
1394- self.assertEquals(watch_debbugs_327452.remotebug, "327452")
1395+ self.assertEqual(watch_debbugs_327452.bugtracker.name, "debbugs")
1396+ self.assertEqual(watch_debbugs_327452.remotebug, "327452")
1397
1398 # Associate the watch to a Fix Released task.
1399 debian = getUtility(IDistributionSet).getByName("debian")
1400@@ -2208,7 +2208,7 @@
1401 def test_distribution_to_package_works(self):
1402 distro = self.factory.makeDistribution()
1403 dsp = self.factory.makeDistributionSourcePackage(distribution=distro)
1404- self.assertEquals(dsp.distribution, distro)
1405+ self.assertEqual(dsp.distribution, distro)
1406 self.assertTransitionWorks(distro, dsp)
1407
1408 def test_package_to_package_works(self):
1409
1410=== modified file 'lib/lp/bugs/scripts/checkwatches/tests/test_core.py'
1411--- lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 10:54:31 +0000
1412+++ lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 16:24:23 +0000
1413@@ -244,7 +244,7 @@
1414 transaction.commit()
1415 master._updateBugTracker(bug_tracker)
1416 for bug_watch in bug_watches:
1417- self.assertEquals(
1418+ self.assertEqual(
1419 BugWatchActivityStatus.CONNECTION_ERROR,
1420 bug_watch.last_error_type)
1421 self.assertEqual(
1422@@ -264,7 +264,7 @@
1423 transaction.commit()
1424 master._updateBugTracker(bug_tracker)
1425 for bug_watch in bug_watches:
1426- self.assertEquals(
1427+ self.assertEqual(
1428 BugWatchActivityStatus.UNKNOWN,
1429 bug_watch.last_error_type)
1430 self.assertEqual(
1431
1432=== modified file 'lib/lp/bugs/scripts/tests/test_bugnotification.py'
1433--- lib/lp/bugs/scripts/tests/test_bugnotification.py 2015-08-06 12:09:28 +0000
1434+++ lib/lp/bugs/scripts/tests/test_bugnotification.py 2018-01-02 16:24:23 +0000
1435@@ -439,20 +439,20 @@
1436
1437 def test_with_nothing(self):
1438 # Nothing is generated if an empty list is passed in.
1439- self.assertEquals([], list(notification_comment_batches([])))
1440+ self.assertEqual([], list(notification_comment_batches([])))
1441
1442 def test_with_one_non_comment_notification(self):
1443 # Given a single non-comment notification, a single tuple is
1444 # generated.
1445 notification = FakeNotification(False)
1446- self.assertEquals(
1447+ self.assertEqual(
1448 [(1, notification)],
1449 list(notification_comment_batches([notification])))
1450
1451 def test_with_one_comment_notification(self):
1452 # Given a single comment notification, a single tuple is generated.
1453 notification = FakeNotification(True)
1454- self.assertEquals(
1455+ self.assertEqual(
1456 [(1, notification)],
1457 list(notification_comment_batches([notification])))
1458
1459@@ -462,7 +462,7 @@
1460 notification1 = FakeNotification(True)
1461 notification2 = FakeNotification(False)
1462 notifications = [notification1, notification2]
1463- self.assertEquals(
1464+ self.assertEqual(
1465 [(1, notification1), (1, notification2)],
1466 list(notification_comment_batches(notifications)))
1467
1468@@ -472,7 +472,7 @@
1469 notification1 = FakeNotification(False)
1470 notification2 = FakeNotification(True)
1471 notifications = [notification1, notification2]
1472- self.assertEquals(
1473+ self.assertEqual(
1474 [(1, notification1), (1, notification2)],
1475 list(notification_comment_batches(notifications)))
1476
1477@@ -483,7 +483,7 @@
1478 notification2 = FakeNotification(True)
1479 notification3 = FakeNotification(False)
1480 notifications = [notification1, notification2, notification3]
1481- self.assertEquals(
1482+ self.assertEqual(
1483 [(1, notification1), (1, notification2), (1, notification3)],
1484 list(notification_comment_batches(notifications)))
1485
1486@@ -500,7 +500,7 @@
1487 notification1, notification2,
1488 notification3, notification4,
1489 ]
1490- self.assertEquals(
1491+ self.assertEqual(
1492 [(1, notification1), (1, notification2),
1493 (1, notification3), (2, notification4)],
1494 list(notification_comment_batches(notifications)))
1495@@ -511,20 +511,20 @@
1496
1497 def test_with_nothing(self):
1498 # Nothing is generated if an empty list is passed in.
1499- self.assertEquals([], list(notification_batches([])))
1500+ self.assertEqual([], list(notification_batches([])))
1501
1502 def test_with_one_non_comment_notification(self):
1503 # Given a single non-comment notification, a single batch is
1504 # generated.
1505 notification = FakeNotification(False)
1506- self.assertEquals(
1507+ self.assertEqual(
1508 [[notification]],
1509 list(notification_batches([notification])))
1510
1511 def test_with_one_comment_notification(self):
1512 # Given a single comment notification, a single batch is generated.
1513 notification = FakeNotification(True)
1514- self.assertEquals(
1515+ self.assertEqual(
1516 [[notification]],
1517 list(notification_batches([notification])))
1518
1519@@ -534,7 +534,7 @@
1520 notification1 = FakeNotification(True)
1521 notification2 = FakeNotification(False)
1522 notifications = [notification1, notification2]
1523- self.assertEquals(
1524+ self.assertEqual(
1525 [[notification1, notification2]],
1526 list(notification_batches(notifications)))
1527
1528@@ -544,7 +544,7 @@
1529 notification1 = FakeNotification(False)
1530 notification2 = FakeNotification(True)
1531 notifications = [notification1, notification2]
1532- self.assertEquals(
1533+ self.assertEqual(
1534 [[notification1, notification2]],
1535 list(notification_batches(notifications)))
1536
1537@@ -555,7 +555,7 @@
1538 notification2 = FakeNotification(True)
1539 notification3 = FakeNotification(False)
1540 notifications = [notification1, notification2, notification3]
1541- self.assertEquals(
1542+ self.assertEqual(
1543 [[notification1, notification2, notification3]],
1544 list(notification_batches(notifications)))
1545
1546@@ -571,7 +571,7 @@
1547 notification1, notification2,
1548 notification3, notification4,
1549 ]
1550- self.assertEquals(
1551+ self.assertEqual(
1552 [[notification1, notification2, notification3], [notification4]],
1553 list(notification_batches(notifications)))
1554
1555@@ -579,20 +579,20 @@
1556 # Batches are grouped by bug.
1557 notifications = [FakeNotification(bug=1) for number in range(5)]
1558 observed = list(notification_batches(notifications))
1559- self.assertEquals([notifications], observed)
1560+ self.assertEqual([notifications], observed)
1561
1562 def test_notifications_for_different_bugs(self):
1563 # Batches are grouped by bug.
1564 notifications = [FakeNotification(bug=number) for number in range(5)]
1565 expected = [[notification] for notification in notifications]
1566 observed = list(notification_batches(notifications))
1567- self.assertEquals(expected, observed)
1568+ self.assertEqual(expected, observed)
1569
1570 def test_notifications_for_same_owner(self):
1571 # Batches are grouped by owner.
1572 notifications = [FakeNotification(owner=1) for number in range(5)]
1573 observed = list(notification_batches(notifications))
1574- self.assertEquals([notifications], observed)
1575+ self.assertEqual([notifications], observed)
1576
1577 def test_notifications_for_different_owners(self):
1578 # Batches are grouped by owner.
1579@@ -600,7 +600,7 @@
1580 FakeNotification(owner=number) for number in range(5)]
1581 expected = [[notification] for notification in notifications]
1582 observed = list(notification_batches(notifications))
1583- self.assertEquals(expected, observed)
1584+ self.assertEqual(expected, observed)
1585
1586 def test_notifications_with_mixed_bugs_and_owners(self):
1587 # Batches are grouped by bug and owner.
1588@@ -612,7 +612,7 @@
1589 ]
1590 expected = [[notification] for notification in notifications]
1591 observed = list(notification_batches(notifications))
1592- self.assertEquals(expected, observed)
1593+ self.assertEqual(expected, observed)
1594
1595 def test_notifications_with_mixed_bugs_and_owners_2(self):
1596 # Batches are grouped by bug and owner.
1597@@ -624,7 +624,7 @@
1598 ]
1599 expected = [notifications[0:2], notifications[2:4]]
1600 observed = list(notification_batches(notifications))
1601- self.assertEquals(expected, observed)
1602+ self.assertEqual(expected, observed)
1603
1604 def test_notifications_with_mixed_bugs_owners_and_comments(self):
1605 # Batches are grouped by bug, owner and comments.
1606@@ -636,7 +636,7 @@
1607 ]
1608 expected = [notifications[0:3], notifications[3:4]]
1609 observed = list(notification_batches(notifications))
1610- self.assertEquals(expected, observed)
1611+ self.assertEqual(expected, observed)
1612
1613
1614 class EmailNotificationTestBase(TestCaseWithFactory):
1615@@ -1122,7 +1122,7 @@
1616 self.addFilter(u"Test filter")
1617
1618 the_subscriber = self.subscription.subscriber
1619- self.assertEquals(
1620+ self.assertEqual(
1621 {other_person.preferredemail.email: [u"Someone's filter"],
1622 the_subscriber.preferredemail.email: [u"Test filter"]},
1623 self.getSubscriptionEmailHeaders(by_person=True))
1624
1625=== modified file 'lib/lp/buildmaster/browser/tests/test_processor.py'
1626--- lib/lp/buildmaster/browser/tests/test_processor.py 2015-04-20 11:07:41 +0000
1627+++ lib/lp/buildmaster/browser/tests/test_processor.py 2018-01-02 16:24:23 +0000
1628@@ -16,7 +16,7 @@
1629
1630 def test_processor_url(self):
1631 quantum = self.factory.makeProcessor('quantum')
1632- self.assertEquals(
1633+ self.assertEqual(
1634 '/+processors/quantum',
1635 canonical_url(quantum, force_local_path=True))
1636
1637@@ -24,4 +24,4 @@
1638 quantum = self.factory.makeProcessor('quantum')
1639 obj, view, request = test_traverse(
1640 'http://api.launchpad.dev/devel/+processors/quantum')
1641- self.assertEquals(quantum, obj)
1642+ self.assertEqual(quantum, obj)
1643
1644=== modified file 'lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py'
1645--- lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2016-06-01 15:13:12 +0000
1646+++ lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2018-01-02 16:24:23 +0000
1647@@ -269,7 +269,7 @@
1648 result=True)
1649
1650 def assertResultCount(self, count, result):
1651- self.assertEquals(
1652+ self.assertEqual(
1653 1, len(os.listdir(os.path.join(self.upload_root, result))))
1654
1655 @defer.inlineCallbacks
1656
1657=== modified file 'lib/lp/buildmaster/tests/test_processor.py'
1658--- lib/lp/buildmaster/tests/test_processor.py 2015-04-20 11:07:41 +0000
1659+++ lib/lp/buildmaster/tests/test_processor.py 2018-01-02 16:24:23 +0000
1660@@ -27,7 +27,7 @@
1661 def test_getByName(self):
1662 processor_set = getUtility(IProcessorSet)
1663 q1 = self.factory.makeProcessor(name='q1')
1664- self.assertEquals(q1, processor_set.getByName('q1'))
1665+ self.assertEqual(q1, processor_set.getByName('q1'))
1666
1667 def test_getByName_not_found(self):
1668 processor_set = getUtility(IProcessorSet)
1669@@ -42,7 +42,7 @@
1670 self.factory.makeProcessor(name='q1')
1671 self.factory.makeProcessor(name='i686')
1672 self.factory.makeProcessor(name='g4')
1673- self.assertEquals(
1674+ self.assertEqual(
1675 ['g4', 'i686', 'q1'],
1676 sorted(
1677 processor.name for processor in processor_set.getAll()
1678@@ -68,7 +68,7 @@
1679 processor = self.webservice.named_get(
1680 '/+processors', 'getByName', name='transmeta',
1681 api_version='devel').jsonBody()
1682- self.assertEquals('transmeta', processor['name'])
1683+ self.assertEqual('transmeta', processor['name'])
1684
1685 def test_default_collection(self):
1686 # Make it easy to filter out sample data
1687@@ -82,7 +82,7 @@
1688
1689 collection = self.webservice.get(
1690 '/+processors?ws.size=10', api_version='devel').jsonBody()
1691- self.assertEquals(
1692+ self.assertEqual(
1693 ['g4', 'i686', 'q1'],
1694 sorted(
1695 processor['name'] for processor in collection['entries']
1696
1697=== modified file 'lib/lp/buildmaster/tests/test_queuedepth.py'
1698--- lib/lp/buildmaster/tests/test_queuedepth.py 2015-05-14 08:50:41 +0000
1699+++ lib/lp/buildmaster/tests/test_queuedepth.py 2018-01-02 16:24:23 +0000
1700@@ -75,7 +75,7 @@
1701 time_stamp = job.date_started or datetime.now(utc)
1702 estimate = job.getEstimatedJobStartTime(now=time_stamp)
1703 if delay_in_seconds is None:
1704- test.assertEquals(
1705+ test.assertEqual(
1706 delay_in_seconds, estimate,
1707 "An estimate should not be possible at present but one was "
1708 "returned (%s) nevertheless." % estimate)
1709@@ -509,7 +509,7 @@
1710 builder.builderok = False
1711
1712 # No builders capable of running the job at hand are available now.
1713- self.assertEquals(0, builders_for_job(apg_job))
1714+ self.assertEqual(0, builders_for_job(apg_job))
1715 # The "minimum time to builder" estimation logic is not aware of this
1716 # though.
1717 check_mintime_to_builder(self, apg_job, 0)
1718@@ -526,7 +526,7 @@
1719
1720 # All native builders are disabled now. No builders capable of
1721 # running the job at hand are available.
1722- self.assertEquals(0, builders_for_job(job))
1723+ self.assertEqual(0, builders_for_job(job))
1724 # The "minimum time to builder" estimation logic is not aware of the
1725 # fact that no builders capable of running the job are available.
1726 check_mintime_to_builder(self, job, 0)
1727@@ -678,7 +678,7 @@
1728 builder.builderok = False
1729
1730 # No builders capable of running the job at hand are available now.
1731- self.assertEquals(0, builders_for_job(apg_job))
1732+ self.assertEqual(0, builders_for_job(apg_job))
1733 check_mintime_to_builder(self, apg_job, 0)
1734
1735 # Let's add a processor-independent job to the mix.
1736@@ -687,7 +687,7 @@
1737 sourcename='my-recipe-digikam', score=9999)
1738 # There are still builders available for the processor-independent
1739 # job.
1740- self.assertEquals(6, builders_for_job(job))
1741+ self.assertEqual(6, builders_for_job(job))
1742 # Even free ones.
1743 self.assertTrue(
1744 bq._getFreeBuildersCount(job.processor, job.virtualized) > 0,
1745@@ -702,7 +702,7 @@
1746
1747 # There are no builders capable of running even the processor
1748 # independent jobs now.
1749- self.assertEquals(0, builders_for_job(job))
1750+ self.assertEqual(0, builders_for_job(job))
1751 check_mintime_to_builder(self, job, 0)
1752
1753 # Re-enable the native hppa builders.
1754@@ -840,9 +840,9 @@
1755 check_delay_for_job(self, zsh_job, 0)
1756
1757 # Assign the zsh job to a builder.
1758- self.assertEquals((None, False), bash_job._getHeadJobPlatform())
1759+ self.assertEqual((None, False), bash_job._getHeadJobPlatform())
1760 assign_to_builder(self, 'xx-recipe-zsh', 1, None)
1761- self.assertEquals((1, False), bash_job._getHeadJobPlatform())
1762+ self.assertEqual((1, False), bash_job._getHeadJobPlatform())
1763
1764 # Now that the highest-scored job is out of the way, the estimation
1765 # for the 'bash' recipe build is 222 seconds shorter.
1766@@ -858,7 +858,7 @@
1767 # Also, the platform of the postgres job is returned since it *is*
1768 # the head job now.
1769 pg_platform = (postgres_job.processor.id, postgres_job.virtualized)
1770- self.assertEquals(pg_platform, postgres_job._getHeadJobPlatform())
1771+ self.assertEqual(pg_platform, postgres_job._getHeadJobPlatform())
1772
1773
1774 class TestJobDispatchTimeEstimation(MultiArchBuildsBase):
1775@@ -948,7 +948,7 @@
1776 # processor-independent jobs:
1777 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47 + 9:14)/6 = 831
1778 check_estimate(self, gcc_job, 1671)
1779- self.assertEquals(5, builders_for_job(gcc_job))
1780+ self.assertEqual(5, builders_for_job(gcc_job))
1781
1782 def test_proc_indep_virtual_true(self):
1783 xxr_build, xxr_job = find_job(self, 'xxr-apt-build', None)
1784@@ -1029,8 +1029,8 @@
1785 # processor-independent jobs :
1786 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47)/5 = 887
1787 # waiting time for next builder: = 120
1788- self.assertEquals(2, builders_for_job(vim_job))
1789- self.assertEquals(9, builders_for_job(xxr_job))
1790+ self.assertEqual(2, builders_for_job(vim_job))
1791+ self.assertEqual(9, builders_for_job(xxr_job))
1792 check_estimate(self, vim_job, 2747)
1793
1794 def test_estimation_binary_virtual_headjob(self):
1795
1796=== modified file 'lib/lp/buildmaster/tests/test_webservice.py'
1797--- lib/lp/buildmaster/tests/test_webservice.py 2015-09-29 01:38:34 +0000
1798+++ lib/lp/buildmaster/tests/test_webservice.py 2018-01-02 16:24:23 +0000
1799@@ -79,7 +79,7 @@
1800 logout()
1801 results = self.webservice.named_get(
1802 '/builders', 'getBuildQueueSizes', api_version='devel')
1803- self.assertEquals(
1804+ self.assertEqual(
1805 ['nonvirt', 'virt'], sorted(results.jsonBody().keys()))
1806
1807 def test_getBuildersForQueue(self):
1808@@ -99,7 +99,7 @@
1809 '/builders', 'getBuildersForQueue',
1810 processor=api_url(quantum), virtualized=True,
1811 api_version='devel').jsonBody()
1812- self.assertEquals(
1813+ self.assertEqual(
1814 ['quantum_builder1', 'quantum_builder2'],
1815 sorted(builder['name'] for builder in results['entries']))
1816
1817
1818=== modified file 'lib/lp/code/browser/tests/test_branch.py'
1819--- lib/lp/code/browser/tests/test_branch.py 2017-11-10 11:28:43 +0000
1820+++ lib/lp/code/browser/tests/test_branch.py 2018-01-02 16:24:23 +0000
1821@@ -1046,7 +1046,7 @@
1822 browser.contents,
1823 Contains('Public branches are not allowed for target Commercial.'))
1824 with person_logged_in(owner):
1825- self.assertEquals(initial_target, branch.target.context)
1826+ self.assertEqual(initial_target, branch.target.context)
1827
1828 def test_information_type_in_ui(self):
1829 # The information_type of a branch can be changed via the UI by an
1830
1831=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
1832--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2017-10-21 18:14:14 +0000
1833+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2018-01-02 16:24:23 +0000
1834@@ -443,7 +443,7 @@
1835 self.makeBranchAndPackage(), '+new-recipe', user=self.chef)
1836 # The options for the owner include the Good Chefs team.
1837 options = browser.getControl(name='field.owner.owner').displayOptions
1838- self.assertEquals(
1839+ self.assertEqual(
1840 ['Good Chefs (good-chefs)', 'Master Chef (chef)'],
1841 sorted([str(option) for option in options]))
1842
1843
1844=== modified file 'lib/lp/code/model/tests/test_branch.py'
1845--- lib/lp/code/model/tests/test_branch.py 2017-11-06 09:32:45 +0000
1846+++ lib/lp/code/model/tests/test_branch.py 2018-01-02 16:24:23 +0000
1847@@ -1240,8 +1240,8 @@
1848 branch_id = self.branch.id
1849 branch_set = getUtility(IBranchLookup)
1850 self.branch.destroySelf()
1851- self.assert_(branch_set.get(branch_id) is None,
1852- "The branch has not been deleted.")
1853+ self.assertIsNone(
1854+ branch_set.get(branch_id), "The branch has not been deleted.")
1855
1856 def test_stackedBranchDisablesDeletion(self):
1857 # A branch that is stacked upon cannot be deleted.
1858
1859=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
1860--- lib/lp/code/model/tests/test_branchmergeproposal.py 2017-11-24 17:22:34 +0000
1861+++ lib/lp/code/model/tests/test_branchmergeproposal.py 2018-01-02 16:24:23 +0000
1862@@ -2354,13 +2354,13 @@
1863 self.factory.makeRevisionsForBranch(bmp.source_branch, count=5)
1864 r1 = bmp.source_branch.getBranchRevision(sequence=1)
1865 initial_revisions = list(bmp.getUnlandedSourceBranchRevisions())
1866- self.assertEquals(5, len(initial_revisions))
1867+ self.assertEqual(5, len(initial_revisions))
1868 self.assertIn(r1, initial_revisions)
1869 # If we push one of the revisions into the target, it disappears
1870 # from the unlanded list.
1871 bmp.target_branch.createBranchRevision(1, r1.revision)
1872 partial_revisions = list(bmp.getUnlandedSourceBranchRevisions())
1873- self.assertEquals(4, len(partial_revisions))
1874+ self.assertEqual(4, len(partial_revisions))
1875 self.assertNotIn(r1, partial_revisions)
1876
1877
1878
1879=== modified file 'lib/lp/code/model/tests/test_codeimportjob.py'
1880--- lib/lp/code/model/tests/test_codeimportjob.py 2017-10-04 01:53:48 +0000
1881+++ lib/lp/code/model/tests/test_codeimportjob.py 2018-01-02 16:24:23 +0000
1882@@ -137,7 +137,7 @@
1883 """Assert that the expected job is chosen by getJobForMachine."""
1884 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(
1885 self.machine.hostname, worker_limit=10)
1886- self.assert_(observed_job is not None, "No job was selected.")
1887+ self.assertIsNotNone(observed_job, "No job was selected.")
1888 self.assertEqual(desired_job, observed_job,
1889 "Expected job not selected.")
1890
1891@@ -145,7 +145,7 @@
1892 """Assert that no job is selected."""
1893 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(
1894 'machine', worker_limit=10)
1895- self.assert_(observed_job is None, "Job unexpectedly selected.")
1896+ self.assertIsNone(observed_job, "Job unexpectedly selected.")
1897
1898 def test_nothingSelectedIfNothingCreated(self):
1899 # There are no due jobs pending if we don't create any (this
1900@@ -775,7 +775,7 @@
1901 getUtility(ICodeImportJobWorkflow).finishJob(
1902 running_job, CodeImportResultStatus.SUCCESS, None)
1903 new_job = code_import.import_job
1904- self.assert_(new_job is not None)
1905+ self.assertIsNotNone(new_job)
1906 self.assertEqual(new_job.state, CodeImportJobState.PENDING)
1907 self.assertEqual(new_job.machine, None)
1908 self.assertEqual(
1909@@ -791,7 +791,7 @@
1910 getUtility(ICodeImportJobWorkflow).finishJob(
1911 running_job, CodeImportResultStatus.SUCCESS_PARTIAL, None)
1912 new_job = code_import.import_job
1913- self.assert_(new_job is not None)
1914+ self.assertIsNotNone(new_job)
1915 self.assertEqual(new_job.state, CodeImportJobState.PENDING)
1916 self.assertEqual(new_job.machine, None)
1917 self.assertSqlAttributeEqualsDate(new_job, 'date_due', UTC_NOW)
1918
1919=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
1920--- lib/lp/code/model/tests/test_recipebuilder.py 2017-10-04 01:53:48 +0000
1921+++ lib/lp/code/model/tests/test_recipebuilder.py 2018-01-02 16:24:23 +0000
1922@@ -128,7 +128,7 @@
1923 job.setBuilder(builder, OkSlave())
1924 logger = BufferLogger()
1925 job.verifyBuildRequest(logger)
1926- self.assertEquals("", logger.getLogBuffer())
1927+ self.assertEqual("", logger.getLogBuffer())
1928
1929 def test_verifyBuildRequest_non_virtual(self):
1930 # verifyBuildRequest will raise if a non-virtual builder is proposed.
1931
1932=== modified file 'lib/lp/code/model/tests/test_revision.py'
1933--- lib/lp/code/model/tests/test_revision.py 2017-10-04 01:49:22 +0000
1934+++ lib/lp/code/model/tests/test_revision.py 2018-01-02 16:24:23 +0000
1935@@ -215,7 +215,7 @@
1936 # IRevisionSet.getByRevisionId returns the revision with that id.
1937 revision = self.factory.makeRevision()
1938 found = self.revision_set.getByRevisionId(revision.revision_id)
1939- self.assertEquals(revision, found)
1940+ self.assertEqual(revision, found)
1941
1942 def test_getRevisionById_nonexistent(self):
1943 # IRevisionSet.getByRevisionId returns None if there is no revision
1944
1945=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
1946--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2017-10-04 01:53:48 +0000
1947+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2018-01-02 16:24:23 +0000
1948@@ -356,9 +356,9 @@
1949 date_created=datetime.now(utc) - timedelta(hours=24, seconds=1),
1950 status=BuildStatus.FULLYBUILT)
1951 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
1952- self.assertEquals(1, len(daily_builds))
1953+ self.assertEqual(1, len(daily_builds))
1954 actual_title = [b.title for b in daily_builds]
1955- self.assertEquals([build.title], actual_title)
1956+ self.assertEqual([build.title], actual_title)
1957
1958 def test_makeDailyBuilds_with_an_older_and_newer_build(self):
1959 # If a recipe has been built twice, and the most recent build is
1960@@ -374,7 +374,7 @@
1961 date_created=datetime.now(utc) - timediff,
1962 status=BuildStatus.FULLYBUILT)
1963 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
1964- self.assertEquals([], list(daily_builds))
1965+ self.assertEqual([], list(daily_builds))
1966
1967 def test_makeDailyBuilds_with_new_build_different_archive(self):
1968 # If a recipe has been built into an archive that isn't the
1969@@ -390,7 +390,7 @@
1970 status=BuildStatus.FULLYBUILT)
1971 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
1972 actual_title = [b.title for b in daily_builds]
1973- self.assertEquals([build.title], actual_title)
1974+ self.assertEqual([build.title], actual_title)
1975
1976 def test_makeDailyBuilds_with_disallowed_series(self):
1977 # If a recipe is set to build into a disallowed series,
1978@@ -402,7 +402,7 @@
1979 distroseries = list(recipe.distroseries)[0]
1980 removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE
1981 SourcePackageRecipeBuild.makeDailyBuilds(logger)
1982- self.assertEquals([], self.oopses)
1983+ self.assertEqual([], self.oopses)
1984 self.assertIn(
1985 "DEBUG - cannot build against Warty (4.10).",
1986 logger.getLogBuffer())
1987@@ -452,7 +452,7 @@
1988 def test_getUploader(self):
1989 # For ACL purposes the uploader is the build requester.
1990 build = self.makeSourcePackageRecipeBuild()
1991- self.assertEquals(build.requester,
1992+ self.assertEqual(build.requester,
1993 build.getUploader(None))
1994
1995 def test_getByBuildFarmJob(self):
1996@@ -497,7 +497,7 @@
1997 build.updateStatus(BuildStatus.FULLYBUILT)
1998 IStore(build).flush()
1999 build.notify()
2000- self.assertEquals(0, len(pop_notifications()))
2001+ self.assertEqual(0, len(pop_notifications()))
2002
2003 def test_notify_when_recipe_deleted(self):
2004 """Notify does nothing if recipe has been deleted."""
2005@@ -516,4 +516,4 @@
2006 IStore(build).flush()
2007 build.notify()
2008 notifications = pop_notifications()
2009- self.assertEquals(0, len(notifications))
2010+ self.assertEqual(0, len(notifications))
2011
2012=== modified file 'lib/lp/code/tests/test_branch_webservice.py'
2013--- lib/lp/code/tests/test_branch_webservice.py 2017-10-04 01:53:48 +0000
2014+++ lib/lp/code/tests/test_branch_webservice.py 2018-01-02 16:24:23 +0000
2015@@ -114,7 +114,7 @@
2016 target_branch=target, initial_comment='Merge\nit!',
2017 needs_review=True, commit_message='It was merged!\n',
2018 reviewers=[source.owner.self_link], review_types=[])
2019- self.assertEquals(
2020+ self.assertEqual(
2021 exception.content,
2022 'reviewers and review_types must be equal length.')
2023
2024@@ -148,7 +148,7 @@
2025 BadRequest, source.createMergeProposal,
2026 target_branch=source, initial_comment='Merge\nit!',
2027 needs_review=True, commit_message='It was merged!\n')
2028- self.assertEquals(
2029+ self.assertEqual(
2030 exception.content,
2031 'Source and target branches must be different.')
2032
2033
2034=== modified file 'lib/lp/code/tests/test_bzr.py'
2035--- lib/lp/code/tests/test_bzr.py 2017-10-04 01:49:22 +0000
2036+++ lib/lp/code/tests/test_bzr.py 2018-01-02 16:24:23 +0000
2037@@ -85,7 +85,7 @@
2038
2039 def test_empty(self):
2040 branch = self.make_branch('test')
2041- self.assertEquals([], branch_revision_history(branch))
2042+ self.assertEqual([], branch_revision_history(branch))
2043
2044 def test_some_commits(self):
2045 branch = self.make_branch('test')
2046@@ -93,7 +93,7 @@
2047 tree.commit('acommit', rev_id=b'A')
2048 tree.commit('bcommit', rev_id=b'B')
2049 tree.commit('ccommit', rev_id=b'C')
2050- self.assertEquals(
2051+ self.assertEqual(
2052 [b'A', b'B', b'C'], branch_revision_history(tree.branch))
2053
2054
2055
2056=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
2057--- lib/lp/code/xmlrpc/tests/test_codehosting.py 2016-12-31 05:01:10 +0000
2058+++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2018-01-02 16:24:23 +0000
2059@@ -258,7 +258,7 @@
2060 self.assertUnmirrored(branch)
2061
2062 branch.requestMirror()
2063- self.assertEquals(
2064+ self.assertEqual(
2065 branch.id, self.codehosting_api.acquireBranchToPull([])[0])
2066
2067 failure_message = self.factory.getUniqueString()
2068
2069=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
2070--- lib/lp/codehosting/codeimport/tests/test_worker.py 2017-01-12 18:01:56 +0000
2071+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2018-01-02 16:24:23 +0000
2072@@ -253,7 +253,7 @@
2073 target_url = store._getMirrorURL(self.arbitrary_branch_id)
2074 knit_format = format_registry.get('knit')()
2075 tree = create_branch_with_one_revision(target_url, format=knit_format)
2076- self.assertNotEquals(
2077+ self.assertNotEqual(
2078 tree.bzrdir._format.repository_format.network_name(),
2079 default_format.repository_format.network_name())
2080
2081@@ -261,8 +261,8 @@
2082 new_branch = store.pull(
2083 self.arbitrary_branch_id, self.temp_dir, default_format)
2084 # Make sure backup.bzr is removed, as it interferes with CSCVS.
2085- self.assertEquals(os.listdir(self.temp_dir), [".bzr"])
2086- self.assertEquals(new_branch.repository._format.network_name(),
2087+ self.assertEqual(os.listdir(self.temp_dir), [".bzr"])
2088+ self.assertEqual(new_branch.repository._format.network_name(),
2089 default_format.repository_format.network_name())
2090
2091 def test_pushUpgradesFormat(self):
2092@@ -292,13 +292,13 @@
2093 # Only .bzr is left behind. The scanner removes branches
2094 # in which invalid directories (such as .bzr.retire.
2095 # exist). (bug #798560)
2096- self.assertEquals(
2097+ self.assertEqual(
2098 target_branch.user_transport.list_dir("."),
2099 [".bzr"])
2100 self.assertEqual(
2101 default_format.get_branch_format(),
2102 target_branch._format)
2103- self.assertEquals(
2104+ self.assertEqual(
2105 target_branch.last_revision_info(),
2106 new_branch.last_revision_info())
2107
2108@@ -461,7 +461,7 @@
2109 store = ImportDataStore(transport, source_details)
2110 local_name = '%s.tar.gz' % (self.factory.getUniqueString('tarball'),)
2111 store.fetch(local_name)
2112- self.assertEquals(content, open(local_name).read())
2113+ self.assertEqual(content, open(local_name).read())
2114
2115 def test_fetch_with_dest_transport(self):
2116 # The second, optional, argument to fetch is the transport in which to
2117@@ -478,7 +478,7 @@
2118 self.get_transport(local_prefix).ensure_base()
2119 local_name = '%s.tar.gz' % (self.factory.getUniqueString(),)
2120 store.fetch(local_name, self.get_transport(local_prefix))
2121- self.assertEquals(
2122+ self.assertEqual(
2123 content, open(os.path.join(local_prefix, local_name)).read())
2124
2125 def test_put_copiesFileToTransport(self):
2126@@ -494,7 +494,7 @@
2127 # That the remote name is like this is part of the interface of
2128 # ImportDataStore.
2129 remote_name = '%08x.tar.gz' % (source_details.target_id,)
2130- self.assertEquals(content, transport.get_bytes(remote_name))
2131+ self.assertEqual(content, transport.get_bytes(remote_name))
2132
2133 def test_put_ensures_base(self):
2134 # Put ensures that the directory pointed to by the transport exists.
2135@@ -522,7 +522,7 @@
2136 # That the remote name is like this is part of the interface of
2137 # ImportDataStore.
2138 remote_name = '%08x.tar.gz' % (source_details.target_id,)
2139- self.assertEquals(content, transport.get_bytes(remote_name))
2140+ self.assertEqual(content, transport.get_bytes(remote_name))
2141
2142
2143 class MockForeignWorkingTree:
2144@@ -1110,7 +1110,7 @@
2145 # There should only be one revision there, the other
2146 # one is in the stacked-on repository.
2147 self.addCleanup(stacked_on.lock_read().unlock)
2148- self.assertEquals(
2149+ self.assertEqual(
2150 base_rev_count,
2151 len(stacked_on.repository.revisions.keys()))
2152 worker = self.makeImportWorker(
2153@@ -1120,15 +1120,15 @@
2154 self.assertEqual(
2155 CodeImportWorkerExitCode.SUCCESS, worker.run())
2156 branch = self.getStoredBazaarBranch(worker)
2157- self.assertEquals(
2158+ self.assertEqual(
2159 base_rev_count,
2160 len(stacked_on.repository.revisions.keys()))
2161 # There should only be one revision there, the other
2162 # one is in the stacked-on repository.
2163 self.addCleanup(branch.lock_read().unlock)
2164- self.assertEquals(1,
2165+ self.assertEqual(1,
2166 len(branch.repository.revisions.without_fallbacks().keys()))
2167- self.assertEquals(stacked_on.base, branch.get_stacked_on_url())
2168+ self.assertEqual(stacked_on.base, branch.get_stacked_on_url())
2169
2170
2171 class TestGitImport(WorkerTest, TestActualImportMixin,
2172@@ -1197,7 +1197,7 @@
2173 source_details.url = urlutils.join_segment_parameters(
2174 source_details.url, {"branch": "other"})
2175 source_transport = get_transport_from_url(source_details.url)
2176- self.assertEquals(
2177+ self.assertEqual(
2178 {"branch": "other"},
2179 source_transport.get_segment_parameters())
2180 worker = self.makeImportWorker(source_details,
2181@@ -1207,7 +1207,7 @@
2182 CodeImportWorkerExitCode.SUCCESS, worker.run())
2183 branch = worker.getBazaarBranch()
2184 lastrev = branch.repository.get_revision(branch.last_revision())
2185- self.assertEquals(lastrev.message, "Message for other")
2186+ self.assertEqual(lastrev.message, "Message for other")
2187
2188
2189 class TestBzrSvnImport(WorkerTest, SubversionImportHelpers,
2190@@ -1311,7 +1311,7 @@
2191 self.policy = CodeImportBranchOpenPolicy("bzr", "bzr")
2192
2193 def test_follows_references(self):
2194- self.assertEquals(True, self.policy.shouldFollowReferences())
2195+ self.assertEqual(True, self.policy.shouldFollowReferences())
2196
2197 def assertBadUrl(self, url):
2198 self.assertRaises(BadUrl, self.policy.checkOneURL, url)
2199@@ -1378,7 +1378,7 @@
2200 branch_url = self.bazaar_store._getMirrorURL(
2201 worker.source_details.target_id)
2202 branch = Branch.open(branch_url)
2203- self.assertEquals(self.revid, branch.last_revision())
2204+ self.assertEqual(self.revid, branch.last_revision())
2205
2206 def test_redirect_to_forbidden_url(self):
2207 class NewUrlBlacklistPolicy(BranchOpenPolicy):
2208
2209=== modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py'
2210--- lib/lp/codehosting/scanner/tests/test_buglinks.py 2016-02-04 05:43:46 +0000
2211+++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2018-01-02 16:24:23 +0000
2212@@ -61,7 +61,7 @@
2213 # Parsing a single line should give a dict with a single entry,
2214 # mapping the bug_id to the status.
2215 bugs = self.extractBugInfo("https://launchpad.net/bugs/9999 fixed")
2216- self.assertEquals(bugs, {9999: 'fixed'})
2217+ self.assertEqual(bugs, {9999: 'fixed'})
2218
2219 def test_multiple(self):
2220 # Information about more than one bug can be specified. Make sure that
2221@@ -69,39 +69,39 @@
2222 bugs = self.extractBugInfo(
2223 "https://launchpad.net/bugs/9999 fixed\n"
2224 "https://launchpad.net/bugs/8888 fixed")
2225- self.assertEquals(bugs, {9999: 'fixed',
2226- 8888: 'fixed'})
2227+ self.assertEqual(bugs, {9999: 'fixed',
2228+ 8888: 'fixed'})
2229
2230 def test_empty(self):
2231 # If the property is empty, then return an empty dict.
2232 bugs = self.extractBugInfo('')
2233- self.assertEquals(bugs, {})
2234+ self.assertEqual(bugs, {})
2235
2236 def test_bad_bug(self):
2237 # If the given bug is not a valid integer, then skip it, generate an
2238 # OOPS and continue processing.
2239 bugs = self.extractBugInfo('https://launchpad.net/~jml fixed')
2240- self.assertEquals(bugs, {})
2241+ self.assertEqual(bugs, {})
2242
2243 def test_non_launchpad_bug(self):
2244 # References to bugs on sites other than launchpad are ignored.
2245 bugs = self.extractBugInfo('http://bugs.debian.org/1234 fixed')
2246- self.assertEquals(bugs, {})
2247+ self.assertEqual(bugs, {})
2248
2249 def test_duplicated_line(self):
2250 # If a particular line is duplicated, silently ignore the duplicates.
2251 bugs = self.extractBugInfo(
2252 'https://launchpad.net/bugs/9999 fixed\n'
2253 'https://launchpad.net/bugs/9999 fixed')
2254- self.assertEquals(bugs, {9999: 'fixed'})
2255+ self.assertEqual(bugs, {9999: 'fixed'})
2256
2257 def test_strict_url_checking(self):
2258 # Ignore URLs that look like a Launchpad bug URL but aren't.
2259 bugs = self.extractBugInfo('https://launchpad.net/people/1234 fixed')
2260- self.assertEquals(bugs, {})
2261+ self.assertEqual(bugs, {})
2262 bugs = self.extractBugInfo(
2263 'https://launchpad.net/bugs/foo/1234 fixed')
2264- self.assertEquals(bugs, {})
2265+ self.assertEqual(bugs, {})
2266
2267
2268 class TestBugLinking(BzrSyncTestCase):
2269
2270=== modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py'
2271--- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 10:54:31 +0000
2272+++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 16:24:23 +0000
2273@@ -359,7 +359,7 @@
2274 self.commitRevision(committer=author)
2275 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
2276 db_author = RevisionAuthor.selectOneBy(name=author)
2277- self.assertEquals(db_author.name, author)
2278+ self.assertEqual(db_author.name, author)
2279
2280 def test_new_parent(self):
2281 # Importing two revisions should import a new parent.
2282@@ -371,13 +371,13 @@
2283 def test_sync_updates_branch(self):
2284 # test that the last scanned revision ID is recorded
2285 self.syncAndCount()
2286- self.assertEquals(NULL_REVISION, self.db_branch.last_scanned_id)
2287+ self.assertEqual(NULL_REVISION, self.db_branch.last_scanned_id)
2288 last_modified = self.db_branch.date_last_modified
2289 last_scanned = self.db_branch.last_scanned
2290 self.commitRevision()
2291 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
2292- self.assertEquals(self.bzr_branch.last_revision(),
2293- self.db_branch.last_scanned_id)
2294+ self.assertEqual(self.bzr_branch.last_revision(),
2295+ self.db_branch.last_scanned_id)
2296 self.assertTrue(self.db_branch.last_scanned > last_scanned,
2297 "last_scanned was not updated")
2298 self.assertTrue(self.db_branch.date_last_modified > last_modified,
2299@@ -814,7 +814,7 @@
2300 self.makeBzrSync(self.db_branch).syncBranchAndClose()
2301 # Check that properties were saved to the revision.
2302 bzr_revision = self.bzr_branch.repository.get_revision('rev1')
2303- self.assertEquals(properties, bzr_revision.properties)
2304+ self.assertEqual(properties, bzr_revision.properties)
2305 # Check that properties are stored in the database.
2306 db_revision = getUtility(IRevisionSet).getByRevisionId('rev1')
2307- self.assertEquals(properties, db_revision.getProperties())
2308+ self.assertEqual(properties, db_revision.getProperties())
2309
2310=== modified file 'lib/lp/codehosting/sshserver/tests/test_session.py'
2311--- lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 10:54:31 +0000
2312+++ lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 16:24:23 +0000
2313@@ -435,7 +435,7 @@
2314 self.assertRaises(ForbiddenCommand, lookup_command_template, 'foo')
2315
2316 def test_bzr(self):
2317- self.assertEquals(
2318+ self.assertEqual(
2319 config.root + '/bin/py ' + get_bzr_path() +
2320 ' lp-serve --inet %(user_id)s',
2321 lookup_command_template(
2322
2323=== modified file 'lib/lp/codehosting/tests/test_safe_open.py'
2324--- lib/lp/codehosting/tests/test_safe_open.py 2012-09-06 00:01:38 +0000
2325+++ lib/lp/codehosting/tests/test_safe_open.py 2018-01-02 16:24:23 +0000
2326@@ -79,9 +79,8 @@
2327 # When branch references are forbidden, checkAndFollowBranchReference
2328 # does not raise on non-references.
2329 opener = self.makeBranchOpener(False, ['a', None])
2330- self.assertEquals(
2331- 'a', opener.checkAndFollowBranchReference('a'))
2332- self.assertEquals(['a'], opener.follow_reference_calls)
2333+ self.assertEqual('a', opener.checkAndFollowBranchReference('a'))
2334+ self.assertEqual(['a'], opener.follow_reference_calls)
2335
2336 def testBranchReferenceForbidden(self):
2337 # checkAndFollowBranchReference raises BranchReferenceForbidden if
2338@@ -91,16 +90,15 @@
2339 self.assertRaises(
2340 BranchReferenceForbidden,
2341 opener.checkAndFollowBranchReference, 'a')
2342- self.assertEquals(['a'], opener.follow_reference_calls)
2343+ self.assertEqual(['a'], opener.follow_reference_calls)
2344
2345 def testAllowedReference(self):
2346 # checkAndFollowBranchReference does not raise if following references
2347 # is allowed and the source URL points to a branch reference to a
2348 # permitted location.
2349 opener = self.makeBranchOpener(True, ['a', 'b', None])
2350- self.assertEquals(
2351- 'b', opener.checkAndFollowBranchReference('a'))
2352- self.assertEquals(['a', 'b'], opener.follow_reference_calls)
2353+ self.assertEqual('b', opener.checkAndFollowBranchReference('a'))
2354+ self.assertEqual(['a', 'b'], opener.follow_reference_calls)
2355
2356 def testCheckReferencedURLs(self):
2357 # checkAndFollowBranchReference checks if the URL a reference points
2358@@ -109,7 +107,7 @@
2359 True, ['a', 'b', None], unsafe_urls=set('b'))
2360 self.assertRaises(
2361 BadUrl, opener.checkAndFollowBranchReference, 'a')
2362- self.assertEquals(['a'], opener.follow_reference_calls)
2363+ self.assertEqual(['a'], opener.follow_reference_calls)
2364
2365 def testSelfReferencingBranch(self):
2366 # checkAndFollowBranchReference raises BranchReferenceLoopError if
2367@@ -118,7 +116,7 @@
2368 opener = self.makeBranchOpener(True, ['a', 'a'])
2369 self.assertRaises(
2370 BranchLoopError, opener.checkAndFollowBranchReference, 'a')
2371- self.assertEquals(['a'], opener.follow_reference_calls)
2372+ self.assertEqual(['a'], opener.follow_reference_calls)
2373
2374 def testBranchReferenceLoop(self):
2375 # checkAndFollowBranchReference raises BranchReferenceLoopError if
2376@@ -128,7 +126,7 @@
2377 opener = self.makeBranchOpener(True, references)
2378 self.assertRaises(
2379 BranchLoopError, opener.checkAndFollowBranchReference, 'a')
2380- self.assertEquals(['a', 'b'], opener.follow_reference_calls)
2381+ self.assertEqual(['a', 'b'], opener.follow_reference_calls)
2382
2383
2384 class TrackingProber(BzrProber):
2385@@ -166,7 +164,7 @@
2386 opener = self.makeBranchOpener([b.base], probers=[])
2387 self.assertRaises(NotBranchError, opener.open, b.base)
2388 opener = self.makeBranchOpener([b.base], probers=[BzrProber])
2389- self.assertEquals(b.base, opener.open(b.base).base)
2390+ self.assertEqual(b.base, opener.open(b.base).base)
2391
2392 def testDefaultProbers(self):
2393 # If no probers are specified to the constructor
2394@@ -180,18 +178,18 @@
2395 TrackingProber.seen_urls = []
2396 opener = self.makeBranchOpener(["."], probers=[TrackingProber])
2397 self.assertRaises(NotBranchError, opener.open, ".")
2398- self.assertEquals(1, len(TrackingProber.seen_urls))
2399+ self.assertEqual(1, len(TrackingProber.seen_urls))
2400 TrackingProber.seen_urls = []
2401 # And make sure it's registered in such a way that BzrDir.open would
2402 # use it.
2403 self.assertRaises(NotBranchError, BzrDir.open, ".")
2404- self.assertEquals(1, len(TrackingProber.seen_urls))
2405+ self.assertEqual(1, len(TrackingProber.seen_urls))
2406 TrackingProber.seen_urls = []
2407 # Make sure that SafeBranchOpener doesn't use it if no
2408 # probers were specified
2409 opener = self.makeBranchOpener(["."])
2410 self.assertRaises(NotBranchError, opener.open, ".")
2411- self.assertEquals(0, len(TrackingProber.seen_urls))
2412+ self.assertEqual(0, len(TrackingProber.seen_urls))
2413
2414 def testAllowedURL(self):
2415 # checkSource does not raise an exception for branches stacked on
2416@@ -289,8 +287,7 @@
2417 opener = self.makeBranchOpener(
2418 [a.base, b.base], probers=[TrackingProber])
2419 opener.open(b.base)
2420- self.assertEquals(
2421- set(TrackingProber.seen_urls), set([b.base, a.base]))
2422+ self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base]))
2423
2424 def testCustomOpenerWithBranchReference(self):
2425 # A custom function for opening a control dir can be specified.
2426@@ -301,8 +298,7 @@
2427 opener = self.makeBranchOpener(
2428 [a.base, b.base], probers=[TrackingProber])
2429 opener.open(b.base)
2430- self.assertEquals(
2431- set(TrackingProber.seen_urls), set([b.base, a.base]))
2432+ self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base]))
2433
2434 def test_ignore_fallbacks(self):
2435 """"Cross-format stacking doesn't error with ignore_fallbacks."""
2436
2437=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
2438--- lib/lp/registry/browser/tests/test_distroseries.py 2017-10-21 18:14:14 +0000
2439+++ lib/lp/registry/browser/tests/test_distroseries.py 2018-01-02 16:24:23 +0000
2440@@ -592,7 +592,7 @@
2441 [launchpad]
2442 default_batch_size: 2
2443 """)
2444- self.assert_(
2445+ self.assertTrue(
2446 isinstance(view.milestone_batch_navigator, BatchNavigator),
2447 'milestone_batch_navigator is not a BatchNavigator object: %r'
2448 % view.milestone_batch_navigator)
2449@@ -693,7 +693,7 @@
2450 distroseries = self.factory.makeDistroSeries()
2451 formatted_dict = seriesToVocab(distroseries)
2452
2453- self.assertEquals(
2454+ self.assertEqual(
2455 ['api_uri', 'title', 'value'],
2456 sorted(formatted_dict.keys()))
2457
2458@@ -1477,9 +1477,9 @@
2459 job_source = getUtility(IPlainPackageCopyJobSource)
2460 jobs = list(
2461 job_source.getActiveJobs(series.distribution.main_archive))
2462- self.assertEquals(1, len(jobs))
2463+ self.assertEqual(1, len(jobs))
2464 job = jobs[0]
2465- self.assertEquals(series, job.target_distroseries)
2466+ self.assertEqual(series, job.target_distroseries)
2467 self.assertEqual(dsd.source_package_name.name, job.package_name)
2468 self.assertEqual(dsd.parent_source_version, job.package_version)
2469 self.assertEqual(PackagePublishingPocket.RELEASE, job.target_pocket)
2470@@ -2161,7 +2161,7 @@
2471 derived_series, '+localpackagediffs', method='GET',
2472 query_string='start=1&batch=1')
2473
2474- self.assertEquals(
2475+ self.assertEqual(
2476 'http://127.0.0.1?start=1&batch=1',
2477 view.action_url)
2478
2479
2480=== modified file 'lib/lp/registry/browser/tests/test_person.py'
2481--- lib/lp/registry/browser/tests/test_person.py 2018-01-02 10:54:31 +0000
2482+++ lib/lp/registry/browser/tests/test_person.py 2018-01-02 16:24:23 +0000
2483@@ -189,7 +189,7 @@
2484
2485 def test_should_be_profile_page_when_delegating(self):
2486 """The profile page is the OpenID identifier in normal situation."""
2487- self.assertEquals(
2488+ self.assertEqual(
2489 'http://launchpad.dev/~eris', self.view.openid_identity_url)
2490
2491 def test_should_be_production_profile_page_when_not_delegating(self):
2492@@ -202,7 +202,7 @@
2493 [launchpad]
2494 non_restricted_hostname: prod.launchpad.dev
2495 '''))
2496- self.assertEquals(
2497+ self.assertEqual(
2498 'http://prod.launchpad.dev/~eris', self.view.openid_identity_url)
2499
2500
2501
2502=== modified file 'lib/lp/registry/browser/tests/test_person_webservice.py'
2503--- lib/lp/registry/browser/tests/test_person_webservice.py 2017-06-01 12:58:53 +0000
2504+++ lib/lp/registry/browser/tests/test_person_webservice.py 2018-01-02 16:24:23 +0000
2505@@ -151,7 +151,7 @@
2506 self.assertEqual(response.status, 200)
2507
2508 rendered_comment = response.body
2509- self.assertEquals(
2510+ self.assertEqual(
2511 rendered_comment,
2512 '<a href="/~test-person" class="sprite person">Test Person</a>')
2513
2514
2515=== modified file 'lib/lp/registry/tests/test_distribution.py'
2516--- lib/lp/registry/tests/test_distribution.py 2018-01-02 10:54:31 +0000
2517+++ lib/lp/registry/tests/test_distribution.py 2018-01-02 16:24:23 +0000
2518@@ -151,7 +151,7 @@
2519 distroseries = self.factory.makeDistroSeries()
2520 spph = self.factory.makeSourcePackagePublishingHistory(
2521 distroseries=distroseries, sourcepackagename='my-package')
2522- self.assertEquals(
2523+ self.assertEqual(
2524 spph.sourcepackagerelease.sourcepackagename,
2525 distroseries.distribution.guessPublishedSourcePackageName(
2526 'my-package'))
2527@@ -164,7 +164,7 @@
2528 archive=distroseries.main_archive,
2529 binarypackagename='binary-package',
2530 source_package_release=spph.sourcepackagerelease)
2531- self.assertEquals(
2532+ self.assertEqual(
2533 spph.sourcepackagerelease.sourcepackagename,
2534 distroseries.distribution.guessPublishedSourcePackageName(
2535 'binary-package'))
2536@@ -188,7 +188,7 @@
2537 distroseries2 = self.factory.makeDistroSeries()
2538 spph = self.factory.makeSourcePackagePublishingHistory(
2539 distroseries=distroseries1, sourcepackagename='my-package')
2540- self.assertEquals(
2541+ self.assertEqual(
2542 spph.sourcepackagerelease.sourcepackagename,
2543 distroseries1.distribution.guessPublishedSourcePackageName(
2544 'my-package'))
2545@@ -206,7 +206,7 @@
2546 self.factory.makeBinaryPackagePublishingHistory(
2547 archive=distroseries.main_archive,
2548 binarypackagename='my-package', sourcepackagename='other-package')
2549- self.assertEquals(
2550+ self.assertEqual(
2551 my_spph.sourcepackagerelease.sourcepackagename,
2552 distroseries.distribution.guessPublishedSourcePackageName(
2553 'my-package'))
2554@@ -223,7 +223,7 @@
2555 archive=distroseries.main_archive,
2556 sourcepackagename='new-source-name',
2557 binarypackagename='my-package')
2558- self.assertEquals(
2559+ self.assertEqual(
2560 'new-source-name',
2561 distroseries.distribution.guessPublishedSourcePackageName(
2562 'my-package').name)
2563@@ -235,7 +235,7 @@
2564 sourcepackagename='my-package')
2565 self.factory.makeRelatedBranchesForSourcePackage(
2566 sourcepackage=sourcepackage)
2567- self.assertEquals(
2568+ self.assertEqual(
2569 'my-package',
2570 sourcepackage.distribution.guessPublishedSourcePackageName(
2571 'my-package').name)
2572@@ -371,14 +371,14 @@
2573
2574 def test_get_none(self):
2575 distro = self.factory.makeDistribution()
2576- self.assertEquals([],
2577+ self.assertEqual([],
2578 list(distro.getSeriesByStatus(SeriesStatus.FROZEN)))
2579
2580 def test_get_current(self):
2581 distro = self.factory.makeDistribution()
2582 series = self.factory.makeDistroSeries(distribution=distro,
2583 status=SeriesStatus.CURRENT)
2584- self.assertEquals([series],
2585+ self.assertEqual([series],
2586 list(distro.getSeriesByStatus(SeriesStatus.CURRENT)))
2587
2588
2589@@ -396,13 +396,13 @@
2590 distro = self.factory.makeDistribution()
2591 series = self.factory.makeDistroSeries(distribution=distro,
2592 name="dappere")
2593- self.assertEquals(series, distro.getSeries("dappere"))
2594+ self.assertEqual(series, distro.getSeries("dappere"))
2595
2596 def test_get_by_version(self):
2597 distro = self.factory.makeDistribution()
2598 series = self.factory.makeDistroSeries(distribution=distro,
2599 name="dappere", version="42.6")
2600- self.assertEquals(series, distro.getSeries("42.6"))
2601+ self.assertEqual(series, distro.getSeries("42.6"))
2602
2603 def test_development_series_alias(self):
2604 distro = self.factory.makeDistribution()
2605
2606=== modified file 'lib/lp/registry/tests/test_distributionmirror_prober.py'
2607--- lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 10:54:31 +0000
2608+++ lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 16:24:23 +0000
2609@@ -261,7 +261,7 @@
2610
2611 protocol.factory = FakeFactory('http://foo.bar/')
2612 protocol.makeConnection(FakeTransport())
2613- self.assertEquals(
2614+ self.assertEqual(
2615 'Launchpad Mirror Prober ( https://launchpad.net/ )',
2616 headers['User-Agent'])
2617
2618@@ -475,10 +475,10 @@
2619 there's no task currently running.
2620 """
2621 self.multi_lock.run(self.callback)
2622- self.assertEquals(self.count, 1, "self.callback should have run.")
2623+ self.assertEqual(self.count, 1, "self.callback should have run.")
2624
2625 self.multi_lock.run(self.callback)
2626- self.assertEquals(
2627+ self.assertEqual(
2628 self.count, 2, "self.callback should have run twice.")
2629
2630 def test_run_waits_for_first_lock(self):
2631@@ -489,7 +489,7 @@
2632
2633 # Run self.callback when self.multi_lock is acquired.
2634 self.multi_lock.run(self.callback)
2635- self.assertEquals(
2636+ self.assertEqual(
2637 self.count, 0, "self.callback should not have run yet.")
2638
2639 # Release lock_one.
2640@@ -497,7 +497,7 @@
2641
2642 # multi_lock will now have been able to acquire both semaphores, and
2643 # so it will have run its task.
2644- self.assertEquals(self.count, 1, "self.callback should have run.")
2645+ self.assertEqual(self.count, 1, "self.callback should have run.")
2646
2647 def test_run_waits_for_second_lock(self):
2648 """MultiLock.run acquires the second lock before running functions."""
2649@@ -507,7 +507,7 @@
2650
2651 # Run self.callback when self.multi_lock is acquired.
2652 self.multi_lock.run(self.callback)
2653- self.assertEquals(
2654+ self.assertEqual(
2655 self.count, 0, "self.callback should not have run yet.")
2656
2657 # Release lock_two.
2658@@ -515,7 +515,7 @@
2659
2660 # multi_lock will now have been able to acquire both semaphores, and
2661 # so it will have run its task.
2662- self.assertEquals(self.count, 1, "self.callback should have run.")
2663+ self.assertEqual(self.count, 1, "self.callback should have run.")
2664
2665 def test_run_waits_for_current_task(self):
2666 """MultiLock.run waits the end of the current task before running the
2667@@ -527,7 +527,7 @@
2668
2669 # Run self.callback when self.multi_lock is acquired.
2670 self.multi_lock.run(self.callback)
2671- self.assertEquals(
2672+ self.assertEqual(
2673 self.count, 0, "self.callback should not have run yet.")
2674
2675 # Release lock_one.
2676@@ -535,7 +535,7 @@
2677
2678 # multi_lock will now have been able to acquire both semaphores, and
2679 # so it will have run its task.
2680- self.assertEquals(self.count, 1, "self.callback should have run.")
2681+ self.assertEqual(self.count, 1, "self.callback should have run.")
2682
2683
2684 class TestRedirectAwareProberFactoryAndProtocol(TestCase):
2685@@ -879,28 +879,28 @@
2686 # Since we have a single mirror to probe we need to have a single
2687 # DeferredSemaphore with a limit of PER_HOST_REQUESTS, to ensure we
2688 # don't issue too many simultaneous connections on that host.
2689- self.assertEquals(len(request_manager.host_locks), 1)
2690+ self.assertEqual(len(request_manager.host_locks), 1)
2691 multi_lock = request_manager.host_locks[mirror1_host]
2692- self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2693+ self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2694 # Note that our multi_lock contains another semaphore to control the
2695 # overall number of requests.
2696- self.assertEquals(multi_lock.overall_lock.limit, OVERALL_REQUESTS)
2697+ self.assertEqual(multi_lock.overall_lock.limit, OVERALL_REQUESTS)
2698
2699 probe_function(mirror2, StringIO(), [], logging)
2700 # Now we have two mirrors to probe, but they have the same hostname,
2701 # so we'll still have a single semaphore in host_semaphores.
2702- self.assertEquals(mirror2_host, mirror1_host)
2703- self.assertEquals(len(request_manager.host_locks), 1)
2704+ self.assertEqual(mirror2_host, mirror1_host)
2705+ self.assertEqual(len(request_manager.host_locks), 1)
2706 multi_lock = request_manager.host_locks[mirror2_host]
2707- self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2708+ self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2709
2710 probe_function(mirror3, StringIO(), [], logging)
2711 # This third mirror is on a separate host, so we'll have a second
2712 # semaphore added to host_semaphores.
2713- self.failUnless(mirror3_host != mirror1_host)
2714- self.assertEquals(len(request_manager.host_locks), 2)
2715+ self.assertTrue(mirror3_host != mirror1_host)
2716+ self.assertEqual(len(request_manager.host_locks), 2)
2717 multi_lock = request_manager.host_locks[mirror3_host]
2718- self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2719+ self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
2720
2721 # When using an http_proxy, even though we'll actually connect to the
2722 # proxy, we'll use the mirror's host as the key to find the semaphore
2723@@ -908,7 +908,7 @@
2724 orig_proxy = os.getenv('http_proxy')
2725 os.environ['http_proxy'] = 'http://squid.internal:3128/'
2726 probe_function(mirror3, StringIO(), [], logging)
2727- self.assertEquals(len(request_manager.host_locks), 2)
2728+ self.assertEqual(len(request_manager.host_locks), 2)
2729 restore_http_proxy(orig_proxy)
2730
2731
2732
2733=== modified file 'lib/lp/registry/tests/test_distroseries.py'
2734--- lib/lp/registry/tests/test_distroseries.py 2018-01-02 10:54:31 +0000
2735+++ lib/lp/registry/tests/test_distroseries.py 2018-01-02 16:24:23 +0000
2736@@ -222,7 +222,7 @@
2737 distroarchseries = self.factory.makeDistroArchSeries(
2738 distroseries=distroseries, architecturetag='i386',
2739 processor=processor)
2740- self.assertEquals(
2741+ self.assertEqual(
2742 distroarchseries,
2743 distroseries.getDistroArchSeriesByProcessor(processor))
2744
2745@@ -236,7 +236,7 @@
2746
2747 def test_getDerivedSeries(self):
2748 dsp = self.factory.makeDistroSeriesParent()
2749- self.assertEquals(
2750+ self.assertEqual(
2751 [dsp.derived_series], dsp.parent_series.getDerivedSeries())
2752
2753 def test_registrant_owner_differ(self):
2754@@ -244,8 +244,8 @@
2755 # distribution's owner.
2756 registrant = self.factory.makePerson()
2757 distroseries = self.factory.makeDistroSeries(registrant=registrant)
2758- self.assertEquals(distroseries.distribution.owner, distroseries.owner)
2759- self.assertEquals(registrant, distroseries.registrant)
2760+ self.assertEqual(distroseries.distribution.owner, distroseries.owner)
2761+ self.assertEqual(registrant, distroseries.registrant)
2762 self.assertNotEqual(distroseries.registrant, distroseries.owner)
2763
2764 def test_isDerivedSeries(self):
2765
2766=== modified file 'lib/lp/registry/tests/test_distroseriesdifference.py'
2767--- lib/lp/registry/tests/test_distroseriesdifference.py 2014-11-09 11:48:34 +0000
2768+++ lib/lp/registry/tests/test_distroseriesdifference.py 2018-01-02 16:24:23 +0000
2769@@ -436,7 +436,7 @@
2770 packagesets = self._setupPackageSets(
2771 ds_diff, ds_diff.parent_series, 5)
2772 parent_packagesets = ds_diff.parent_packagesets
2773- self.assertEquals(
2774+ self.assertEqual(
2775 sorted([packageset.name for packageset in packagesets]),
2776 [packageset.name for packageset in parent_packagesets])
2777
2778@@ -445,7 +445,7 @@
2779 ds_diff = self.factory.makeDistroSeriesDifference()
2780 packagesets = self._setupPackageSets(
2781 ds_diff, ds_diff.derived_series, 5)
2782- self.assertEquals(
2783+ self.assertEqual(
2784 sorted([packageset.name for packageset in packagesets]),
2785 [packageset.name for packageset in ds_diff.packagesets])
2786
2787
2788=== modified file 'lib/lp/registry/tests/test_distroseriesparent.py'
2789--- lib/lp/registry/tests/test_distroseriesparent.py 2014-07-30 23:48:56 +0000
2790+++ lib/lp/registry/tests/test_distroseriesparent.py 2018-01-02 16:24:23 +0000
2791@@ -135,7 +135,7 @@
2792
2793 def assertCanEdit(self, dsp):
2794 dsp.initialized = False
2795- self.assertEquals(False, dsp.initialized)
2796+ self.assertEqual(False, dsp.initialized)
2797
2798 def test_distroseries_drivers_can_edit(self):
2799 # Test that distroseries drivers can edit the data.
2800
2801=== modified file 'lib/lp/registry/tests/test_initderiveddistroseries.py'
2802--- lib/lp/registry/tests/test_initderiveddistroseries.py 2013-02-14 01:10:48 +0000
2803+++ lib/lp/registry/tests/test_initderiveddistroseries.py 2018-01-02 16:24:23 +0000
2804@@ -90,7 +90,7 @@
2805 p.getBuiltBinaries()[0].binarypackagerelease.version)
2806 for p in pub_sources])
2807
2808- self.assertEquals(pack_versions, binaries)
2809+ self.assertEqual(pack_versions, binaries)
2810
2811 def test_multiple_parents_binary_packages(self):
2812 # An initialization from many parents (using the package copier)
2813
2814=== modified file 'lib/lp/registry/tests/test_milestonetag.py'
2815--- lib/lp/registry/tests/test_milestonetag.py 2015-01-29 14:14:01 +0000
2816+++ lib/lp/registry/tests/test_milestonetag.py 2018-01-02 16:24:23 +0000
2817@@ -38,7 +38,7 @@
2818
2819 def test_no_tags(self):
2820 # Ensure a newly created milestone does not have associated tags.
2821- self.assertEquals([], self.milestone.getTags())
2822+ self.assertEqual([], self.milestone.getTags())
2823
2824 def test_tags_setting_and_retrieval(self):
2825 # Ensure tags are correctly saved and retrieved from the db.
2826@@ -59,7 +59,7 @@
2827 with person_logged_in(self.person):
2828 self.milestone.setTags(self.tags, self.person)
2829 self.milestone.setTags([], self.person)
2830- self.assertEquals([], self.milestone.getTags())
2831+ self.assertEqual([], self.milestone.getTags())
2832
2833 def test_user_metadata(self):
2834 # Ensure the correct user metadata is created when tags are added.
2835
2836=== modified file 'lib/lp/registry/tests/test_person.py'
2837--- lib/lp/registry/tests/test_person.py 2018-01-02 10:54:31 +0000
2838+++ lib/lp/registry/tests/test_person.py 2018-01-02 16:24:23 +0000
2839@@ -807,7 +807,7 @@
2840 login(user.preferredemail.email)
2841 expected_error = ('This account cannot be deactivated because it owns '
2842 'the following non-public products: private')
2843- self.assertEquals([expected_error], user.canDeactivate())
2844+ self.assertEqual([expected_error], user.canDeactivate())
2845
2846 def test_deactivate_copes_with_names_already_in_use(self):
2847 """When a user deactivates their account, their name is changed.
2848
2849=== modified file 'lib/lp/registry/tests/test_person_vocabularies.py'
2850--- lib/lp/registry/tests/test_person_vocabularies.py 2012-08-13 21:33:47 +0000
2851+++ lib/lp/registry/tests/test_person_vocabularies.py 2018-01-02 16:24:23 +0000
2852@@ -108,7 +108,7 @@
2853 """
2854 if expected is not None:
2855 expected = expected % context.id
2856- self.assertEquals(
2857+ self.assertEqual(
2858 expected,
2859 removeSecurityProxy(
2860 self.getVocabulary(context))._karma_context_constraint)
2861@@ -233,7 +233,7 @@
2862
2863 results = list(self.searchVocabulary(None, u'foobar'))
2864 with StormStatementRecorder() as recorder:
2865- self.assertEquals(4, len(results))
2866+ self.assertEqual(4, len(results))
2867 for person in results:
2868 self.assertEqual(
2869 expected_nicks[person.id], person.ircnicknames)
2870
2871=== modified file 'lib/lp/registry/tests/test_personroles.py'
2872--- lib/lp/registry/tests/test_personroles.py 2014-06-12 01:04:30 +0000
2873+++ lib/lp/registry/tests/test_personroles.py 2018-01-02 16:24:23 +0000
2874@@ -79,7 +79,7 @@
2875 def test_inTeam(self):
2876 # The method person.inTeam is available as the inTeam attribute.
2877 roles = IPersonRoles(self.person)
2878- self.assertEquals(self.person.inTeam, roles.inTeam)
2879+ self.assertEqual(self.person.inTeam, roles.inTeam)
2880
2881 def test_inTeam_works(self):
2882 # Make sure it actually works.
2883
2884=== modified file 'lib/lp/registry/tests/test_personset.py'
2885--- lib/lp/registry/tests/test_personset.py 2018-01-02 10:54:31 +0000
2886+++ lib/lp/registry/tests/test_personset.py 2018-01-02 16:24:23 +0000
2887@@ -569,7 +569,7 @@
2888
2889 ensured_person = self.person_set.ensurePerson(
2890 self.email_address, self.displayname, self.rationale)
2891- self.assertEquals(testing_person.id, ensured_person.id)
2892+ self.assertEqual(testing_person.id, ensured_person.id)
2893 self.assertIsNot(
2894 ensured_person.displayname, self.displayname,
2895 'Person.displayname should not be overridden.')
2896@@ -655,10 +655,10 @@
2897 u'other-openid-identifier', 'a@b.com')
2898
2899 self.assertEqual(other_person, person)
2900- self.assert_(
2901- u'other-openid-identifier' in [
2902- identifier.identifier for identifier in removeSecurityProxy(
2903- person.account).openid_identifiers])
2904+ self.assertIn(
2905+ u'other-openid-identifier',
2906+ [identifier.identifier for identifier in removeSecurityProxy(
2907+ person.account).openid_identifiers])
2908
2909
2910 class TestPersonSetGetOrCreateSoftwareCenterCustomer(TestCaseWithFactory):
2911
2912=== modified file 'lib/lp/registry/tests/test_pillar.py'
2913--- lib/lp/registry/tests/test_pillar.py 2016-04-14 05:16:26 +0000
2914+++ lib/lp/registry/tests/test_pillar.py 2018-01-02 16:24:23 +0000
2915@@ -40,7 +40,7 @@
2916 pillar.name for pillar in
2917 pillar_set.search(
2918 getUtility(IPersonSet).getByName('mark'), 'lz', limit=5)]
2919- self.assertEquals(result_names, [u'launchzap', u'lz-bar', u'lz-foo'])
2920+ self.assertEqual(result_names, [u'launchzap', u'lz-bar', u'lz-foo'])
2921
2922
2923 class TestPillarPerson(TestCaseWithFactory):
2924
2925=== modified file 'lib/lp/registry/tests/test_prf_filter.py'
2926--- lib/lp/registry/tests/test_prf_filter.py 2018-01-02 10:54:31 +0000
2927+++ lib/lp/registry/tests/test_prf_filter.py 2018-01-02 16:24:23 +0000
2928@@ -22,7 +22,7 @@
2929 from logging import getLogger
2930 parent = getLogger("foo")
2931 f = Filter(log_parent=parent)
2932- self.assertEquals(f.log.parent, parent)
2933+ self.assertEqual(f.log.parent, parent)
2934
2935
2936 class Filter_Init(unittest.TestCase):
2937@@ -31,15 +31,15 @@
2938 from lp.registry.scripts.productreleasefinder.filter import (
2939 Filter)
2940 f = Filter()
2941- self.assertEquals(f.filters, [])
2942+ self.assertEqual(f.filters, [])
2943
2944 def testFiltersPropertyGiven(self):
2945 """Filter constructor accepts argument to set filters property."""
2946 from lp.registry.scripts.productreleasefinder.filter import (
2947 Filter)
2948 f = Filter(["wibble"])
2949- self.assertEquals(len(f.filters), 1)
2950- self.assertEquals(f.filters[0], "wibble")
2951+ self.assertEqual(len(f.filters), 1)
2952+ self.assertEqual(f.filters[0], "wibble")
2953
2954
2955 class Filter_CheckUrl(unittest.TestCase):
2956@@ -48,7 +48,7 @@
2957 from lp.registry.scripts.productreleasefinder.filter import (
2958 Filter)
2959 f = Filter()
2960- self.assertEquals(f.check("file:///subdir/file"), None)
2961+ self.assertEqual(f.check("file:///subdir/file"), None)
2962
2963 def makeFilter(self, key, urlglob):
2964 from lp.registry.scripts.productreleasefinder.filter import (
2965@@ -59,27 +59,27 @@
2966 def testNotMatching(self):
2967 """Filter.check returns None if doesn't match a filter."""
2968 f = self.makeFilter("foo", "file:///subdir/w*")
2969- self.assertEquals(f.check("file:///subdir/file"), None)
2970+ self.assertEqual(f.check("file:///subdir/file"), None)
2971
2972 def testNoMatchingSlashes(self):
2973 """Filter.check that the glob does not match slashes."""
2974 f = self.makeFilter("foo", "file:///*l*")
2975- self.assertEquals(f.check("file:///subdir/file"), None)
2976+ self.assertEqual(f.check("file:///subdir/file"), None)
2977
2978 def testReturnsMatching(self):
2979 """Filter.check returns the matching keyword."""
2980 f = self.makeFilter("foo", "file:///subdir/f*e")
2981- self.assertEquals(f.check("file:///subdir/file"), "foo")
2982+ self.assertEqual(f.check("file:///subdir/file"), "foo")
2983
2984 def testGlobSubdir(self):
2985 # Filter.glob can contain slashes to match subdirs
2986 f = self.makeFilter("foo", "file:///sub*/f*e")
2987- self.assertEquals(f.check("file:///subdir/file"), "foo")
2988+ self.assertEqual(f.check("file:///subdir/file"), "foo")
2989
2990 def testReturnsNonMatchingBase(self):
2991 """Filter.check returns None if the base does not match."""
2992 f = self.makeFilter("foo", "http:f*e")
2993- self.assertEquals(f.check("file:///subdir/file"), None)
2994+ self.assertEqual(f.check("file:///subdir/file"), None)
2995
2996
2997 class Filter_IsPossibleParentUrl(unittest.TestCase):
2998
2999=== modified file 'lib/lp/registry/tests/test_prf_hose.py'
3000--- lib/lp/registry/tests/test_prf_hose.py 2018-01-02 10:54:31 +0000
3001+++ lib/lp/registry/tests/test_prf_hose.py 2018-01-02 16:24:23 +0000
3002@@ -29,7 +29,7 @@
3003 from logging import getLogger
3004 parent = getLogger("foo")
3005 h = Hose(log_parent=parent)
3006- self.assertEquals(h.log.parent, parent)
3007+ self.assertEqual(h.log.parent, parent)
3008
3009
3010 class Hose_Filter(unittest.TestCase):
3011@@ -45,7 +45,7 @@
3012 """Hose creates Filter object with empty dictionary."""
3013 from lp.registry.scripts.productreleasefinder.hose import Hose
3014 h = Hose()
3015- self.assertEquals(h.filter.filters, [])
3016+ self.assertEqual(h.filter.filters, [])
3017
3018 def testCreatesFiltersWithGiven(self):
3019 """Hose creates Filter object with dictionary given."""
3020@@ -54,8 +54,8 @@
3021 FilterPattern)
3022 pattern = FilterPattern("foo", "http:e*")
3023 h = Hose([pattern])
3024- self.assertEquals(len(h.filter.filters), 1)
3025- self.assertEquals(h.filter.filters[0], pattern)
3026+ self.assertEqual(len(h.filter.filters), 1)
3027+ self.assertEqual(h.filter.filters[0], pattern)
3028
3029
3030 class Hose_Urls(unittest.TestCase):
3031@@ -74,7 +74,7 @@
3032 obs = Observer()
3033 instrument_method(obs, h, "reduceWork")
3034 h.__init__()
3035- self.assert_(obs.called_it)
3036+ self.assertTrue(obs.called_it)
3037
3038 def testPassesUrlList(self):
3039 """Hose constructor passes url list to reduceWork."""
3040@@ -94,8 +94,7 @@
3041 obs = Observer()
3042 instrument_method(obs, h, "reduceWork")
3043 h.__init__([pattern])
3044- self.assertEquals(obs.args[0][0],
3045- ["http://archive.ubuntu.com/"])
3046+ self.assertEqual(obs.args[0][0], ["http://archive.ubuntu.com/"])
3047
3048 def testSetsUrlProperty(self):
3049 """Hose constructor sets urls property to reduceWork return value."""
3050@@ -106,7 +105,7 @@
3051 return "wibble"
3052
3053 h = TestHose()
3054- self.assertEquals(h.urls, "wibble")
3055+ self.assertEqual(h.urls, "wibble")
3056
3057
3058 class Hose_ReduceWork(unittest.TestCase):
3059@@ -114,24 +113,24 @@
3060 """Hose.reduceWork returns empty list when given one."""
3061 from lp.registry.scripts.productreleasefinder.hose import Hose
3062 h = Hose()
3063- self.assertEquals(h.reduceWork([]), [])
3064+ self.assertEqual(h.reduceWork([]), [])
3065
3066 def testReducedList(self):
3067 """Hose.reduceWork returns same list when nothing to do."""
3068 from lp.registry.scripts.productreleasefinder.hose import Hose
3069 h = Hose()
3070- self.assertEquals(h.reduceWork(["http://localhost/", "file:///usr/"]),
3071- ["http://localhost/", "file:///usr/"])
3072+ self.assertEqual(h.reduceWork(["http://localhost/", "file:///usr/"]),
3073+ ["http://localhost/", "file:///usr/"])
3074
3075 def testReducesList(self):
3076 """Hose.reduceWork removes children elements from list."""
3077 from lp.registry.scripts.productreleasefinder.hose import Hose
3078 h = Hose()
3079- self.assertEquals(h.reduceWork(["http://localhost/",
3080- "http://localhost/foo/bar/",
3081- "http://localhost/wibble/",
3082- "file:///usr/"]),
3083- ["http://localhost/", "file:///usr/"])
3084+ self.assertEqual(h.reduceWork(["http://localhost/",
3085+ "http://localhost/foo/bar/",
3086+ "http://localhost/wibble/",
3087+ "file:///usr/"]),
3088+ ["http://localhost/", "file:///usr/"])
3089
3090
3091 class Hose_LimitWalk(unittest.TestCase):
3092
3093=== modified file 'lib/lp/registry/tests/test_prf_log.py'
3094--- lib/lp/registry/tests/test_prf_log.py 2018-01-02 10:54:31 +0000
3095+++ lib/lp/registry/tests/test_prf_log.py 2018-01-02 16:24:23 +0000
3096@@ -20,20 +20,20 @@
3097 def testNoParent(self):
3098 """get_logger works if no parent is given."""
3099 from lp.registry.scripts.productreleasefinder.log import get_logger
3100- self.assertEquals(get_logger("test").name, "test")
3101+ self.assertEqual(get_logger("test").name, "test")
3102
3103 def testRootParent(self):
3104 """get_logger works if root logger is given."""
3105 from lp.registry.scripts.productreleasefinder.log import get_logger
3106 from logging import root
3107- self.assertEquals(get_logger("test", root).name, "test")
3108+ self.assertEqual(get_logger("test", root).name, "test")
3109
3110 def testNormalParent(self):
3111 """get_logger works if non-root logger is given."""
3112 from lp.registry.scripts.productreleasefinder.log import get_logger
3113 from logging import getLogger
3114 parent = getLogger("foo")
3115- self.assertEquals(get_logger("test", parent).name, "foo.test")
3116+ self.assertEqual(get_logger("test", parent).name, "foo.test")
3117
3118 def testDeepParent(self):
3119 """get_logger works if deep-level logger is given."""
3120@@ -41,4 +41,4 @@
3121 from logging import getLogger
3122 getLogger("foo")
3123 parent2 = getLogger("foo.bar")
3124- self.assertEquals(get_logger("test", parent2).name, "foo.bar.test")
3125+ self.assertEqual(get_logger("test", parent2).name, "foo.bar.test")
3126
3127=== modified file 'lib/lp/registry/tests/test_prf_walker.py'
3128--- lib/lp/registry/tests/test_prf_walker.py 2018-01-02 10:54:31 +0000
3129+++ lib/lp/registry/tests/test_prf_walker.py 2018-01-02 16:24:23 +0000
3130@@ -29,7 +29,7 @@
3131 from logging import getLogger
3132 parent = getLogger("foo")
3133 w = WalkerBase("/", log_parent=parent)
3134- self.assertEquals(w.log.parent, parent)
3135+ self.assertEqual(w.log.parent, parent)
3136
3137
3138 class WalkerBase_Base(TestCase):
3139@@ -37,22 +37,22 @@
3140 def testSetsBase(self):
3141 """WalkerBase sets the base property."""
3142 w = WalkerBase("ftp://localhost/")
3143- self.assertEquals(w.base, "ftp://localhost/")
3144+ self.assertEqual(w.base, "ftp://localhost/")
3145
3146 def testSetsScheme(self):
3147 """WalkerBase sets the scheme property."""
3148 w = WalkerBase("ftp://localhost/")
3149- self.assertEquals(w.scheme, "ftp")
3150+ self.assertEqual(w.scheme, "ftp")
3151
3152 def testSetsHost(self):
3153 """WalkerBase sets the host property."""
3154 w = WalkerBase("ftp://localhost/")
3155- self.assertEquals(w.host, "localhost")
3156+ self.assertEqual(w.host, "localhost")
3157
3158 def testNoScheme(self):
3159 """WalkerBase works when given a URL with no scheme."""
3160 w = WalkerBase("/")
3161- self.assertEquals(w.host, "")
3162+ self.assertEqual(w.host, "")
3163
3164 def testWrongScheme(self):
3165 """WalkerBase raises WalkerError when given an unhandled scheme."""
3166@@ -63,75 +63,75 @@
3167 def testUnescapesHost(self):
3168 """WalkerBase unescapes the host portion."""
3169 w = WalkerBase("ftp://local%40host/")
3170- self.assertEquals(w.host, "local@host")
3171+ self.assertEqual(w.host, "local@host")
3172
3173 def testNoUsername(self):
3174 """WalkerBase stores None when there is no username."""
3175 w = WalkerBase("ftp://localhost/")
3176- self.assertEquals(w.user, None)
3177+ self.assertEqual(w.user, None)
3178
3179 def testUsername(self):
3180 """WalkerBase splits out the username from the host portion."""
3181 w = WalkerBase("ftp://scott@localhost/")
3182- self.assertEquals(w.user, "scott")
3183- self.assertEquals(w.host, "localhost")
3184+ self.assertEqual(w.user, "scott")
3185+ self.assertEqual(w.host, "localhost")
3186
3187 def testUnescapesUsername(self):
3188 """WalkerBase unescapes the username portion."""
3189 w = WalkerBase("ftp://scott%3awibble@localhost/")
3190- self.assertEquals(w.user, "scott:wibble")
3191- self.assertEquals(w.host, "localhost")
3192+ self.assertEqual(w.user, "scott:wibble")
3193+ self.assertEqual(w.host, "localhost")
3194
3195 def testNoPassword(self):
3196 """WalkerBase stores None when there is no password."""
3197 w = WalkerBase("ftp://scott@localhost/")
3198- self.assertEquals(w.passwd, None)
3199+ self.assertEqual(w.passwd, None)
3200
3201 def testPassword(self):
3202 """WalkerBase splits out the password from the username."""
3203 w = WalkerBase("ftp://scott:wibble@localhost/")
3204- self.assertEquals(w.user, "scott")
3205- self.assertEquals(w.passwd, "wibble")
3206- self.assertEquals(w.host, "localhost")
3207+ self.assertEqual(w.user, "scott")
3208+ self.assertEqual(w.passwd, "wibble")
3209+ self.assertEqual(w.host, "localhost")
3210
3211 def testUnescapesPassword(self):
3212 """WalkerBase unescapes the password portion."""
3213 w = WalkerBase("ftp://scott:wibble%20wobble@localhost/")
3214- self.assertEquals(w.user, "scott")
3215- self.assertEquals(w.passwd, "wibble wobble")
3216- self.assertEquals(w.host, "localhost")
3217+ self.assertEqual(w.user, "scott")
3218+ self.assertEqual(w.passwd, "wibble wobble")
3219+ self.assertEqual(w.host, "localhost")
3220
3221 def testPathOnly(self):
3222 """WalkerBase stores the path if that's all there is."""
3223 w = WalkerBase("/path/to/something/")
3224- self.assertEquals(w.path, "/path/to/something/")
3225+ self.assertEqual(w.path, "/path/to/something/")
3226
3227 def testPathInUrl(self):
3228 """WalkerBase stores the path portion of a complete URL."""
3229 w = WalkerBase("ftp://localhost/path/to/something/")
3230- self.assertEquals(w.path, "/path/to/something/")
3231+ self.assertEqual(w.path, "/path/to/something/")
3232
3233 def testAddsSlashToPath(self):
3234 """WalkerBase adds a trailing slash to path if ommitted."""
3235 w = WalkerBase("ftp://localhost/path/to/something")
3236- self.assertEquals(w.path, "/path/to/something/")
3237+ self.assertEqual(w.path, "/path/to/something/")
3238
3239 def testUnescapesPath(self):
3240 """WalkerBase leaves the path escaped."""
3241 w = WalkerBase("ftp://localhost/some%20thing/")
3242- self.assertEquals(w.path, "/some%20thing/")
3243+ self.assertEqual(w.path, "/some%20thing/")
3244
3245 def testStoresQuery(self):
3246 """WalkerBase stores the query portion of a supporting URL."""
3247 w = WalkerBase("http://localhost/?foo")
3248- self.assertEquals(w.query, "foo")
3249+ self.assertEqual(w.query, "foo")
3250
3251 def testStoresFragment(self):
3252 """WalkerBase stores the fragment portion of a supporting URL."""
3253 WalkerBase.FRAGMENTS = True
3254 try:
3255 w = WalkerBase("http://localhost/#foo")
3256- self.assertEquals(w.fragment, "foo")
3257+ self.assertEqual(w.fragment, "foo")
3258 finally:
3259 WalkerBase.FRAGMENTS = False
3260
3261@@ -204,14 +204,14 @@
3262 from lp.registry.scripts.productreleasefinder.walker import (
3263 FTPWalker)
3264 w = FTPWalker("ftp://localhost/")
3265- self.assertEquals(w.host, "localhost")
3266+ self.assertEqual(w.host, "localhost")
3267
3268 def testNoScheme(self):
3269 """FTPWalker works when given a URL with no scheme."""
3270 from lp.registry.scripts.productreleasefinder.walker import (
3271 FTPWalker)
3272 w = FTPWalker("/")
3273- self.assertEquals(w.host, "")
3274+ self.assertEqual(w.host, "")
3275
3276 def testWrongScheme(self):
3277 """FTPWalker raises WalkerError when given an unhandled scheme."""
3278@@ -224,14 +224,14 @@
3279 from lp.registry.scripts.productreleasefinder.walker import (
3280 FTPWalker)
3281 w = FTPWalker("ftp://localhost/")
3282- self.assertEquals(w.user, "anonymous")
3283+ self.assertEqual(w.user, "anonymous")
3284
3285 def testNoPassword(self):
3286 """FTPWalker stores empty string when there is no password."""
3287 from lp.registry.scripts.productreleasefinder.walker import (
3288 FTPWalker)
3289 w = FTPWalker("ftp://scott@localhost/")
3290- self.assertEquals(w.passwd, "")
3291+ self.assertEqual(w.passwd, "")
3292
3293
3294 class HTTPWalker_Base(TestCase):
3295@@ -241,21 +241,21 @@
3296 from lp.registry.scripts.productreleasefinder.walker import (
3297 HTTPWalker)
3298 w = HTTPWalker("http://localhost/")
3299- self.assertEquals(w.host, "localhost")
3300+ self.assertEqual(w.host, "localhost")
3301
3302 def testHttpsScheme(self):
3303 """HTTPWalker works when initialized with an https-scheme URL."""
3304 from lp.registry.scripts.productreleasefinder.walker import (
3305 HTTPWalker)
3306 w = HTTPWalker("https://localhost/")
3307- self.assertEquals(w.host, "localhost")
3308+ self.assertEqual(w.host, "localhost")
3309
3310 def testNoScheme(self):
3311 """HTTPWalker works when given a URL with no scheme."""
3312 from lp.registry.scripts.productreleasefinder.walker import (
3313 HTTPWalker)
3314 w = HTTPWalker("/")
3315- self.assertEquals(w.host, "")
3316+ self.assertEqual(w.host, "")
3317
3318 def testWrongScheme(self):
3319 """HTTPWalker raises WalkerError when given an unhandled scheme."""
3320@@ -274,13 +274,13 @@
3321 self.walker = HTTPWalker("http://localhost/")
3322
3323 def verify_url_scheme_and_handler(self, scheme, handler):
3324- self.assert_(scheme in self.walker.URL_SCHEMES)
3325- self.assert_(handler in self.walker.handlers)
3326+ self.assertIn(scheme, self.walker.URL_SCHEMES)
3327+ self.assertIn(handler, self.walker.handlers)
3328 # urllib2 uses a naming convention to select the handler for
3329 # a URL scheme. This test is sanity to check to ensure that the
3330 # HTTPWalker's configuration of the OpenerDirector is will work.
3331 method_name = '%s_open' % scheme
3332- self.assert_(safe_hasattr(handler, method_name))
3333+ self.assertTrue(safe_hasattr(handler, method_name))
3334
3335 def test_http_request(self):
3336 import urllib2
3337@@ -503,7 +503,7 @@
3338 """combine_url constructs the URL correctly."""
3339 from lp.registry.scripts.productreleasefinder.walker import (
3340 combine_url)
3341- self.assertEquals(combine_url("file:///base", "/subdir/", "file"),
3342- "file:///subdir/file")
3343- self.assertEquals(combine_url("file:///base", "/subdir", "file"),
3344- "file:///subdir/file")
3345+ self.assertEqual(combine_url("file:///base", "/subdir/", "file"),
3346+ "file:///subdir/file")
3347+ self.assertEqual(combine_url("file:///base", "/subdir", "file"),
3348+ "file:///subdir/file")
3349
3350=== modified file 'lib/lp/registry/tests/test_project_milestone.py'
3351--- lib/lp/registry/tests/test_project_milestone.py 2015-01-29 16:28:30 +0000
3352+++ lib/lp/registry/tests/test_project_milestone.py 2018-01-02 16:24:23 +0000
3353@@ -331,7 +331,7 @@
3354 try:
3355 milestone.createProductRelease(1, now)
3356 except MultipleProductReleases as e:
3357- self.assert_(
3358+ self.assertTrue(
3359 str(e), 'A milestone can only have one ProductRelease.')
3360
3361 def test_inappropriate_deactivation_does_not_cause_an_OOPS(self):
3362
3363=== modified file 'lib/lp/registry/tests/test_teammembership.py'
3364--- lib/lp/registry/tests/test_teammembership.py 2018-01-02 10:54:31 +0000
3365+++ lib/lp/registry/tests/test_teammembership.py 2018-01-02 16:24:23 +0000
3366@@ -277,7 +277,7 @@
3367 def assertParticipantsEquals(self, participant_names, team):
3368 """Assert that the participants names in team are the expected ones.
3369 """
3370- self.assertEquals(
3371+ self.assertEqual(
3372 sorted(participant_names),
3373 sorted([participant.name for participant in team.allmembers]))
3374
3375
3376=== modified file 'lib/lp/scripts/tests/test_runlaunchpad.py'
3377--- lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 10:54:31 +0000
3378+++ lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 16:24:23 +0000
3379@@ -113,11 +113,11 @@
3380 instance_config_dir = os.path.join(self.config_root, 'test')
3381 os.mkdir(instance_config_dir)
3382 open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close()
3383- self.assertEquals(
3384+ self.assertEqual(
3385 ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir],
3386 process_config_arguments(
3387 ['-i', 'test', '-o', 'foo']))
3388- self.assertEquals('test', config.instance_name)
3389+ self.assertEqual('test', config.instance_name)
3390
3391
3392 class ServersToStart(testtools.TestCase):
3393
3394=== modified file 'lib/lp/scripts/utilities/js/tests/test_combo.py'
3395--- lib/lp/scripts/utilities/js/tests/test_combo.py 2016-01-26 15:47:37 +0000
3396+++ lib/lp/scripts/utilities/js/tests/test_combo.py 2018-01-02 16:24:23 +0000
3397@@ -90,7 +90,7 @@
3398
3399 def test_parse_url_keeps_order(self):
3400 """Parsing a combo loader URL returns an ordered list of filenames."""
3401- self.assertEquals(
3402+ self.assertEqual(
3403 parse_url(("http://yui.yahooapis.com/combo?"
3404 "3.0.0/build/yui/yui-min.js&"
3405 "3.0.0/build/oop/oop-min.js&"
3406@@ -124,7 +124,7 @@
3407 "** oop-min **",
3408 "// event-custom/event-custom-min.js",
3409 "** event-custom-min **"))
3410- self.assertEquals(
3411+ self.assertEqual(
3412 "".join(combine_files(["yui/yui-min.js",
3413 "oop/oop-min.js",
3414 "event-custom/event-custom-min.js"],
3415@@ -163,7 +163,7 @@
3416 "/* editor/assets/skins/sam/editor.css */",
3417 ".yui-editor{background:url(editor/assets/skins/sam/img/bg.png)}",
3418 ))
3419- self.assertEquals(
3420+ self.assertEqual(
3421 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3422 "editor/assets/skins/sam/editor.css"],
3423 root=test_dir)).strip(),
3424@@ -225,7 +225,7 @@
3425 "/* editor/assets/skins/sam/editor.css */",
3426 ".yui-editor{background:url(http://foo/static/img/bg.png)}",
3427 ))
3428- self.assertEquals(
3429+ self.assertEqual(
3430 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3431 "editor/assets/skins/sam/editor.css"],
3432 root=test_dir)).strip(),
3433@@ -263,7 +263,7 @@
3434 '/* editor/assets/skins/sam/editor.css */',
3435 '.yui-editor{background:url("data:image/gif;base64,base64-data")}',
3436 ))
3437- self.assertEquals(
3438+ self.assertEqual(
3439 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3440 "editor/assets/skins/sam/editor.css"],
3441 root=test_dir)).strip(),
3442@@ -306,7 +306,7 @@
3443 " background: url(editor/assets/skins/sam/img/bg.png);",
3444 "}",
3445 ))
3446- self.assertEquals(
3447+ self.assertEqual(
3448 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3449 "editor/assets/skins/sam/editor.css"],
3450 root=test_dir, minify_css=False)).strip(),
3451@@ -344,7 +344,7 @@
3452 "/* editor/assets/skins/sam/editor.css */",
3453 ".yui-editor{background:url(img/bg.png)}",
3454 ))
3455- self.assertEquals(
3456+ self.assertEqual(
3457 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3458 "editor/assets/skins/sam/editor.css"],
3459 root=test_dir, rewrite_urls=False)).strip(),
3460@@ -388,7 +388,7 @@
3461 ' background: url("img/bg.png");',
3462 '}',
3463 ))
3464- self.assertEquals(
3465+ self.assertEqual(
3466 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3467 "editor/assets/skins/sam/editor.css"],
3468 root=test_dir,
3469@@ -431,7 +431,7 @@
3470 ".yui-editor{background:url(" +
3471 "/static/editor/assets/skins/sam/img/bg.png)}",
3472 ))
3473- self.assertEquals(
3474+ self.assertEqual(
3475 "".join(combine_files(["widget/assets/skins/sam/widget.css",
3476 "editor/assets/skins/sam/editor.css"],
3477 root=test_dir,
3478@@ -459,7 +459,7 @@
3479 "// [missing]",
3480 "// event-custom/event-custom-min.js",
3481 "** event-custom-min **"))
3482- self.assertEquals(
3483+ self.assertEqual(
3484 "".join(combine_files(["yui/yui-min.js",
3485 "oop/oop-min.js",
3486 "event-custom/event-custom-min.js"],
3487@@ -482,7 +482,7 @@
3488
3489 expected = "\n".join(("// ../../oop/oop-min.js",
3490 "// [missing]"))
3491- self.assertEquals(
3492+ self.assertEqual(
3493 "".join(combine_files([hack], root=root)).strip(),
3494 expected)
3495
3496@@ -498,7 +498,7 @@
3497
3498 expected = "\n".join(("/* yui/base/base.css */",
3499 ".foo{background-image:url(img.png)}"))
3500- self.assertEquals(
3501+ self.assertEqual(
3502 "".join(combine_files(files, root=test_dir)).strip(),
3503 expected)
3504
3505@@ -510,7 +510,7 @@
3506 self.assertTrue(os.path.exists("/etc/passwd"))
3507
3508 expected = ""
3509- self.assertEquals(
3510+ self.assertEqual(
3511 "".join(combine_files([hack], root=test_dir)).strip(),
3512 expected)
3513
3514@@ -548,8 +548,8 @@
3515 ["yui/yui-min.js",
3516 "oop/oop-min.js",
3517 "event-custom/event-custom-min.js"]), status=200)
3518- self.assertEquals(res.headers, [("Content-Type", "text/javascript")])
3519- self.assertEquals(res.body.strip(), expected)
3520+ self.assertEqual(res.headers, [("Content-Type", "text/javascript")])
3521+ self.assertEqual(res.body.strip(), expected)
3522
3523 def test_combo_app_sets_content_type_for_css(self):
3524 """The WSGI App should set a proper Content-Type for CSS."""
3525@@ -562,11 +562,11 @@
3526
3527 res = self.app.get("/?" + "&".join(
3528 ["widget/skin/sam/widget.css"]), status=200)
3529- self.assertEquals(res.headers, [("Content-Type", "text/css")])
3530- self.assertEquals(res.body.strip(), expected)
3531+ self.assertEqual(res.headers, [("Content-Type", "text/css")])
3532+ self.assertEqual(res.body.strip(), expected)
3533
3534 def test_no_filename_gives_404(self):
3535 """If no filename is included, a 404 should be returned."""
3536 res = self.app.get("/", status=404)
3537- self.assertEquals(res.headers, [("Content-Type", "text/plain")])
3538- self.assertEquals(res.body, "Not Found")
3539+ self.assertEqual(res.headers, [("Content-Type", "text/plain")])
3540+ self.assertEqual(res.body, "Not Found")
3541
3542=== modified file 'lib/lp/services/config/tests/test_config_lookup.py'
3543--- lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 15:23:24 +0000
3544+++ lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 16:24:23 +0000
3545@@ -113,7 +113,7 @@
3546
3547 def test_find_config_dir(self):
3548 instance_config_dir = self.setUpInstanceConfig('an_instance')
3549- self.assertEquals(
3550+ self.assertEqual(
3551 instance_config_dir, config.find_config_dir('an_instance'))
3552
3553 def test_Config_uses_find_config_dir(self):
3554@@ -127,7 +127,7 @@
3555
3556 # We don't care about ZConfig...
3557 cfg._setZConfig = lambda: None
3558- self.assertEquals(2323, cfg.launchpad.default_batch_size)
3559+ self.assertEqual(2323, cfg.launchpad.default_batch_size)
3560
3561
3562 class TestGenerateOverrides(ConfigTestCase):
3563
3564=== modified file 'lib/lp/services/database/tests/test_storm.py'
3565--- lib/lp/services/database/tests/test_storm.py 2014-01-30 15:04:06 +0000
3566+++ lib/lp/services/database/tests/test_storm.py 2018-01-02 16:24:23 +0000
3567@@ -13,6 +13,6 @@
3568 class TestStorm(TestCase):
3569 def test_has_cextensions(self):
3570 """Ensure Storm C extensions are being used."""
3571- self.assert_(
3572+ self.assertTrue(
3573 storm.has_cextensions,
3574 'Storm not running with C extensions')
3575
3576=== modified file 'lib/lp/services/features/tests/test_flags.py'
3577--- lib/lp/services/features/tests/test_flags.py 2014-02-26 00:25:03 +0000
3578+++ lib/lp/services/features/tests/test_flags.py 2018-01-02 16:24:23 +0000
3579@@ -188,7 +188,7 @@
3580 # no scopes need to be checked because it's just not in the database
3581 # and there's no point checking
3582 self.assertEqual({}, f._known_scopes._known)
3583- self.assertEquals([], call_log)
3584+ self.assertEqual([], call_log)
3585 # however, this we have now negative-cached the flag
3586 self.assertEqual(dict(unknown=None), f.usedFlags())
3587 self.assertEqual(dict(), f.usedScopes())
3588@@ -215,14 +215,14 @@
3589 def test_getAllRulesAsTuples(self):
3590 source = self.makeSource()
3591 source.setAllRules(test_rules_list)
3592- self.assertEquals(
3593+ self.assertEqual(
3594 test_rules_list,
3595 list(source.getAllRulesAsTuples()))
3596
3597 def test_getAllRulesAsText(self):
3598 source = self.makeSource()
3599 source.setAllRules(test_rules_list)
3600- self.assertEquals(
3601+ self.assertEqual(
3602 """\
3603 %s\tbeta_user\t100\t%s
3604 ui.icing\tnormal_user\t500\t5.0
3605@@ -241,7 +241,7 @@
3606 flag1 default 100 gamma with spaces
3607 flag2 default 0\ton
3608 """)
3609- self.assertEquals({
3610+ self.assertEqual({
3611 'flag1': [
3612 ('beta_user', 200, 'alpha'),
3613 ('default', 100, 'gamma with spaces'),
3614
3615=== modified file 'lib/lp/services/features/tests/test_scopes.py'
3616--- lib/lp/services/features/tests/test_scopes.py 2012-01-01 02:58:52 +0000
3617+++ lib/lp/services/features/tests/test_scopes.py 2018-01-02 16:24:23 +0000
3618@@ -100,7 +100,7 @@
3619 name = 'userslice:%d,%d' % (i, checks)
3620 if scope.lookup(name):
3621 matches.append(name)
3622- self.assertEquals(len(matches), 1, matches)
3623+ self.assertEqual(len(matches), 1, matches)
3624
3625
3626 class TestUserSliceScopeIntegration(TestCaseWithFactory):
3627@@ -123,5 +123,5 @@
3628 value=u'not_value'),
3629 ]):
3630 with person_logged_in(person):
3631- self.assertEquals(getFeatureFlag('test_feature'), 'on')
3632- self.assertEquals(getFeatureFlag('test_not'), None)
3633+ self.assertEqual(getFeatureFlag('test_feature'), 'on')
3634+ self.assertEqual(getFeatureFlag('test_not'), None)
3635
3636=== modified file 'lib/lp/services/features/tests/test_webapp.py'
3637--- lib/lp/services/features/tests/test_webapp.py 2012-01-01 02:58:52 +0000
3638+++ lib/lp/services/features/tests/test_webapp.py 2018-01-02 16:24:23 +0000
3639@@ -114,7 +114,7 @@
3640 with CaptureOops() as capture:
3641 request = LaunchpadTestRequest()
3642
3643- self.assertEquals(getFeatureFlag('feature_name'), 'value')
3644+ self.assertEqual(getFeatureFlag('feature_name'), 'value')
3645
3646 # Simulate an oops here.
3647 globalErrorUtility.raising(None, request=request)
3648@@ -122,5 +122,5 @@
3649 oops = capture.oopses[0]
3650 self.assertTrue('features.usedScopes' in oops)
3651 self.assertTrue('features.usedFlags' in oops)
3652- self.assertEquals(oops['features.usedFlags'],
3653- u"{'feature_name': u'value'}")
3654+ self.assertEqual(
3655+ oops['features.usedFlags'], u"{'feature_name': u'value'}")
3656
3657=== modified file 'lib/lp/services/librarian/tests/test_libraryfilealias.py'
3658--- lib/lp/services/librarian/tests/test_libraryfilealias.py 2012-01-01 02:58:52 +0000
3659+++ lib/lp/services/librarian/tests/test_libraryfilealias.py 2018-01-02 16:24:23 +0000
3660@@ -38,10 +38,10 @@
3661 def test_file_is_closed_at_the_end_of_transaction(self):
3662 """Non-DB instance state should be reset on transaction boundaries."""
3663 self.file_alias.open()
3664- self.assertEquals(self.text_content[0:4], self.file_alias.read(4))
3665+ self.assertEqual(self.text_content[0:4], self.file_alias.read(4))
3666 # This should reset the file pointer.
3667 transaction.commit()
3668 # If the file pointer isn't reset, the next call to read() will return
3669 # the remaining content. If it's reset, the file will be auto-opened
3670 # and its whole content will be returned.
3671- self.assertEquals(self.text_content, self.file_alias.read())
3672+ self.assertEqual(self.text_content, self.file_alias.read())
3673
3674=== modified file 'lib/lp/services/librarian/tests/test_smoketest.py'
3675--- lib/lp/services/librarian/tests/test_smoketest.py 2015-10-14 15:22:01 +0000
3676+++ lib/lp/services/librarian/tests/test_smoketest.py 2018-01-02 16:24:23 +0000
3677@@ -78,7 +78,7 @@
3678 # the main function will return 0 (which will be used as the processes
3679 # exit code to signal success).
3680 with fake_urllib(GoodUrllib()):
3681- self.assertEquals(
3682+ self.assertEqual(
3683 do_smoketest(self.fake_librarian, self.fake_librarian,
3684 output=StringIO()),
3685 0)
3686@@ -87,7 +87,7 @@
3687 # If incorrect data is retrieved, the main function will return 1
3688 # (which will be used as the processes exit code to signal an error).
3689 with fake_urllib(BadUrllib()):
3690- self.assertEquals(
3691+ self.assertEqual(
3692 do_smoketest(self.fake_librarian, self.fake_librarian,
3693 output=StringIO()),
3694 1)
3695@@ -97,7 +97,7 @@
3696 # function will return 1 (which will be used as the processes exit
3697 # code to signal an error).
3698 with fake_urllib(ErrorUrllib()):
3699- self.assertEquals(
3700+ self.assertEqual(
3701 do_smoketest(self.fake_librarian, self.fake_librarian,
3702 output=StringIO()),
3703 1)
3704
3705=== modified file 'lib/lp/services/librarianserver/tests/test_gc.py'
3706--- lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 10:54:31 +0000
3707+++ lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 16:24:23 +0000
3708@@ -299,10 +299,10 @@
3709 self.ztm.begin()
3710 # Make sure the well expired f1 is still there, but has no content.
3711 f1 = LibraryFileAlias.get(self.f1_id)
3712- self.assert_(f1.content is None)
3713+ self.assertIsNone(f1.content)
3714 # f2 should still have content, as it isn't flagged for expiry.
3715 f2 = LibraryFileAlias.get(self.f2_id)
3716- self.assert_(f2.content is not None)
3717+ self.assertIsNotNone(f2.content)
3718
3719 def test_ignoreRecentlyExpiredAliases(self):
3720 # LibraryFileAlias records that have expired recently are not
3721@@ -323,10 +323,10 @@
3722 # Make sure f1 is still there and has content. This ensures that
3723 # our stay of execution is still working.
3724 f1 = LibraryFileAlias.get(self.f1_id)
3725- self.assert_(f1.content is not None)
3726+ self.assertIsNotNone(f1.content)
3727 # f2 should still have content, as it isn't flagged for expiry.
3728 f2 = LibraryFileAlias.get(self.f2_id)
3729- self.assert_(f2.content is not None)
3730+ self.assertIsNotNone(f2.content)
3731
3732 def test_DeleteUnreferencedContent(self):
3733 # Merge the duplicates. This creates an
3734@@ -677,13 +677,13 @@
3735 librariangc.delete_unwanted_files(self.con)
3736
3737 # None of the rubbish we created has been touched.
3738- self.assert_(os.path.isdir(noisedir1_path))
3739- self.assert_(os.path.isdir(noisedir2_path))
3740- self.assert_(os.path.isdir(noisedir3_path))
3741- self.assert_(os.path.exists(noisefile1_path))
3742- self.assert_(os.path.exists(noisefile2_path))
3743- self.assert_(os.path.exists(noisefile3_path))
3744- self.assert_(os.path.exists(migrated_path))
3745+ self.assertTrue(os.path.isdir(noisedir1_path))
3746+ self.assertTrue(os.path.isdir(noisedir2_path))
3747+ self.assertTrue(os.path.isdir(noisedir3_path))
3748+ self.assertTrue(os.path.exists(noisefile1_path))
3749+ self.assertTrue(os.path.exists(noisefile2_path))
3750+ self.assertTrue(os.path.exists(noisefile3_path))
3751+ self.assertTrue(os.path.exists(migrated_path))
3752 finally:
3753 # We need to clean this up ourselves, as the standard librarian
3754 # cleanup only removes files it knows where valid to avoid
3755
3756=== modified file 'lib/lp/services/librarianserver/tests/test_swift.py'
3757--- lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 10:54:31 +0000
3758+++ lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 16:24:23 +0000
3759@@ -82,7 +82,7 @@
3760 # Confirm that files exist on disk where we expect to find them.
3761 for lfc in self.lfcs:
3762 path = swift.filesystem_path(lfc.id)
3763- self.assert_(os.path.exists(path))
3764+ self.assertTrue(os.path.exists(path))
3765
3766 # Copy all the files into Swift.
3767 swift.to_swift(log, remove_func=None)
3768@@ -90,7 +90,7 @@
3769 # Confirm that files exist on disk where we expect to find them.
3770 for lfc in self.lfcs:
3771 path = swift.filesystem_path(lfc.id)
3772- self.assert_(os.path.exists(path))
3773+ self.assertTrue(os.path.exists(path))
3774
3775 # Confirm all the files are also in Swift.
3776 swift_client = self.swift_fixture.connect()
3777@@ -113,7 +113,7 @@
3778 # Confirm that files exist on disk where we expect to find them.
3779 for lfc in self.lfcs:
3780 path = swift.filesystem_path(lfc.id)
3781- self.assert_(os.path.exists(path))
3782+ self.assertTrue(os.path.exists(path))
3783
3784 # Copy all the files into Swift.
3785 swift.to_swift(log, remove_func=swift.rename)
3786@@ -121,7 +121,7 @@
3787 # Confirm that files exist on disk where we expect to find them.
3788 for lfc in self.lfcs:
3789 path = swift.filesystem_path(lfc.id) + '.migrated'
3790- self.assert_(os.path.exists(path))
3791+ self.assertTrue(os.path.exists(path))
3792
3793 # Confirm all the files are also in Swift.
3794 swift_client = self.swift_fixture.connect()
3795@@ -144,7 +144,7 @@
3796 # Confirm that files exist on disk where we expect to find them.
3797 for lfc in self.lfcs:
3798 path = swift.filesystem_path(lfc.id)
3799- self.assert_(os.path.exists(path))
3800+ self.assertTrue(os.path.exists(path))
3801
3802 # Migrate all the files into Swift.
3803 swift.to_swift(log, remove_func=os.unlink)
3804@@ -200,7 +200,7 @@
3805 # to be done in multiple chunks, but small enough that it is
3806 # stored in Swift as a single object.
3807 size = LibrarianStorage.CHUNK_SIZE * 50
3808- self.assert_(size > 1024 * 1024)
3809+ self.assertTrue(size > 1024 * 1024)
3810 expected_content = ''.join(chr(i % 256) for i in range(0, size))
3811 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
3812 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content
3813@@ -222,7 +222,7 @@
3814 # to be done in multiple chunks, but small enough that it is
3815 # stored in Swift as a single object.
3816 size = LibrarianStorage.CHUNK_SIZE * 50 + 1
3817- self.assert_(size > 1024 * 1024)
3818+ self.assertTrue(size > 1024 * 1024)
3819 expected_content = ''.join(chr(i % 256) for i in range(0, size))
3820 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
3821 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content
3822@@ -241,7 +241,7 @@
3823 # Generate a blob large enough that Swift requires us to store
3824 # it as multiple objects plus a manifest.
3825 size = LibrarianStorage.CHUNK_SIZE * 50
3826- self.assert_(size > 1024 * 1024)
3827+ self.assertTrue(size > 1024 * 1024)
3828 expected_content = ''.join(chr(i % 256) for i in range(0, size))
3829 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
3830 lfa = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id)
3831
3832=== modified file 'lib/lp/services/mail/tests/test_sendmail.py'
3833--- lib/lp/services/mail/tests/test_sendmail.py 2015-07-08 16:05:11 +0000
3834+++ lib/lp/services/mail/tests/test_sendmail.py 2018-01-02 16:24:23 +0000
3835@@ -270,8 +270,8 @@
3836 'from@example.com', to_addresses,
3837 subject, 'body', {'key': 'value'})
3838 ctrl.send()
3839- self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com')
3840- self.assertEquals(fake_mailer.to_addr, to_addresses)
3841+ self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com')
3842+ self.assertEqual(fake_mailer.to_addr, to_addresses)
3843 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject)
3844
3845 def test_sendmail_with_email_header(self):
3846@@ -290,16 +290,16 @@
3847 message.add_header('To', 'dest@example.com')
3848 with CaptureTimeline() as ctl:
3849 sendmail.sendmail(message)
3850- self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com')
3851- self.assertEquals(fake_mailer.to_addr, ['dest@example.com'])
3852+ self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com')
3853+ self.assertEqual(fake_mailer.to_addr, ['dest@example.com'])
3854 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject_str)
3855
3856 def checkTimelineHasOneMailAction(self, timeline, subject):
3857 actions = timeline.actions
3858- self.assertEquals(len(actions), 1)
3859+ self.assertEqual(len(actions), 1)
3860 a0 = actions[0]
3861- self.assertEquals(a0.category, 'sendmail')
3862- self.assertEquals(a0.detail, subject)
3863+ self.assertEqual(a0.category, 'sendmail')
3864+ self.assertEqual(a0.detail, subject)
3865 self.assertIsInstance(a0.detail, basestring)
3866
3867
3868
3869=== modified file 'lib/lp/services/oauth/tests/test_oauth.py'
3870--- lib/lp/services/oauth/tests/test_oauth.py 2016-01-26 15:14:01 +0000
3871+++ lib/lp/services/oauth/tests/test_oauth.py 2018-01-02 16:24:23 +0000
3872@@ -33,7 +33,7 @@
3873 screen won't probably find the new request token on the slave store.
3874 """
3875 zstorm = getUtility(IZStorm)
3876- self.assertEquals(
3877+ self.assertEqual(
3878 '%s-%s' % (MAIN_STORE, MASTER_FLAVOR),
3879 zstorm.get_name(self.class_._getStore()))
3880
3881
3882=== modified file 'lib/lp/services/oauth/tests/test_tokens.py'
3883--- lib/lp/services/oauth/tests/test_tokens.py 2016-01-26 15:14:01 +0000
3884+++ lib/lp/services/oauth/tests/test_tokens.py 2018-01-02 16:24:23 +0000
3885@@ -95,10 +95,10 @@
3886
3887 def test_getByKey(self):
3888 token, _ = self.consumer.newRequestToken()
3889- self.assertEquals(token, self.tokens.getByKey(token.key))
3890+ self.assertEqual(token, self.tokens.getByKey(token.key))
3891
3892 def test_getByKey_returns_none_for_unused_key(self):
3893- self.assertEquals(None, self.tokens.getByKey(u"no-such-token"))
3894+ self.assertIsNone(self.tokens.getByKey(u"no-such-token"))
3895
3896
3897 class TestRequestTokens(TestOAuth):
3898@@ -142,12 +142,10 @@
3899 def test_getRequestToken_for_wrong_consumer_returns_none(self):
3900 token_1, _ = self.consumer.newRequestToken()
3901 consumer_2 = self.factory.makeOAuthConsumer()
3902- self.assertEquals(
3903- None, consumer_2.getRequestToken(token_1.key))
3904+ self.assertIsNone(consumer_2.getRequestToken(token_1.key))
3905
3906 def test_getRequestToken_for_nonexistent_key_returns_none(self):
3907- self.assertEquals(
3908- None, self.consumer.getRequestToken(u"no-such-token"))
3909+ self.assertIsNone(self.consumer.getRequestToken(u"no-such-token"))
3910
3911 def test_isSecretValid(self):
3912 token, secret = self.consumer.newRequestToken()
3913@@ -161,16 +159,16 @@
3914 now = datetime.now(pytz.timezone('UTC'))
3915
3916 self.assertTrue(request_token.is_reviewed)
3917- self.assertEquals(request_token.person, self.person)
3918- self.assertEquals(request_token.permission,
3919- OAuthPermission.WRITE_PUBLIC)
3920+ self.assertEqual(request_token.person, self.person)
3921+ self.assertEqual(request_token.permission,
3922+ OAuthPermission.WRITE_PUBLIC)
3923
3924 self.assertTrue(request_token.date_created <= now)
3925
3926 # By default, reviewing a token does not set a context or
3927 # expiration date.
3928- self.assertEquals(request_token.context, None)
3929- self.assertEquals(request_token.date_expires, None)
3930+ self.assertIsNone(request_token.context)
3931+ self.assertIsNone(request_token.date_expires)
3932
3933 def test_token_review_as_unauthorized(self):
3934 request_token, _ = self.consumer.newRequestToken()
3935@@ -179,8 +177,8 @@
3936 # This token has been reviewed, but it may not be used for any
3937 # purpose.
3938 self.assertTrue(request_token.is_reviewed)
3939- self.assertEquals(request_token.permission,
3940- OAuthPermission.UNAUTHORIZED)
3941+ self.assertEqual(request_token.permission,
3942+ OAuthPermission.UNAUTHORIZED)
3943
3944 def test_review_with_expiration_date(self):
3945 # A request token may be associated with an expiration date
3946@@ -189,7 +187,7 @@
3947 request_token.review(
3948 self.person, OAuthPermission.WRITE_PUBLIC,
3949 date_expires=self.in_a_while)
3950- self.assertEquals(request_token.date_expires, self.in_a_while)
3951+ self.assertEqual(request_token.date_expires, self.in_a_while)
3952
3953 def test_review_with_expiration_date_in_the_past(self):
3954 # The expiration date, like the permission and context, is
3955@@ -203,7 +201,7 @@
3956 request_token.review(
3957 self.person, OAuthPermission.WRITE_PUBLIC,
3958 date_expires=self.a_long_time_ago)
3959- self.assertEquals(request_token.date_expires, self.a_long_time_ago)
3960+ self.assertEqual(request_token.date_expires, self.a_long_time_ago)
3961 self.assertFalse(request_token.is_expired)
3962
3963 def _reviewed_token_for_context(self, context_factory):
3964@@ -220,21 +218,21 @@
3965 # product.
3966 token, name = self._reviewed_token_for_context(
3967 self.factory.makeProduct)
3968- self.assertEquals(token.context.name, name)
3969+ self.assertEqual(token.context.name, name)
3970
3971 def test_review_with_project_group_context(self):
3972 # When reviewing a request token, the context may be set to a
3973 # project group.
3974 token, name = self._reviewed_token_for_context(
3975 self.factory.makeProject)
3976- self.assertEquals(token.context.name, name)
3977+ self.assertEqual(token.context.name, name)
3978
3979 def test_review_with_distrosourcepackage_context(self):
3980 # When reviewing a request token, the context may be set to a
3981 # distribution source package.
3982 token, name = self._reviewed_token_for_context(
3983 self.factory.makeDistributionSourcePackage)
3984- self.assertEquals(token.context.name, name)
3985+ self.assertEqual(token.context.name, name)
3986
3987 def test_expired_request_token_cant_be_reviewed(self):
3988 """An expired request token can't be reviewed."""
3989@@ -247,21 +245,21 @@
3990 def test_get_request_tokens_for_person(self):
3991 """It's possible to get a person's request tokens."""
3992 person = self.factory.makePerson()
3993- self.assertEquals(person.oauth_request_tokens.count(), 0)
3994+ self.assertEqual(person.oauth_request_tokens.count(), 0)
3995 for i in range(0, 3):
3996 self.factory.makeOAuthRequestToken(reviewed_by=person)
3997- self.assertEquals(person.oauth_request_tokens.count(), 3)
3998+ self.assertEqual(person.oauth_request_tokens.count(), 3)
3999
4000 def test_expired_request_token_disappears_from_list(self):
4001 person = self.factory.makePerson()
4002- self.assertEquals(person.oauth_request_tokens.count(), 0)
4003+ self.assertEqual(person.oauth_request_tokens.count(), 0)
4004 request_token = self.factory.makeOAuthRequestToken(reviewed_by=person)
4005- self.assertEquals(person.oauth_request_tokens.count(), 1)
4006+ self.assertEqual(person.oauth_request_tokens.count(), 1)
4007
4008 login_person(person)
4009 request_token.date_expires = self.a_long_time_ago
4010
4011- self.assertEquals(person.oauth_request_tokens.count(), 0)
4012+ self.assertEqual(person.oauth_request_tokens.count(), 0)
4013
4014
4015 class TestAccessTokens(TestOAuth):
4016@@ -292,18 +290,17 @@
4017 request_token, access_token, _ = (
4018 self._exchange_request_token_for_access_token())
4019
4020- self.assertEquals(request_token.consumer, access_token.consumer)
4021+ self.assertEqual(request_token.consumer, access_token.consumer)
4022
4023 # An access token inherits its permission from the request
4024 # token that created it. But an access token's .permission is
4025 # an AccessLevel object, not an OAuthPermission. The only real
4026 # difference is that there's no AccessLevel corresponding to
4027 # OAuthPermission.UNAUTHORIZED.
4028- self.assertEquals(
4029- access_token.permission, AccessLevel.WRITE_PRIVATE)
4030+ self.assertEqual(access_token.permission, AccessLevel.WRITE_PRIVATE)
4031
4032- self.assertEquals(None, access_token.context)
4033- self.assertEquals(None, access_token.date_expires)
4034+ self.assertIsNone(access_token.context)
4035+ self.assertIsNone(access_token.date_expires)
4036
4037 def test_access_token_field_inheritance(self):
4038 # Make sure that specific fields like context and expiration
4039@@ -314,15 +311,13 @@
4040 self.person, OAuthPermission.WRITE_PRIVATE,
4041 context=context, date_expires=self.in_a_while)
4042 access_token, _ = request_token.createAccessToken()
4043- self.assertEquals(request_token.context, access_token.context)
4044- self.assertEquals(
4045- request_token.date_expires, access_token.date_expires)
4046+ self.assertEqual(request_token.context, access_token.context)
4047+ self.assertEqual(request_token.date_expires, access_token.date_expires)
4048
4049 def test_request_token_disappears_when_exchanged(self):
4050 request_token, access_token, _ = (
4051 self._exchange_request_token_for_access_token())
4052- self.assertEquals(
4053- None, self.consumer.getRequestToken(request_token.key))
4054+ self.assertIsNone(self.consumer.getRequestToken(request_token.key))
4055
4056 def test_cant_exchange_unreviewed_request_token(self):
4057 # An unreviewed request token cannot be exchanged for an access token.
4058@@ -367,21 +362,21 @@
4059 def test_get_access_tokens_for_person(self):
4060 """It's possible to get a person's access tokens."""
4061 person = self.factory.makePerson()
4062- self.assertEquals(person.oauth_access_tokens.count(), 0)
4063+ self.assertEqual(person.oauth_access_tokens.count(), 0)
4064 for i in range(0, 3):
4065 self.factory.makeOAuthAccessToken(self.consumer, person)
4066- self.assertEquals(person.oauth_access_tokens.count(), 3)
4067+ self.assertEqual(person.oauth_access_tokens.count(), 3)
4068
4069 def test_expired_access_token_disappears_from_list(self):
4070 person = self.factory.makePerson()
4071- self.assertEquals(person.oauth_access_tokens.count(), 0)
4072+ self.assertEqual(person.oauth_access_tokens.count(), 0)
4073 access_token, _ = self.factory.makeOAuthAccessToken(
4074 self.consumer, person)
4075- self.assertEquals(person.oauth_access_tokens.count(), 1)
4076+ self.assertEqual(person.oauth_access_tokens.count(), 1)
4077
4078 login_person(access_token.person)
4079 access_token.date_expires = self.a_long_time_ago
4080- self.assertEquals(person.oauth_access_tokens.count(), 0)
4081+ self.assertEqual(person.oauth_access_tokens.count(), 0)
4082
4083
4084 class TestHelperFunctions(TestOAuth):
4085@@ -394,11 +389,11 @@
4086 # If there's no token for user/consumer key/permission/context,
4087 # one is created.
4088 person = self.factory.makePerson()
4089- self.assertEquals(person.oauth_access_tokens.count(), 0)
4090+ self.assertEqual(person.oauth_access_tokens.count(), 0)
4091 oauth_access_token_for(
4092 self.consumer.key, person, OAuthPermission.WRITE_PUBLIC,
4093 self.context)
4094- self.assertEquals(person.oauth_access_tokens.count(), 1)
4095+ self.assertEqual(person.oauth_access_tokens.count(), 1)
4096
4097 def test_oauth_access_token_string_permission(self):
4098 """You can pass in a string instead of an OAuthPermission."""
4099
4100=== modified file 'lib/lp/services/openid/tests/test_baseopenidstore.py'
4101--- lib/lp/services/openid/tests/test_baseopenidstore.py 2013-06-20 05:50:00 +0000
4102+++ lib/lp/services/openid/tests/test_baseopenidstore.py 2018-01-02 16:24:23 +0000
4103@@ -29,12 +29,12 @@
4104 'handle', 'secret', 42, 600, 'HMAC-SHA1'))
4105 db_assoc = IMasterStore(self.store.Association).get(
4106 self.store.Association, (u'server-url\xA9', u'handle'))
4107- self.assertEquals(db_assoc.server_url, u'server-url\xA9')
4108- self.assertEquals(db_assoc.handle, u'handle')
4109- self.assertEquals(db_assoc.secret, 'secret')
4110- self.assertEquals(db_assoc.issued, 42)
4111- self.assertEquals(db_assoc.lifetime, 600)
4112- self.assertEquals(db_assoc.assoc_type, u'HMAC-SHA1')
4113+ self.assertEqual(db_assoc.server_url, u'server-url\xA9')
4114+ self.assertEqual(db_assoc.handle, u'handle')
4115+ self.assertEqual(db_assoc.secret, 'secret')
4116+ self.assertEqual(db_assoc.issued, 42)
4117+ self.assertEqual(db_assoc.lifetime, 600)
4118+ self.assertEqual(db_assoc.assoc_type, u'HMAC-SHA1')
4119
4120 def test_storeAssociation_update_existing(self):
4121 self.store.storeAssociation('server-url', Association(
4122@@ -58,15 +58,15 @@
4123
4124 assoc = self.store.getAssociation('server-url', 'handle')
4125 self.assertIsInstance(assoc, Association)
4126- self.assertEquals(assoc.handle, 'handle')
4127- self.assertEquals(assoc.secret, 'secret')
4128- self.assertEquals(assoc.issued, timestamp)
4129- self.assertEquals(assoc.lifetime, 600)
4130- self.assertEquals(assoc.assoc_type, 'HMAC-SHA1')
4131+ self.assertEqual(assoc.handle, 'handle')
4132+ self.assertEqual(assoc.secret, 'secret')
4133+ self.assertEqual(assoc.issued, timestamp)
4134+ self.assertEqual(assoc.lifetime, 600)
4135+ self.assertEqual(assoc.assoc_type, 'HMAC-SHA1')
4136
4137 def test_getAssociation_unknown(self):
4138 assoc = self.store.getAssociation('server-url', 'unknown')
4139- self.assertEquals(assoc, None)
4140+ self.assertEqual(assoc, None)
4141
4142 def test_getAssociation_expired(self):
4143 lifetime = 600
4144@@ -76,7 +76,7 @@
4145 # The association is not returned because it is out of date.
4146 # Further more, it is removed from the database.
4147 assoc = self.store.getAssociation('server-url', 'handle')
4148- self.assertEquals(assoc, None)
4149+ self.assertEqual(assoc, None)
4150
4151 store = IMasterStore(self.store.Association)
4152 db_assoc = store.get(
4153@@ -99,13 +99,13 @@
4154 timestamp = int(time.time())
4155 self.store.storeAssociation('server-url', Association(
4156 'handle', 'secret', timestamp, 600, 'HMAC-SHA1'))
4157- self.assertEquals(
4158+ self.assertEqual(
4159 self.store.removeAssociation('server-url', 'handle'), True)
4160- self.assertEquals(
4161+ self.assertEqual(
4162 self.store.getAssociation('server-url', 'handle'), None)
4163
4164 def test_removeAssociation_unknown(self):
4165- self.assertEquals(
4166+ self.assertEqual(
4167 self.store.removeAssociation('server-url', 'unknown'),
4168 False)
4169
4170@@ -141,7 +141,7 @@
4171 self.store.storeAssociation('server-url', Association(
4172 'handle2', 'secret', timestamp, 200, 'HMAC-SHA1'))
4173
4174- self.assertEquals(self.store.cleanupAssociations(), 1)
4175+ self.assertEqual(self.store.cleanupAssociations(), 1)
4176
4177 # The second (non-expired) association is left behind.
4178 self.assertNotEqual(
4179
4180=== modified file 'lib/lp/services/profile/tests.py'
4181--- lib/lp/services/profile/tests.py 2013-04-10 09:12:32 +0000
4182+++ lib/lp/services/profile/tests.py 2018-01-02 16:24:23 +0000
4183@@ -209,7 +209,7 @@
4184 self.pushProfilingConfig(profiling_allowed='True')
4185 profile.start_request(self._get_start_event('/++profile++show/'))
4186 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4187- self.assertEquals(set(profile._profilers.actions), set(('show', )))
4188+ self.assertEqual(set(profile._profilers.actions), set(('show', )))
4189
4190 def test_optional_profiling_with_callgrind_request_starts_profiling(self):
4191 # If profiling is allowed and a request with the "callgrind" marker
4192@@ -217,7 +217,7 @@
4193 self.pushProfilingConfig(profiling_allowed='True')
4194 profile.start_request(self._get_start_event('/++profile++callgrind/'))
4195 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4196- self.assertEquals(
4197+ self.assertEqual(
4198 set(profile._profilers.actions), set(('callgrind', )))
4199
4200 def test_optional_profiling_with_log_request_starts_profiling(self):
4201@@ -226,7 +226,7 @@
4202 self.pushProfilingConfig(profiling_allowed='True')
4203 profile.start_request(self._get_start_event('/++profile++log/'))
4204 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4205- self.assertEquals(
4206+ self.assertEqual(
4207 set(profile._profilers.actions), set(('callgrind', )))
4208
4209 def test_optional_profiling_with_combined_request_starts_profiling(self):
4210@@ -236,7 +236,7 @@
4211 profile.start_request(
4212 self._get_start_event('/++profile++callgrind&show/'))
4213 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4214- self.assertEquals(
4215+ self.assertEqual(
4216 set(profile._profilers.actions), set(('callgrind', 'show')))
4217
4218 def test_optional_profiling_with_reversed_request_starts_profiling(self):
4219@@ -249,7 +249,7 @@
4220 profile.start_request(
4221 self._get_start_event('/++profile++show&callgrind'))
4222 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4223- self.assertEquals(
4224+ self.assertEqual(
4225 set(profile._profilers.actions), set(('callgrind', 'show')))
4226
4227 def test_optional_profiling_with_pstats_request_starts_profiling(self):
4228@@ -260,7 +260,7 @@
4229 self._get_start_event('/++profile++pstats/'))
4230 self.assertIsInstance(profile._profilers.profiler,
4231 profile.Profiler)
4232- self.assertEquals(set(profile._profilers.actions), set(('pstats',)))
4233+ self.assertEqual(set(profile._profilers.actions), set(('pstats',)))
4234
4235 def test_optional_profiling_with_log_pstats(self):
4236 # If profiling is allowed and a request with the "log" and "pstats"
4237@@ -270,7 +270,7 @@
4238 profile.start_request(
4239 self._get_start_event('/++profile++log&pstats/'))
4240 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4241- self.assertEquals(
4242+ self.assertEqual(
4243 set(profile._profilers.actions), set(('callgrind', 'pstats',)))
4244
4245 def test_optional_profiling_with_callgrind_pstats(self):
4246@@ -282,7 +282,7 @@
4247 self._get_start_event('/++profile++pstats&callgrind/'))
4248 self.assertIsInstance(profile._profilers.profiler,
4249 profile.Profiler)
4250- self.assertEquals(
4251+ self.assertEqual(
4252 set(profile._profilers.actions), set(('pstats', 'callgrind')))
4253
4254 def test_forced_profiling_registers_action(self):
4255@@ -291,7 +291,7 @@
4256 profiling_allowed='True', profile_all_requests='True')
4257 profile.start_request(self._get_start_event('/'))
4258 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4259- self.assertEquals(
4260+ self.assertEqual(
4261 set(profile._profilers.actions), set(('callgrind', )))
4262
4263 def test_optional_profiling_with_wrong_request_helps(self):
4264@@ -300,7 +300,7 @@
4265 self.pushProfilingConfig(profiling_allowed='True')
4266 profile.start_request(self._get_start_event('/++profile++/'))
4267 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
4268- self.assertEquals(set(profile._profilers.actions), set(('help', )))
4269+ self.assertEqual(set(profile._profilers.actions), set(('help', )))
4270
4271 def test_forced_profiling_with_wrong_request_helps(self):
4272 # If profiling is forced and a request with the marker URL segment
4273@@ -309,7 +309,7 @@
4274 profiling_allowed='True', profile_all_requests='True')
4275 profile.start_request(self._get_start_event('/++profile++/'))
4276 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
4277- self.assertEquals(
4278+ self.assertEqual(
4279 set(profile._profilers.actions), set(('help', 'callgrind')))
4280
4281 def test_memory_profile_start(self):
4282@@ -336,14 +336,14 @@
4283 self.pushProfilingConfig(profiling_allowed='True')
4284 profile.start_request(self._get_start_event('/++profile++sqltrace/'))
4285 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
4286- self.assertEquals(profile._profilers.actions, dict(sql=True))
4287+ self.assertEqual(profile._profilers.actions, dict(sql=True))
4288 self.assertEqual([], da.stop_sql_logging())
4289
4290 def test_sql_start(self):
4291 self.pushProfilingConfig(profiling_allowed='True')
4292 profile.start_request(self._get_start_event('/++profile++sql/'))
4293 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
4294- self.assertEquals(profile._profilers.actions, dict(sql=False))
4295+ self.assertEqual(profile._profilers.actions, dict(sql=False))
4296 self.assertEqual([], da.stop_sql_logging())
4297
4298 def test_sqltrace_filtered_start(self):
4299@@ -351,7 +351,7 @@
4300 profile.start_request(self._get_start_event(
4301 '/++profile++sqltrace:includes bugsubscription/'))
4302 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
4303- self.assertEquals(set(profile._profilers.actions), set(('sql', )))
4304+ self.assertEqual(set(profile._profilers.actions), set(('sql', )))
4305 data = profile._profilers.actions['sql']
4306 self.assertTrue(data['condition']('SELECT BUGSUBSCRIPTION FROM FOO'))
4307 self.assertEqual([], da.stop_sql_logging())
4308@@ -665,7 +665,7 @@
4309 self.pushProfilingConfig(profiling_allowed='True')
4310 request = self.endRequest('/++profile++show/no-such-file',
4311 KeyError('foo'))
4312- self.assertEquals(request.oops['type'], 'KeyError')
4313+ self.assertEqual(request.oops['type'], 'KeyError')
4314 response = self.getAddedResponse(request)
4315 self.assertIn('Exception-Type: KeyError', response)
4316 self.assertCleanProfilerState()
4317@@ -696,7 +696,7 @@
4318 self.assertTrue(profile._profilers.profiling)
4319 self.assertIsInstance(
4320 profile._profilers.profiler, profile.Profiler)
4321- self.assertEquals(
4322+ self.assertEqual(
4323 set(('show', 'callgrind', 'memory_profile_start')),
4324 set(profile._profilers.actions))
4325
4326
4327=== modified file 'lib/lp/services/session/tests/test_session.py'
4328--- lib/lp/services/session/tests/test_session.py 2013-06-20 05:50:00 +0000
4329+++ lib/lp/services/session/tests/test_session.py 2018-01-02 16:24:23 +0000
4330@@ -26,7 +26,7 @@
4331 for cls in [SessionData, SessionPkgData]:
4332 for obj in [cls, cls()]:
4333 store = adapter(obj)
4334- self.assert_(
4335+ self.assertTrue(
4336 'session' in store.get_database()._dsn,
4337 'Unknown store returned adapting %r to %r'
4338 % (obj, adapter))
4339
4340=== modified file 'lib/lp/services/tests/test_utils.py'
4341--- lib/lp/services/tests/test_utils.py 2014-08-29 01:34:04 +0000
4342+++ lib/lp/services/tests/test_utils.py 2018-01-02 16:24:23 +0000
4343@@ -200,7 +200,7 @@
4344 def function():
4345 pass
4346 function()
4347- self.assertEquals(['before', 'after'], calls)
4348+ self.assertEqual(['before', 'after'], calls)
4349
4350 def test_decorate_with_function(self):
4351 # The original function is actually called when we call the result of
4352@@ -211,7 +211,7 @@
4353 def function():
4354 calls.append('foo')
4355 function()
4356- self.assertEquals(['foo'], calls)
4357+ self.assertEqual(['foo'], calls)
4358
4359 def test_decorate_with_call_twice(self):
4360 # A function decorated with decorate_with can be called twice.
4361@@ -222,7 +222,7 @@
4362 calls.append('foo')
4363 function()
4364 function()
4365- self.assertEquals(['foo', 'foo'], calls)
4366+ self.assertEqual(['foo', 'foo'], calls)
4367
4368 def test_decorate_with_arguments(self):
4369 # decorate_with passes through arguments.
4370@@ -232,7 +232,7 @@
4371 def function(*args, **kwargs):
4372 calls.append((args, kwargs))
4373 function('foo', 'bar', qux=4)
4374- self.assertEquals([(('foo', 'bar'), {'qux': 4})], calls)
4375+ self.assertEqual([(('foo', 'bar'), {'qux': 4})], calls)
4376
4377 def test_decorate_with_name_and_docstring(self):
4378 # decorate_with preserves function names and docstrings.
4379
4380=== modified file 'lib/lp/services/twistedsupport/tests/test_processmonitor.py'
4381--- lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 10:54:31 +0000
4382+++ lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 16:24:23 +0000
4383@@ -370,7 +370,7 @@
4384 d = run_process_with_timeout(('true',))
4385
4386 def check_success_result(result):
4387- self.assertEquals(result, None, "Success result is not None.")
4388+ self.assertEqual(result, None, "Success result is not None.")
4389
4390 d.addCallback(check_success_result)
4391 return d
4392
4393=== modified file 'lib/lp/services/verification/browser/tests/test_logintoken.py'
4394--- lib/lp/services/verification/browser/tests/test_logintoken.py 2016-11-03 15:07:36 +0000
4395+++ lib/lp/services/verification/browser/tests/test_logintoken.py 2018-01-02 16:24:23 +0000
4396@@ -70,9 +70,9 @@
4397 harness.submit('cancel', {})
4398 actions = harness.view.actions.byname
4399 self.assertIn('field.actions.cancel', actions)
4400- self.assertEquals(actions['field.actions.cancel'].submitted(), True)
4401- self.assertEquals(harness.view.errors, [])
4402- self.assertEquals(harness.view.next_url, self.expected_next_url)
4403+ self.assertEqual(actions['field.actions.cancel'].submitted(), True)
4404+ self.assertEqual(harness.view.errors, [])
4405+ self.assertEqual(harness.view.next_url, self.expected_next_url)
4406
4407
4408 class TestClaimTeamView(TestCaseWithFactory):
4409@@ -101,9 +101,9 @@
4410 requester=self.claimer, requesteremail=None,
4411 email=self.claimee_email, tokentype=LoginTokenType.TEAMCLAIM)
4412 msgs = self._claimToken(token1)
4413- self.assertEquals([u'Team claimed successfully'], msgs)
4414+ self.assertEqual([u'Team claimed successfully'], msgs)
4415 msgs = self._claimToken(token2)
4416- self.assertEquals(
4417+ self.assertEqual(
4418 [u'claimee has already been converted to a team.'], msgs)
4419
4420
4421
4422=== modified file 'lib/lp/services/verification/tests/test_token_creation.py'
4423--- lib/lp/services/verification/tests/test_token_creation.py 2014-09-01 10:20:01 +0000
4424+++ lib/lp/services/verification/tests/test_token_creation.py 2018-01-02 16:24:23 +0000
4425@@ -12,4 +12,4 @@
4426
4427 def test_length(self):
4428 token = create_token(99)
4429- self.assertEquals(len(token), 99)
4430+ self.assertEqual(len(token), 99)
4431
4432=== modified file 'lib/lp/services/webapp/tests/test_authentication.py'
4433--- lib/lp/services/webapp/tests/test_authentication.py 2014-06-27 07:58:42 +0000
4434+++ lib/lp/services/webapp/tests/test_authentication.py 2018-01-02 16:24:23 +0000
4435@@ -38,15 +38,15 @@
4436 # included in the OAuth calculations.
4437 headers = OAuthRequest._split_header(
4438 'OAuth realm="foo", oauth_consumer_key="justtesting"')
4439- self.assertEquals(headers,
4440+ self.assertEqual(headers,
4441 {'oauth_consumer_key': 'justtesting'})
4442 headers = OAuthRequest._split_header(
4443 'OAuth oauth_consumer_key="justtesting"')
4444- self.assertEquals(headers,
4445+ self.assertEqual(headers,
4446 {'oauth_consumer_key': 'justtesting'})
4447 headers = OAuthRequest._split_header(
4448 'OAuth oauth_consumer_key="justtesting", realm="realm"')
4449- self.assertEquals(headers,
4450+ self.assertEqual(headers,
4451 {'oauth_consumer_key': 'justtesting'})
4452
4453
4454
4455=== modified file 'lib/lp/services/webapp/tests/test_authutility.py'
4456--- lib/lp/services/webapp/tests/test_authutility.py 2016-09-21 02:50:41 +0000
4457+++ lib/lp/services/webapp/tests/test_authutility.py 2018-01-02 16:24:23 +0000
4458@@ -91,8 +91,8 @@
4459
4460 def test_unauthenticatedPrincipal(self):
4461 authsvc, request = self._make(None, None)
4462- self.assert_(isinstance(authsvc.unauthenticatedPrincipal(),
4463- UnauthenticatedPrincipal))
4464+ self.assertTrue(isinstance(authsvc.unauthenticatedPrincipal(),
4465+ UnauthenticatedPrincipal))
4466
4467 def test_unauthorized(self):
4468 authsvc, request = self._make('bruce', 'test')
4469@@ -127,7 +127,7 @@
4470 exception = self.assertRaises(
4471 AssertionError, authsvc._authenticateUsingBasicAuth,
4472 credentials, request)
4473- self.assertEquals(
4474+ self.assertEqual(
4475 "Attempted to use basic auth when it is disabled",
4476 str(exception))
4477 finally:
4478
4479=== modified file 'lib/lp/services/webapp/tests/test_batching.py'
4480--- lib/lp/services/webapp/tests/test_batching.py 2016-02-05 16:51:12 +0000
4481+++ lib/lp/services/webapp/tests/test_batching.py 2018-01-02 16:24:23 +0000
4482@@ -459,7 +459,7 @@
4483 resultset = self.makeStormResultSet()
4484 range_factory = StormRangeFactory(resultset, self.logError)
4485 [where_clause] = range_factory.whereExpressions([Person.id], [1])
4486- self.assertEquals('(Person.id) > (1)', compile(where_clause))
4487+ self.assertEqual('(Person.id) > (1)', compile(where_clause))
4488
4489 def test_whereExpressions_desc(self):
4490 """For descending sort order, whereExpressions() returns the
4491@@ -469,7 +469,7 @@
4492 range_factory = StormRangeFactory(resultset, self.logError)
4493 [where_clause] = range_factory.whereExpressions(
4494 [Desc(Person.id)], [1])
4495- self.assertEquals('(Person.id) < (1)', compile(where_clause))
4496+ self.assertEqual('(Person.id) < (1)', compile(where_clause))
4497
4498 def test_whereExpressions__two_sort_columns_asc_asc(self):
4499 """If the ascending sort columns c1, c2 and the memo values
4500@@ -483,7 +483,7 @@
4501 range_factory = StormRangeFactory(resultset, self.logError)
4502 [where_clause] = range_factory.whereExpressions(
4503 [Person.id, Person.name], [1, 'foo'])
4504- self.assertEquals(
4505+ self.assertEqual(
4506 "(Person.id, Person.name) > (1, E'foo')", compile(where_clause))
4507
4508 def test_whereExpressions__two_sort_columns_desc_desc(self):
4509@@ -498,7 +498,7 @@
4510 range_factory = StormRangeFactory(resultset, self.logError)
4511 [where_clause] = range_factory.whereExpressions(
4512 [Desc(Person.id), Desc(Person.name)], [1, 'foo'])
4513- self.assertEquals(
4514+ self.assertEqual(
4515 "(Person.id, Person.name) < (1, E'foo')", compile(where_clause))
4516
4517 def test_whereExpressions__two_sort_columns_asc_desc(self):
4518@@ -516,10 +516,10 @@
4519 range_factory = StormRangeFactory(resultset, self.logError)
4520 [where_clause_1, where_clause_2] = range_factory.whereExpressions(
4521 [Person.id, Desc(Person.name)], [1, 'foo'])
4522- self.assertEquals(
4523+ self.assertEqual(
4524 "Person.id = ? AND ((Person.name) < (E'foo'))",
4525 compile(where_clause_1))
4526- self.assertEquals('(Person.id) > (1)', compile(where_clause_2))
4527+ self.assertEqual('(Person.id) > (1)', compile(where_clause_2))
4528
4529 def test_getSlice__forward_without_memo(self):
4530 resultset = self.makeStormResultSet()
4531
4532=== modified file 'lib/lp/services/webapp/tests/test_breadcrumbs.py'
4533--- lib/lp/services/webapp/tests/test_breadcrumbs.py 2015-08-04 11:17:11 +0000
4534+++ lib/lp/services/webapp/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
4535@@ -67,14 +67,14 @@
4536 # Breadcrumb adapter will use 'mainsite' as the rootsite.
4537 cookbook = Cookbook()
4538 self.assertIs(cookbook.rootsite, None)
4539- self.assertEquals(Breadcrumb(cookbook).rootsite, 'mainsite')
4540+ self.assertEqual(Breadcrumb(cookbook).rootsite, 'mainsite')
4541
4542 def test_urldata_rootsite_is_honored(self):
4543 # When a class' ICanonicalUrlData defines a rootsite, our Breadcrumb
4544 # adapter will use it.
4545 cookbook = Cookbook()
4546 cookbook.rootsite = 'cooking'
4547- self.assertEquals(Breadcrumb(cookbook).rootsite, 'cooking')
4548+ self.assertEqual(Breadcrumb(cookbook).rootsite, 'cooking')
4549
4550
4551 class TestExtraBreadcrumbForLeafPageOnHierarchyView(BaseBreadcrumbTestCase):
4552@@ -94,20 +94,20 @@
4553 def test_non_default_page(self):
4554 crumbs = self.getBreadcrumbsForObject(self.product, '+download')
4555 downloads_url = "%s/+download" % self.product_url
4556- self.assertEquals(
4557+ self.assertEqual(
4558 [self.product_url, downloads_url],
4559 [crumb.url for crumb in crumbs])
4560- self.assertEquals(
4561+ self.assertEqual(
4562 '%s project files' % self.product.displayname,
4563 crumbs[-1].text)
4564
4565 def test_facet_default_page(self):
4566 crumbs = self.getBreadcrumbsForObject(self.product, '+bugs')
4567 bugs_url = self.product_url.replace('launchpad', 'bugs.launchpad')
4568- self.assertEquals(
4569+ self.assertEqual(
4570 [self.product_url, bugs_url],
4571 [crumb.url for crumb in crumbs])
4572- self.assertEquals('Bugs', crumbs[-1].text)
4573+ self.assertEqual('Bugs', crumbs[-1].text)
4574
4575 def test_zope_i18n_Messages_are_interpolated(self):
4576 # Views can use zope.i18nmessageid.Message as their title when they
4577@@ -124,7 +124,7 @@
4578 request.traversed_objects = [self.product, test_view]
4579 hierarchy_view = Hierarchy(test_view, request)
4580 [breadcrumb] = hierarchy_view.makeBreadcrumbsForRequestedPage()
4581- self.assertEquals(breadcrumb.text, 'breadcrumb test')
4582+ self.assertEqual(breadcrumb.text, 'breadcrumb test')
4583
4584
4585 class TestExtraFacetBreadcrumbsOnHierarchyView(BaseBreadcrumbTestCase):
4586@@ -151,14 +151,14 @@
4587
4588 def test_root_on_mainsite(self):
4589 crumbs = self.getBreadcrumbsForUrl('http://launchpad.dev/')
4590- self.assertEquals(crumbs, [])
4591+ self.assertEqual(crumbs, [])
4592
4593 def test_product_on_mainsite(self):
4594 self.assertBreadcrumbUrls([self.product_url], self.product)
4595
4596 def test_root_on_vhost(self):
4597 crumbs = self.getBreadcrumbsForUrl('http://bugs.launchpad.dev/')
4598- self.assertEquals(crumbs, [])
4599+ self.assertEqual(crumbs, [])
4600
4601 def test_product_on_vhost(self):
4602 self.assertBreadcrumbUrls(
4603
4604=== modified file 'lib/lp/services/webapp/tests/test_error.py'
4605--- lib/lp/services/webapp/tests/test_error.py 2017-01-13 13:35:31 +0000
4606+++ lib/lp/services/webapp/tests/test_error.py 2018-01-02 16:24:23 +0000
4607@@ -56,17 +56,16 @@
4608 def test_without_oops_id(self):
4609 request = LaunchpadTestRequest()
4610 SystemErrorView(Exception(), request)
4611- self.assertEquals(500, request.response.getStatus())
4612- self.assertEquals(
4613- None,
4614+ self.assertEqual(500, request.response.getStatus())
4615+ self.assertIsNone(
4616 request.response.getHeader('X-Lazr-OopsId', literal=True))
4617
4618 def test_with_oops_id(self):
4619 request = LaunchpadTestRequest()
4620 request.oopsid = 'OOPS-1X1'
4621 SystemErrorView(Exception(), request)
4622- self.assertEquals(500, request.response.getStatus())
4623- self.assertEquals(
4624+ self.assertEqual(500, request.response.getStatus())
4625+ self.assertEqual(
4626 'OOPS-1X1',
4627 request.response.getHeader('X-Lazr-OopsId', literal=True))
4628
4629@@ -224,7 +223,7 @@
4630 def test_disconnectionerror_view(self):
4631 request = LaunchpadTestRequest()
4632 DisconnectionErrorView(DisconnectionError(), request)
4633- self.assertEquals(503, request.response.getStatus())
4634+ self.assertEqual(503, request.response.getStatus())
4635
4636 def test_operationalerror_view_integration(self):
4637 # Test setup.
4638@@ -246,4 +245,4 @@
4639 def test_operationalerror_view(self):
4640 request = LaunchpadTestRequest()
4641 OperationalErrorView(OperationalError(), request)
4642- self.assertEquals(503, request.response.getStatus())
4643+ self.assertEqual(503, request.response.getStatus())
4644
4645=== modified file 'lib/lp/services/webapp/tests/test_haproxy.py'
4646--- lib/lp/services/webapp/tests/test_haproxy.py 2012-09-28 06:01:02 +0000
4647+++ lib/lp/services/webapp/tests/test_haproxy.py 2018-01-02 16:24:23 +0000
4648@@ -32,7 +32,7 @@
4649
4650 def test_HAProxyStatusView_all_good_returns_200(self):
4651 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
4652- self.assertEquals(200, result.getStatus())
4653+ self.assertEqual(200, result.getStatus())
4654
4655 def test_authenticated_HAProxyStatusView_works(self):
4656 # We don't use authenticated requests, but this keeps us from
4657@@ -41,12 +41,12 @@
4658 u'GET /+haproxy HTTP/1.0\n'
4659 u'Authorization: Basic Zm9vLmJhckBjYW5vbmljYWwuY29tOnRlc3Q=\n',
4660 handle_errors=False)
4661- self.assertEquals(200, result.getStatus())
4662+ self.assertEqual(200, result.getStatus())
4663
4664 def test_HAProxyStatusView_going_down_returns_500(self):
4665 haproxy.set_going_down_flag(True)
4666 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
4667- self.assertEquals(500, result.getStatus())
4668+ self.assertEqual(500, result.getStatus())
4669
4670 def test_haproxy_url_uses_DatabaseBlocked_policy(self):
4671 request = LaunchpadTestRequest(environ={'PATH_INFO': '/+haproxy'})
4672@@ -56,9 +56,9 @@
4673 def test_switch_going_down_flag(self):
4674 haproxy.set_going_down_flag(True)
4675 haproxy.switch_going_down_flag()
4676- self.assertEquals(False, haproxy.going_down_flag)
4677+ self.assertEqual(False, haproxy.going_down_flag)
4678 haproxy.switch_going_down_flag()
4679- self.assertEquals(True, haproxy.going_down_flag)
4680+ self.assertEqual(True, haproxy.going_down_flag)
4681
4682 def test_HAProxyStatusView_status_code_is_configurable(self):
4683 config.push('change_haproxy_status_code', dedent('''
4684@@ -68,4 +68,4 @@
4685 self.addCleanup(config.pop, 'change_haproxy_status_code')
4686 haproxy.set_going_down_flag(True)
4687 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
4688- self.assertEquals(499, result.getStatus())
4689+ self.assertEqual(499, result.getStatus())
4690
4691=== modified file 'lib/lp/services/webapp/tests/test_login.py'
4692--- lib/lp/services/webapp/tests/test_login.py 2016-05-27 09:57:43 +0000
4693+++ lib/lp/services/webapp/tests/test_login.py 2018-01-02 16:24:23 +0000
4694@@ -242,9 +242,9 @@
4695 person.account, email=test_email)
4696 self.assertTrue(view.login_called)
4697 response = view.request.response
4698- self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())
4699- self.assertEquals(view.request.form['starting_url'],
4700- response.getHeader('Location'))
4701+ self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
4702+ self.assertEqual(view.request.form['starting_url'],
4703+ response.getHeader('Location'))
4704 # The 'last_write' flag was not updated (unlike in the other test
4705 # methods) because in this case we didn't have to create a
4706 # Person/Account entry, so it's ok for further requests to hit the
4707@@ -267,7 +267,7 @@
4708 'starting_url': 'http://launchpad.dev/after-login',
4709 'foo': 'bar',
4710 }
4711- self.assertEquals(params, expected_params)
4712+ self.assertEqual(params, expected_params)
4713
4714 def test_gather_params_with_unicode_data(self):
4715 # If the currently requested URL includes a query string, the
4716@@ -281,7 +281,7 @@
4717 environ={'PATH_INFO': '/'})
4718 view = OpenIDCallbackView(context=None, request=None)
4719 params = view._gather_params(request)
4720- self.assertEquals(params['foo'], u'\u16dd')
4721+ self.assertEqual(params['foo'], u'\u16dd')
4722
4723 def test_unexpected_multivalue_fields(self):
4724 # The parameter gatering doesn't expect to find multi-valued form
4725@@ -303,7 +303,7 @@
4726 form={'starting_url': 'http://launchpad.dev/after-login'})
4727 view = OpenIDCallbackView(context=None, request=None)
4728 url = view._get_requested_url(request)
4729- self.assertEquals(url, 'http://example.com?foo=bar')
4730+ self.assertEqual(url, 'http://example.com?foo=bar')
4731
4732 def test_open_id_callback_handles_query_string(self):
4733 # If the currently requested URL includes a query string, the
4734@@ -317,13 +317,13 @@
4735 environ={'PATH_INFO': '/'})
4736 view = FakeConsumerOpenIDCallbackView(object(), request)
4737 view.initialize()
4738- self.assertEquals(
4739+ self.assertEqual(
4740 view.fake_consumer.params,
4741 {
4742 'starting_url': 'http://launchpad.dev/after-login',
4743 'foo': 'bar',
4744 })
4745- self.assertEquals(
4746+ self.assertEqual(
4747 view.fake_consumer.requested_url, 'http://example.com?foo=bar')
4748
4749 def test_unseen_identity(self):
4750@@ -343,12 +343,12 @@
4751 self.assertTrue(view.login_called)
4752 account = account_set.getByOpenIDIdentifier(identifier)
4753 self.assertIsNot(None, account)
4754- self.assertEquals(AccountStatus.ACTIVE, account.status)
4755+ self.assertEqual(AccountStatus.ACTIVE, account.status)
4756 person = IPerson(account, None)
4757 self.assertIsNot(None, person)
4758- self.assertEquals('Foo User', person.displayname)
4759- self.assertEquals('non-existent@example.com',
4760- removeSecurityProxy(person.preferredemail).email)
4761+ self.assertEqual('Foo User', person.displayname)
4762+ self.assertEqual('non-existent@example.com',
4763+ removeSecurityProxy(person.preferredemail).email)
4764
4765 # We also update the last_write flag in the session, to make sure
4766 # further requests use the master DB and thus see the newly created
4767@@ -382,12 +382,12 @@
4768 identifiers = [i.identifier for i in account.openid_identifiers]
4769 self.assertIn(identifier, identifiers)
4770
4771- self.assertEquals(AccountStatus.ACTIVE, account.status)
4772- self.assertEquals(
4773+ self.assertEqual(AccountStatus.ACTIVE, account.status)
4774+ self.assertEqual(
4775 email, removeSecurityProxy(person.preferredemail).email)
4776 person = IPerson(account, None)
4777 self.assertIsNot(None, person)
4778- self.assertEquals('Test account', person.displayname)
4779+ self.assertEqual('Test account', person.displayname)
4780
4781 # We also update the last_write flag in the session, to make sure
4782 # further requests use the master DB and thus see the newly created
4783@@ -411,11 +411,11 @@
4784 view, html = self._createAndRenderView(openid_response)
4785 self.assertTrue(view.login_called)
4786 response = view.request.response
4787- self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())
4788- self.assertEquals(view.request.form['starting_url'],
4789- response.getHeader('Location'))
4790- self.assertEquals(AccountStatus.ACTIVE, person.account.status)
4791- self.assertEquals(email, person.preferredemail.email)
4792+ self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
4793+ self.assertEqual(view.request.form['starting_url'],
4794+ response.getHeader('Location'))
4795+ self.assertEqual(AccountStatus.ACTIVE, person.account.status)
4796+ self.assertEqual(email, person.preferredemail.email)
4797 # We also update the last_write flag in the session, to make sure
4798 # further requests use the master DB and thus see the newly created
4799 # stuff.
4800@@ -440,8 +440,8 @@
4801 with SRegResponse_fromSuccessResponse_stubbed():
4802 view, html = self._createAndRenderView(openid_response)
4803 self.assertTrue(view.login_called)
4804- self.assertEquals(AccountStatus.ACTIVE, person.account.status)
4805- self.assertEquals(email, person.preferredemail.email)
4806+ self.assertEqual(AccountStatus.ACTIVE, person.account.status)
4807+ self.assertEqual(email, person.preferredemail.email)
4808 # We also update the last_write flag in the session, to make sure
4809 # further requests use the master DB and thus see the newly created
4810 # stuff.
4811@@ -579,9 +579,9 @@
4812 view_class=StubbedOpenIDCallbackViewLoggedIn)
4813 self.assertFalse(view.login_called)
4814 response = view.request.response
4815- self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())
4816- self.assertEquals(view.request.form['starting_url'],
4817- response.getHeader('Location'))
4818+ self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
4819+ self.assertEqual(view.request.form['starting_url'],
4820+ response.getHeader('Location'))
4821 notification_msg = view.request.response.notifications[0].message
4822 expected_msg = ('Your authentication failed but you were already '
4823 'logged into Launchpad')
4824@@ -626,9 +626,9 @@
4825 form={'starting_url': self.STARTING_URL})
4826 view.initialize()
4827 view._redirect()
4828- self.assertEquals(
4829+ self.assertEqual(
4830 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
4831- self.assertEquals(
4832+ self.assertEqual(
4833 view.request.response.getHeader('Location'), self.STARTING_URL)
4834
4835 def test_open_id_callback_redirect_from_post(self):
4836@@ -640,9 +640,9 @@
4837 QUERY_STRING='starting_url=' + self.STARTING_URL)
4838 view.initialize()
4839 view._redirect()
4840- self.assertEquals(
4841+ self.assertEqual(
4842 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
4843- self.assertEquals(
4844+ self.assertEqual(
4845 view.request.response.getHeader('Location'), self.STARTING_URL)
4846
4847 def test_openid_callback_redirect_fallback(self):
4848@@ -652,9 +652,9 @@
4849 view.request = LaunchpadTestRequest(SERVER_URL=self.APPLICATION_URL)
4850 view.initialize()
4851 view._redirect()
4852- self.assertEquals(
4853+ self.assertEqual(
4854 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
4855- self.assertEquals(
4856+ self.assertEqual(
4857 view.request.response.getHeader('Location'), self.APPLICATION_URL)
4858
4859
4860@@ -694,7 +694,7 @@
4861 self.assertIn('body onload', browser.contents)
4862 browser.getControl('Continue').click()
4863
4864- self.assertEquals('Login', browser.title)
4865+ self.assertEqual('Login', browser.title)
4866 fill_login_form_and_submit(browser, 'test@canonical.com')
4867 login_status = extract_text(
4868 find_tag_by_id(browser.contents, 'logincontrol'))
4869@@ -710,10 +710,10 @@
4870 replay_browser.open(callback_url)
4871 login_status = extract_text(
4872 find_tag_by_id(replay_browser.contents, 'logincontrol'))
4873- self.assertEquals('Log in / Register', login_status)
4874+ self.assertEqual('Log in / Register', login_status)
4875 error_msg = find_tags_by_class(replay_browser.contents, 'error')[0]
4876- self.assertEquals('Nonce already used or out of range',
4877- extract_text(error_msg))
4878+ self.assertEqual('Nonce already used or out of range',
4879+ extract_text(error_msg))
4880
4881
4882 class FakeHTTPResponse:
4883@@ -743,8 +743,8 @@
4884 browser = TestBrowser()
4885 self.assertRaises(urllib2.HTTPError,
4886 browser.open, 'http://launchpad.dev/+login')
4887- self.assertEquals('503 Service Unavailable',
4888- browser.headers.get('status'))
4889+ self.assertEqual('503 Service Unavailable',
4890+ browser.headers.get('status'))
4891 self.assertTrue(
4892 'OpenID Provider Is Unavailable at This Time' in browser.contents)
4893
4894@@ -845,10 +845,10 @@
4895 self.assertIsNot(None, extensions)
4896 sreg_extension = extensions[0]
4897 self.assertIsInstance(sreg_extension, sreg.SRegRequest)
4898- self.assertEquals(['email', 'fullname'],
4899- sorted(sreg_extension.allRequestedFields()))
4900- self.assertEquals(sorted(sreg_extension.required),
4901- sorted(sreg_extension.allRequestedFields()))
4902+ self.assertEqual(['email', 'fullname'],
4903+ sorted(sreg_extension.allRequestedFields()))
4904+ self.assertEqual(sorted(sreg_extension.required),
4905+ sorted(sreg_extension.allRequestedFields()))
4906
4907 def test_pape_extension_added_with_reauth_query(self):
4908 # We can signal that a request should be reauthenticated via
4909@@ -928,8 +928,8 @@
4910 # At this point browser.contents contains a hidden form which would've
4911 # been auto-submitted if we had in-browser JS support, but since we
4912 # don't we can easily inspect what's in the form.
4913- self.assertEquals('%s/' % browser.rooturl,
4914- browser.getControl(name='openid.realm').value)
4915+ self.assertEqual('%s/' % browser.rooturl,
4916+ browser.getControl(name='openid.realm').value)
4917
4918 def test_realm_for_vhosts(self):
4919 browser = Browser()
4920@@ -937,9 +937,9 @@
4921 # At this point browser.contents contains a hidden form which would've
4922 # been auto-submitted if we had in-browser JS support, but since we
4923 # don't we can easily inspect what's in the form.
4924- self.assertEquals('%s'
4925- % self.layer.appserver_root_url(ensureSlash=True),
4926- browser.getControl(name='openid.realm').value)
4927+ self.assertEqual('%s'
4928+ % self.layer.appserver_root_url(ensureSlash=True),
4929+ browser.getControl(name='openid.realm').value)
4930
4931
4932 def test_suite():
4933
4934=== modified file 'lib/lp/services/webapp/tests/test_login_account.py'
4935--- lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 10:54:31 +0000
4936+++ lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 16:24:23 +0000
4937@@ -119,23 +119,22 @@
4938
4939 # The view should have redirected us, with no actual response body.
4940
4941- self.assertEquals(self.request.response.getStatus(), 302)
4942- self.assertEquals(result, '')
4943+ self.assertEqual(self.request.response.getStatus(), 302)
4944+ self.assertEqual(result, '')
4945
4946 # We are redirecting to Loggerhead, to ask it to logout.
4947
4948 location = lazr.uri.URI(self.request.response.getHeader('location'))
4949- self.assertEquals(location.host, 'bazaar.launchpad.dev')
4950- self.assertEquals(location.scheme, 'https')
4951- self.assertEquals(location.path, '/+logout')
4952+ self.assertEqual(location.host, 'bazaar.launchpad.dev')
4953+ self.assertEqual(location.scheme, 'https')
4954+ self.assertEqual(location.path, '/+logout')
4955
4956 # That page should then redirect to our OpenId provider to logout,
4957 # which we provide in our query string. See
4958 # launchpad_loggerhead.tests.TestLogout for the pertinent tests.
4959
4960 query = cgi.parse_qs(location.query)
4961- self.assertEquals(
4962- query['next_to'][0], 'http://testopenid.dev/+logout')
4963+ self.assertEqual(query['next_to'][0], 'http://testopenid.dev/+logout')
4964
4965 def test_logging_in_and_logging_out_the_old_way(self):
4966 # A test showing that we can authenticate a request that had the
4967
4968=== modified file 'lib/lp/services/webapp/tests/test_menu.py'
4969--- lib/lp/services/webapp/tests/test_menu.py 2013-02-06 04:22:43 +0000
4970+++ lib/lp/services/webapp/tests/test_menu.py 2018-01-02 16:24:23 +0000
4971@@ -51,17 +51,17 @@
4972 newInteraction()
4973 menu = TestMenu(object())
4974 menu._get_link('test_link')
4975- self.assertEquals(menu.times_called, 1)
4976+ self.assertEqual(menu.times_called, 1)
4977 menu._get_link('test_link')
4978- self.assertEquals(menu.times_called, 2)
4979+ self.assertEqual(menu.times_called, 2)
4980
4981 def test_cache_when_there_is_a_request(self):
4982 login(ANONYMOUS)
4983 menu = TestMenu(object())
4984 menu._get_link('test_link')
4985- self.assertEquals(menu.times_called, 1)
4986+ self.assertEqual(menu.times_called, 1)
4987 menu._get_link('test_link')
4988- self.assertEquals(menu.times_called, 1)
4989+ self.assertEqual(menu.times_called, 1)
4990
4991 def test_correct_value_is_cached(self):
4992 login(ANONYMOUS)
4993@@ -69,7 +69,7 @@
4994 link = menu._get_link('test_link')
4995 request = get_current_browser_request()
4996 cache = request.annotations.get(MENU_ANNOTATION_KEY)
4997- self.assertEquals([link], cache.values())
4998+ self.assertEqual([link], cache.values())
4999
5000 def test_cache_key_is_unique(self):
The diff has been truncated for viewing.