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
=== modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py'
--- lib/lp/answers/browser/tests/test_breadcrumbs.py 2017-10-25 10:02:12 +0000
+++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
@@ -37,21 +37,21 @@
37 crumbs = self.getBreadcrumbsForObject(37 crumbs = self.getBreadcrumbsForObject(
38 self.product, rootsite='answers')38 self.product, rootsite='answers')
39 last_crumb = crumbs[-1]39 last_crumb = crumbs[-1]
40 self.assertEquals(last_crumb.url, self.product_questions_url)40 self.assertEqual(last_crumb.url, self.product_questions_url)
41 self.assertEquals(last_crumb.text, 'Questions')41 self.assertEqual(last_crumb.text, 'Questions')
4242
43 def test_project(self):43 def test_project(self):
44 crumbs = self.getBreadcrumbsForObject(44 crumbs = self.getBreadcrumbsForObject(
45 self.project, rootsite='answers')45 self.project, rootsite='answers')
46 last_crumb = crumbs[-1]46 last_crumb = crumbs[-1]
47 self.assertEquals(last_crumb.url, self.project_questions_url)47 self.assertEqual(last_crumb.url, self.project_questions_url)
48 self.assertEquals(last_crumb.text, 'Questions')48 self.assertEqual(last_crumb.text, 'Questions')
4949
50 def test_person(self):50 def test_person(self):
51 crumbs = self.getBreadcrumbsForObject(self.person, rootsite='answers')51 crumbs = self.getBreadcrumbsForObject(self.person, rootsite='answers')
52 last_crumb = crumbs[-1]52 last_crumb = crumbs[-1]
53 self.assertEquals(last_crumb.url, self.person_questions_url)53 self.assertEqual(last_crumb.url, self.person_questions_url)
54 self.assertEquals(last_crumb.text, 'Questions')54 self.assertEqual(last_crumb.text, 'Questions')
5555
5656
57class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):57class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):
@@ -68,11 +68,11 @@
68 self.question_url = canonical_url(self.question, rootsite='answers')68 self.question_url = canonical_url(self.question, rootsite='answers')
69 crumbs = self.getBreadcrumbsForObject(self.question)69 crumbs = self.getBreadcrumbsForObject(self.question)
70 last_crumb = crumbs[-1]70 last_crumb = crumbs[-1]
71 self.assertEquals(last_crumb.text, 'Question #%d' % self.question.id)71 self.assertEqual(last_crumb.text, 'Question #%d' % self.question.id)
7272
73 def test_faq(self):73 def test_faq(self):
74 self.faq = self.factory.makeFAQ(target=self.product, title='Seedless')74 self.faq = self.factory.makeFAQ(target=self.product, title='Seedless')
75 self.faq_url = canonical_url(self.faq, rootsite='answers')75 self.faq_url = canonical_url(self.faq, rootsite='answers')
76 crumbs = self.getBreadcrumbsForObject(self.faq)76 crumbs = self.getBreadcrumbsForObject(self.faq)
77 last_crumb = crumbs[-1]77 last_crumb = crumbs[-1]
78 self.assertEquals(last_crumb.text, 'FAQ #%d' % self.faq.id)78 self.assertEqual(last_crumb.text, 'FAQ #%d' % self.faq.id)
7979
=== modified file 'lib/lp/answers/tests/test_publisher.py'
--- lib/lp/answers/tests/test_publisher.py 2017-10-25 10:02:12 +0000
+++ lib/lp/answers/tests/test_publisher.py 2018-01-02 16:24:23 +0000
@@ -47,6 +47,6 @@
47 # Responses to requests to answers pages have the 'Vary' header set to47 # Responses to requests to answers pages have the 'Vary' header set to
48 # include Accept-Language.48 # include Accept-Language.
49 request = AnswersBrowserRequest(io.StringIO(''), {})49 request = AnswersBrowserRequest(io.StringIO(''), {})
50 self.assertEquals(50 self.assertEqual(
51 request.response.getHeader('Vary'),51 request.response.getHeader('Vary'),
52 'Cookie, Authorization, Accept-Language')52 'Cookie, Authorization, Accept-Language')
5353
=== modified file 'lib/lp/answers/tests/test_question_notifications.py'
--- lib/lp/answers/tests/test_question_notifications.py 2017-10-25 10:02:12 +0000
+++ lib/lp/answers/tests/test_question_notifications.py 2018-01-02 16:24:23 +0000
@@ -102,7 +102,7 @@
102102
103 def test_getSubject(self):103 def test_getSubject(self):
104 """getSubject() when there is no message added to the question."""104 """getSubject() when there is no message added to the question."""
105 self.assertEquals(105 self.assertEqual(
106 'Re: [Question #1]: Question title',106 'Re: [Question #1]: Question title',
107 self.notification.getSubject())107 self.notification.getSubject())
108108
109109
=== modified file 'lib/lp/answers/tests/test_question_workflow.py'
--- lib/lp/answers/tests/test_question_workflow.py 2018-01-02 10:54:31 +0000
+++ lib/lp/answers/tests/test_question_workflow.py 2018-01-02 16:24:23 +0000
@@ -242,19 +242,18 @@
242 """242 """
243 self.assertTrue(verifyObject(IQuestionMessage, message))243 self.assertTrue(verifyObject(IQuestionMessage, message))
244244
245 self.assertEquals("Re: Help!", message.subject)245 self.assertEqual("Re: Help!", message.subject)
246 self.assertEquals(expected_owner, message.owner)246 self.assertEqual(expected_owner, message.owner)
247 self.assertEquals(expected_action, message.action)247 self.assertEqual(expected_action, message.action)
248 self.assertEquals(expected_status, message.new_status)248 self.assertEqual(expected_status, message.new_status)
249249
250 self.assertEquals(message, self.question.messages[-1])250 self.assertEqual(message, self.question.messages[-1])
251 self.assertEquals(expected_status, self.question.status)251 self.assertEqual(expected_status, self.question.status)
252252
253 if expected_owner == self.question.owner:253 if expected_owner == self.question.owner:
254 self.assertEquals(message.datecreated,254 self.assertEqual(message.datecreated, self.question.datelastquery)
255 self.question.datelastquery)
256 else:255 else:
257 self.assertEquals(256 self.assertEqual(
258 message.datecreated, self.question.datelastresponse)257 message.datecreated, self.question.datelastresponse)
259258
260 def checkTransitionEvents(self, message, edited_fields, status_name):259 def checkTransitionEvents(self, message, edited_fields, status_name):
@@ -487,9 +486,9 @@
487 """Check additional attributes set when the owner gives the486 """Check additional attributes set when the owner gives the
488 answers.487 answers.
489 """488 """
490 self.assertEquals(None, self.question.answer)489 self.assertIsNone(self.question.answer)
491 self.assertEquals(self.owner, self.question.answerer)490 self.assertEqual(self.owner, self.question.answerer)
492 self.assertEquals(message.datecreated, self.question.date_solved)491 self.assertEqual(message.datecreated, self.question.date_solved)
493492
494 self._testValidTransition(493 self._testValidTransition(
495 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,494 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
@@ -538,7 +537,7 @@
538 # changes based on departure state.537 # changes based on departure state.
539 def checkFAQ(message):538 def checkFAQ(message):
540 """Check that the FAQ attribute was set correctly."""539 """Check that the FAQ attribute was set correctly."""
541 self.assertEquals(self.question.faq, self.faq)540 self.assertEqual(self.question.faq, self.faq)
542541
543 self._testValidTransition(542 self._testValidTransition(
544 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,543 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
@@ -559,8 +558,8 @@
559 answers.558 answers.
560 """559 """
561 checkFAQ(message)560 checkFAQ(message)
562 self.assertEquals(self.owner, self.question.answerer)561 self.assertEqual(self.owner, self.question.answerer)
563 self.assertEquals(message.datecreated, self.question.date_solved)562 self.assertEqual(message.datecreated, self.question.date_solved)
564563
565 self._testValidTransition(564 self._testValidTransition(
566 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,565 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
@@ -642,9 +641,9 @@
642641
643 def checkAnswerMessage(message):642 def checkAnswerMessage(message):
644 # Check the attributes that are set when an answer is confirmed.643 # Check the attributes that are set when an answer is confirmed.
645 self.assertEquals(answer_message, self.question.answer)644 self.assertEqual(answer_message, self.question.answer)
646 self.assertEquals(self.answerer, self.question.answerer)645 self.assertEqual(self.answerer, self.question.answerer)
647 self.assertEquals(message.datecreated, self.question.date_solved)646 self.assertEqual(message.datecreated, self.question.date_solved)
648647
649 self._testValidTransition(648 self._testValidTransition(
650 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,649 [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO,
@@ -672,13 +671,13 @@
672 self.question.giveAnswer(671 self.question.giveAnswer(
673 self.owner, 'I solved my own problem.',672 self.owner, 'I solved my own problem.',
674 datecreated=self.nowPlus(2))673 datecreated=self.nowPlus(2))
675 self.assertEquals(self.question.status, QuestionStatus.SOLVED)674 self.assertEqual(self.question.status, QuestionStatus.SOLVED)
676675
677 def checkAnswerMessage(message):676 def checkAnswerMessage(message):
678 # Check the attributes that are set when an answer is confirmed.677 # Check the attributes that are set when an answer is confirmed.
679 self.assertEquals(answer_message, self.question.answer)678 self.assertEqual(answer_message, self.question.answer)
680 self.assertEquals(self.answerer, self.question.answerer)679 self.assertEqual(self.answerer, self.question.answerer)
681 self.assertEquals(message.datecreated, self.question.date_solved)680 self.assertEqual(message.datecreated, self.question.date_solved)
682681
683 self._testValidTransition(682 self._testValidTransition(
684 [QuestionStatus.SOLVED],683 [QuestionStatus.SOLVED],
@@ -765,7 +764,7 @@
765 self.question.giveAnswer(764 self.question.giveAnswer(
766 self.owner, 'I solved my own problem.',765 self.owner, 'I solved my own problem.',
767 datecreated=self.nowPlus(0))766 datecreated=self.nowPlus(0))
768 self.assertEquals(self.question.status, QuestionStatus.SOLVED)767 self.assertEqual(self.question.status, QuestionStatus.SOLVED)
769768
770 # Clear previous events.769 # Clear previous events.
771 self.collected_events = []770 self.collected_events = []
@@ -793,7 +792,7 @@
793 self.answerer, 'Press the any key.', datecreated=self.nowPlus(0))792 self.answerer, 'Press the any key.', datecreated=self.nowPlus(0))
794 self.question.confirmAnswer("That answer worked!.",793 self.question.confirmAnswer("That answer worked!.",
795 answer=answer_message, datecreated=self.nowPlus(1))794 answer=answer_message, datecreated=self.nowPlus(1))
796 self.assertEquals(self.question.status, QuestionStatus.SOLVED)795 self.assertEqual(self.question.status, QuestionStatus.SOLVED)
797796
798 # Clear previous events.797 # Clear previous events.
799 self.collected_events = []798 self.collected_events = []
@@ -890,9 +889,9 @@
890 def checkRejectMessageIsAnAnswer(message):889 def checkRejectMessageIsAnAnswer(message):
891 # Check that the rejection message was considered answering890 # Check that the rejection message was considered answering
892 # the question.891 # the question.
893 self.assertEquals(message, self.question.answer)892 self.assertEqual(message, self.question.answer)
894 self.assertEquals(self.answerer, self.question.answerer)893 self.assertEqual(self.answerer, self.question.answerer)
895 self.assertEquals(message.datecreated, self.question.date_solved)894 self.assertEqual(message.datecreated, self.question.date_solved)
896895
897 self._testValidTransition(896 self._testValidTransition(
898 valid_statuses,897 valid_statuses,
899898
=== modified file 'lib/lp/app/browser/tests/test_inlineeditpickerwidget.py'
--- lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2015-07-08 16:05:11 +0000
+++ lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2018-01-02 16:24:23 +0000
@@ -42,7 +42,7 @@
42 # Make sure that when given a vocabulary which supports vocab filters,42 # Make sure that when given a vocabulary which supports vocab filters,
43 # the vocab filters are include in the widget config.43 # the vocab filters are include in the widget config.
44 widget = self.getWidget(vocabulary='ValidPersonOrTeam')44 widget = self.getWidget(vocabulary='ValidPersonOrTeam')
45 self.assertEquals([45 self.assertEqual([
46 {'name': 'ALL',46 {'name': 'ALL',
47 'title': 'All',47 'title': 'All',
48 'description': 'Display all search results'},48 'description': 'Display all search results'},
@@ -87,13 +87,13 @@
87 # The widget has the correct meta value for a person value.87 # The widget has the correct meta value for a person value.
88 widget_value = self.factory.makePerson()88 widget_value = self.factory.makePerson()
89 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')89 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')
90 self.assertEquals('person', widget.config['selected_value_metadata'])90 self.assertEqual('person', widget.config['selected_value_metadata'])
9191
92 def test_team_selected_value_meta(self):92 def test_team_selected_value_meta(self):
93 # The widget has the correct meta value for a team value.93 # The widget has the correct meta value for a team value.
94 widget_value = self.factory.makeTeam()94 widget_value = self.factory.makeTeam()
95 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')95 widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam')
96 self.assertEquals('team', widget.config['selected_value_metadata'])96 self.assertEqual('team', widget.config['selected_value_metadata'])
9797
98 def test_required_fields_dont_have_a_remove_link(self):98 def test_required_fields_dont_have_a_remove_link(self):
99 widget = self.getWidget(99 widget = self.getWidget(
100100
=== modified file 'lib/lp/app/browser/tests/test_launchpad.py'
--- lib/lp/app/browser/tests/test_launchpad.py 2016-06-20 22:29:24 +0000
+++ lib/lp/app/browser/tests/test_launchpad.py 2018-01-02 16:24:23 +0000
@@ -77,10 +77,10 @@
7777
78 notifications = request.notifications78 notifications = request.notifications
79 if notification is None:79 if notification is None:
80 self.assertEquals(len(notifications), 0)80 self.assertEqual(len(notifications), 0)
81 return81 return
82 self.assertEqual(len(notifications), 1)82 self.assertEqual(len(notifications), 1)
83 self.assertEquals(notifications[0].level, level)83 self.assertEqual(notifications[0].level, level)
84 self.assertEqual(notification, notifications[0].message)84 self.assertEqual(notification, notifications[0].message)
8585
86 def assertDisplaysNotification(86 def assertDisplaysNotification(
8787
=== modified file 'lib/lp/app/browser/tests/test_launchpadroot.py'
--- lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 10:54:31 +0000
+++ lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 16:24:23 +0000
@@ -84,7 +84,7 @@
84 def test_featured_projects_view_requires_edit(self):84 def test_featured_projects_view_requires_edit(self):
85 view = create_view(self.root, '+featuredprojects')85 view = create_view(self.root, '+featuredprojects')
86 checker = selectChecker(view)86 checker = selectChecker(view)
87 self.assertEquals('launchpad.Edit', checker.permission_id('__call__'))87 self.assertEqual('launchpad.Edit', checker.permission_id('__call__'))
8888
89 def test_featured_projects_manage_link_requires_edit(self):89 def test_featured_projects_manage_link_requires_edit(self):
90 self.setUpRegistryExpert()90 self.setUpRegistryExpert()
9191
=== modified file 'lib/lp/app/tests/test_tales.py'
--- lib/lp/app/tests/test_tales.py 2018-01-02 10:54:31 +0000
+++ lib/lp/app/tests/test_tales.py 2018-01-02 16:24:23 +0000
@@ -395,7 +395,7 @@
395 ircID = ircset.new(person, "<b>irc.canonical.com</b>", "fred")395 ircID = ircset.new(person, "<b>irc.canonical.com</b>", "fred")
396 expected_html = test_tales(396 expected_html = test_tales(
397 'nick/fmt:formatted_displayname', nick=ircID)397 'nick/fmt:formatted_displayname', nick=ircID)
398 self.assertEquals(398 self.assertEqual(
399 u'<strong>fred</strong>\n'399 u'<strong>fred</strong>\n'
400 '<span class="lesser"> on </span>\n'400 '<span class="lesser"> on </span>\n'
401 '<strong>&lt;b&gt;irc.canonical.com&lt;/b&gt;</strong>\n',401 '<strong>&lt;b&gt;irc.canonical.com&lt;/b&gt;</strong>\n',
402402
=== modified file 'lib/lp/archivepublisher/tests/test_debversion.py'
--- lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 10:54:31 +0000
+++ lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 16:24:23 +0000
@@ -62,15 +62,15 @@
6262
63 def testReturnString(self):63 def testReturnString(self):
64 """Version should convert to a string."""64 """Version should convert to a string."""
65 self.assertEquals(str(Version("1.0")), "1.0")65 self.assertEqual(str(Version("1.0")), "1.0")
6666
67 def testAcceptsInteger(self):67 def testAcceptsInteger(self):
68 """Version should accept an integer."""68 """Version should accept an integer."""
69 self.assertEquals(str(Version(1)), "1")69 self.assertEqual(str(Version(1)), "1")
7070
71 def testAcceptsNumber(self):71 def testAcceptsNumber(self):
72 """Version should accept a number."""72 """Version should accept a number."""
73 self.assertEquals(str(Version(1.2)), "1.2")73 self.assertEqual(str(Version(1.2)), "1.2")
7474
75 def testNotEmpty(self):75 def testNotEmpty(self):
76 """Version should fail with empty input."""76 """Version should fail with empty input."""
@@ -107,8 +107,8 @@
107 def testRevisionNotEmpty(self):107 def testRevisionNotEmpty(self):
108 """Version should not allow an empty revision."""108 """Version should not allow an empty revision."""
109 v = Version("1-")109 v = Version("1-")
110 self.assertEquals("1-", v.upstream_version)110 self.assertEqual("1-", v.upstream_version)
111 self.assertEquals(None, v.debian_version)111 self.assertIsNone(v.debian_version)
112112
113 def testRevisionInvalid(self):113 def testRevisionInvalid(self):
114 """Version should fail when revision contains a bad character."""114 """Version should fail when revision contains a bad character."""
@@ -118,7 +118,7 @@
118 """Version should give same input as output."""118 """Version should give same input as output."""
119 for value in self.VALUES:119 for value in self.VALUES:
120 result = str(Version(value))120 result = str(Version(value))
121 self.assertEquals(value, result)121 self.assertEqual(value, result)
122122
123 def testComparisons(self):123 def testComparisons(self):
124 """Sample Version comparisons should pass."""124 """Sample Version comparisons should pass."""
@@ -127,10 +127,10 @@
127127
128 def testNullEpochIsZero(self):128 def testNullEpochIsZero(self):
129 """Version should treat an omitted epoch as a zero one."""129 """Version should treat an omitted epoch as a zero one."""
130 self.assertEquals(Version("1.0"), Version("0:1.0"))130 self.assertEqual(Version("1.0"), Version("0:1.0"))
131131
132 def notestNullRevisionIsZero(self):132 def notestNullRevisionIsZero(self):
133 """Version should treat an omitted revision as being equal to zero.133 """Version should treat an omitted revision as being equal to zero.
134 """134 """
135 self.assertEquals(Version("1.0"), Version("1.0-0"))135 self.assertEqual(Version("1.0"), Version("1.0-0"))
136 self.assertTrue(Version("1.0") == Version("1.0-0"))136 self.assertTrue(Version("1.0") == Version("1.0-0"))
137137
=== modified file 'lib/lp/archivepublisher/tests/test_htaccess.py'
--- lib/lp/archivepublisher/tests/test_htaccess.py 2017-10-09 11:33:11 +0000
+++ lib/lp/archivepublisher/tests/test_htaccess.py 2018-01-02 16:24:23 +0000
@@ -101,7 +101,7 @@
101 # If there are no ArchiveAuthTokens for an archive just101 # If there are no ArchiveAuthTokens for an archive just
102 # the buildd secret is returned.102 # the buildd secret is returned.
103 self.ppa.buildd_secret = "sekr1t"103 self.ppa.buildd_secret = "sekr1t"
104 self.assertEquals(104 self.assertEqual(
105 [("buildd", "sekr1t", "bu")],105 [("buildd", "sekr1t", "bu")],
106 list(htpasswd_credentials_for_archive(self.ppa)))106 list(htpasswd_credentials_for_archive(self.ppa)))
107107
108108
=== modified file 'lib/lp/archiveuploader/tests/test_changesfile.py'
--- lib/lp/archiveuploader/tests/test_changesfile.py 2017-09-17 10:35:57 +0000
+++ lib/lp/archiveuploader/tests/test_changesfile.py 2018-01-02 16:24:23 +0000
@@ -50,25 +50,25 @@
5050
51 def testSourceFile(self):51 def testSourceFile(self):
52 # A non-DSC source file is a SourceUploadFile.52 # A non-DSC source file is a SourceUploadFile.
53 self.assertEquals(53 self.assertEqual(
54 ('foo', SourceUploadFile),54 ('foo', SourceUploadFile),
55 determine_file_class_and_name('foo_1.0.diff.gz'))55 determine_file_class_and_name('foo_1.0.diff.gz'))
5656
57 def testDSCFile(self):57 def testDSCFile(self):
58 # A DSC is a DSCFile, since they're special.58 # A DSC is a DSCFile, since they're special.
59 self.assertEquals(59 self.assertEqual(
60 ('foo', DSCFile),60 ('foo', DSCFile),
61 determine_file_class_and_name('foo_1.0.dsc'))61 determine_file_class_and_name('foo_1.0.dsc'))
6262
63 def testDEBFile(self):63 def testDEBFile(self):
64 # A binary file is the appropriate PackageUploadFile subclass.64 # A binary file is the appropriate PackageUploadFile subclass.
65 self.assertEquals(65 self.assertEqual(
66 ('foo', DebBinaryUploadFile),66 ('foo', DebBinaryUploadFile),
67 determine_file_class_and_name('foo_1.0_all.deb'))67 determine_file_class_and_name('foo_1.0_all.deb'))
68 self.assertEquals(68 self.assertEqual(
69 ('foo', DdebBinaryUploadFile),69 ('foo', DdebBinaryUploadFile),
70 determine_file_class_and_name('foo_1.0_all.ddeb'))70 determine_file_class_and_name('foo_1.0_all.ddeb'))
71 self.assertEquals(71 self.assertEqual(
72 ('foo', UdebBinaryUploadFile),72 ('foo', UdebBinaryUploadFile),
73 determine_file_class_and_name('foo_1.0_all.udeb'))73 determine_file_class_and_name('foo_1.0_all.udeb'))
7474
@@ -219,43 +219,43 @@
219 # checkFileName() yields an UploadError if the filename is invalid.219 # checkFileName() yields an UploadError if the filename is invalid.
220 contents = self.getBaseChanges()220 contents = self.getBaseChanges()
221 changes = self.createChangesFile("mypkg_0.1_i386.changes", contents)221 changes = self.createChangesFile("mypkg_0.1_i386.changes", contents)
222 self.assertEquals([], list(changes.checkFileName()))222 self.assertEqual([], list(changes.checkFileName()))
223 changes = self.createChangesFile("mypkg_0.1.changes", contents)223 changes = self.createChangesFile("mypkg_0.1.changes", contents)
224 errors = list(changes.checkFileName())224 errors = list(changes.checkFileName())
225 self.assertIsInstance(errors[0], UploadError)225 self.assertIsInstance(errors[0], UploadError)
226 self.assertEquals(1, len(errors))226 self.assertEqual(1, len(errors))
227227
228 def test_filename(self):228 def test_filename(self):
229 # Filename gets set to the basename of the changes file on disk.229 # Filename gets set to the basename of the changes file on disk.
230 changes = self.createChangesFile(230 changes = self.createChangesFile(
231 "mypkg_0.1_i386.changes", self.getBaseChanges())231 "mypkg_0.1_i386.changes", self.getBaseChanges())
232 self.assertEquals("mypkg_0.1_i386.changes", changes.filename)232 self.assertEqual("mypkg_0.1_i386.changes", changes.filename)
233233
234 def test_suite_name(self):234 def test_suite_name(self):
235 # The suite name gets extracted from the changes file.235 # The suite name gets extracted from the changes file.
236 changes = self.createChangesFile(236 changes = self.createChangesFile(
237 "mypkg_0.1_i386.changes", self.getBaseChanges())237 "mypkg_0.1_i386.changes", self.getBaseChanges())
238 self.assertEquals("nifty", changes.suite_name)238 self.assertEqual("nifty", changes.suite_name)
239239
240 def test_version(self):240 def test_version(self):
241 # The version gets extracted from the changes file.241 # The version gets extracted from the changes file.
242 changes = self.createChangesFile(242 changes = self.createChangesFile(
243 "mypkg_0.1_i386.changes", self.getBaseChanges())243 "mypkg_0.1_i386.changes", self.getBaseChanges())
244 self.assertEquals("0.1", changes.version)244 self.assertEqual("0.1", changes.version)
245245
246 def test_architectures(self):246 def test_architectures(self):
247 # The architectures get extracted from the changes file247 # The architectures get extracted from the changes file
248 # and parsed correctly.248 # and parsed correctly.
249 changes = self.createChangesFile(249 changes = self.createChangesFile(
250 "mypkg_0.1_i386.changes", self.getBaseChanges())250 "mypkg_0.1_i386.changes", self.getBaseChanges())
251 self.assertEquals("i386", changes.architecture_line)251 self.assertEqual("i386", changes.architecture_line)
252 self.assertEquals(set(["i386"]), changes.architectures)252 self.assertEqual(set(["i386"]), changes.architectures)
253253
254 def test_source(self):254 def test_source(self):
255 # The source package name gets extracted from the changes file.255 # The source package name gets extracted from the changes file.
256 changes = self.createChangesFile(256 changes = self.createChangesFile(
257 "mypkg_0.1_i386.changes", self.getBaseChanges())257 "mypkg_0.1_i386.changes", self.getBaseChanges())
258 self.assertEquals("mypkg", changes.source)258 self.assertEqual("mypkg", changes.source)
259259
260 def test_processAddresses(self):260 def test_processAddresses(self):
261 # processAddresses parses the changes file and sets the261 # processAddresses parses the changes file and sets the
@@ -263,9 +263,9 @@
263 contents = self.getBaseChanges()263 contents = self.getBaseChanges()
264 changes = self.createChangesFile(264 changes = self.createChangesFile(
265 "mypkg_0.1_i386.changes", contents)265 "mypkg_0.1_i386.changes", contents)
266 self.assertEquals(None, changes.changed_by)266 self.assertIsNone(changes.changed_by)
267 errors = list(changes.processAddresses())267 errors = list(changes.processAddresses())
268 self.assertEquals(0, len(errors), "Errors: %r" % errors)268 self.assertEqual(0, len(errors), "Errors: %r" % errors)
269 self.assertThat(269 self.assertThat(
270 changes.changed_by,270 changes.changed_by,
271 MatchesDict({271 MatchesDict({
@@ -280,8 +280,8 @@
280 contents = self.getBaseChanges()280 contents = self.getBaseChanges()
281 changes = self.createChangesFile(281 changes = self.createChangesFile(
282 "mypkg_0.1_i386.changes", contents)282 "mypkg_0.1_i386.changes", contents)
283 self.assertEquals([], list(changes.processAddresses()))283 self.assertEqual([], list(changes.processAddresses()))
284 self.assertEquals(284 self.assertEqual(
285 "Something changed\n\n"285 "Something changed\n\n"
286 " -- Somebody <somebody@ubuntu.com> "286 " -- Somebody <somebody@ubuntu.com> "
287 "Fri, 25 Jun 2010 11:20:22 -0600",287 "Fri, 25 Jun 2010 11:20:22 -0600",
288288
=== modified file 'lib/lp/archiveuploader/tests/test_dscfile.py'
--- lib/lp/archiveuploader/tests/test_dscfile.py 2016-06-01 01:59:32 +0000
+++ lib/lp/archiveuploader/tests/test_dscfile.py 2018-01-02 16:24:23 +0000
@@ -76,7 +76,7 @@
76 file.write(copyright)76 file.write(copyright)
77 file.close()77 file.close()
7878
79 self.assertEquals(79 self.assertEqual(
80 copyright, find_copyright(self.tmpdir, DevNullLogger()))80 copyright, find_copyright(self.tmpdir, DevNullLogger()))
8181
82 def testBadDebianChangelog(self):82 def testBadDebianChangelog(self):
@@ -98,7 +98,7 @@
98 file.write(changelog)98 file.write(changelog)
99 file.close()99 file.close()
100100
101 self.assertEquals(101 self.assertEqual(
102 changelog, find_changelog(self.tmpdir, DevNullLogger()))102 changelog, find_changelog(self.tmpdir, DevNullLogger()))
103103
104 def testOversizedFile(self):104 def testOversizedFile(self):
@@ -252,7 +252,7 @@
252 DEBIAN_TARBALL: 0,252 DEBIAN_TARBALL: 0,
253 }253 }
254 full_files.update(files)254 full_files.update(files)
255 self.assertEquals(255 self.assertEqual(
256 expected,256 expected,
257 [str(e) for e in format_to_file_checker_map[self.format](257 [str(e) for e in format_to_file_checker_map[self.format](
258 'foo_1.dsc', full_files, components, component_signatures,258 'foo_1.dsc', full_files, components, component_signatures,
@@ -408,7 +408,7 @@
408 unpacked_dir = unpack_source(408 unpacked_dir = unpack_source(
409 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')))409 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')))
410 try:410 try:
411 self.assertEquals(["bar-1.0"], os.listdir(unpacked_dir))411 self.assertEqual(["bar-1.0"], os.listdir(unpacked_dir))
412 self.assertContentEqual(412 self.assertContentEqual(
413 ["THIS_IS_BAR", "debian"],413 ["THIS_IS_BAR", "debian"],
414 os.listdir(os.path.join(unpacked_dir, "bar-1.0")))414 os.listdir(os.path.join(unpacked_dir, "bar-1.0")))
415415
=== modified file 'lib/lp/archiveuploader/tests/test_nascentupload.py'
--- lib/lp/archiveuploader/tests/test_nascentupload.py 2014-06-11 08:29:40 +0000
+++ lib/lp/archiveuploader/tests/test_nascentupload.py 2018-01-02 16:24:23 +0000
@@ -52,7 +52,7 @@
52 return file52 return file
5353
54 def assertMatchDDEBErrors(self, error_list):54 def assertMatchDDEBErrors(self, error_list):
55 self.assertEquals(55 self.assertEqual(
56 error_list, [str(e) for e in self.upload._matchDDEBs()])56 error_list, [str(e) for e in self.upload._matchDDEBs()])
5757
58 def testNoLinksWithNoBinaries(self):58 def testNoLinksWithNoBinaries(self):
5959
=== modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py'
--- lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2016-11-17 16:46:04 +0000
+++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2018-01-02 16:24:23 +0000
@@ -124,7 +124,7 @@
124 # The mime type gets set according to PackageUploadCustomFormat.124 # The mime type gets set according to PackageUploadCustomFormat.
125 uploadfile = self.createCustomUploadFile(125 uploadfile = self.createCustomUploadFile(
126 "bla.txt", "data", "main/raw-installer", "extra")126 "bla.txt", "data", "main/raw-installer", "extra")
127 self.assertEquals(127 self.assertEqual(
128 PackageUploadCustomFormat.DEBIAN_INSTALLER,128 PackageUploadCustomFormat.DEBIAN_INSTALLER,
129 uploadfile.custom_type)129 uploadfile.custom_type)
130130
@@ -132,10 +132,10 @@
132 # storeInDatabase creates a library file.132 # storeInDatabase creates a library file.
133 uploadfile = self.createCustomUploadFile(133 uploadfile = self.createCustomUploadFile(
134 "bla.txt", "data", "main/raw-installer", "extra")134 "bla.txt", "data", "main/raw-installer", "extra")
135 self.assertEquals("application/octet-stream", uploadfile.content_type)135 self.assertEqual("application/octet-stream", uploadfile.content_type)
136 libraryfile = uploadfile.storeInDatabase()136 libraryfile = uploadfile.storeInDatabase()
137 self.assertEquals("bla.txt", libraryfile.filename)137 self.assertEqual("bla.txt", libraryfile.filename)
138 self.assertEquals("application/octet-stream", libraryfile.mimetype)138 self.assertEqual("application/octet-stream", libraryfile.mimetype)
139139
140 def test_debian_installer_verify(self):140 def test_debian_installer_verify(self):
141 # debian-installer uploads are required to have sensible filenames.141 # debian-installer uploads are required to have sensible filenames.
@@ -236,7 +236,7 @@
236 priority_name, package, version, changes):236 priority_name, package, version, changes):
237 (path, md5, sha1, size) = self.writeUploadFile(filename, dsc.dump())237 (path, md5, sha1, size) = self.writeUploadFile(filename, dsc.dump())
238 if changes:238 if changes:
239 self.assertEquals([], list(changes.processAddresses()))239 self.assertEqual([], list(changes.processAddresses()))
240 return DSCFile(240 return DSCFile(
241 path, dict(MD5=md5), size, component_and_section, priority_name,241 path, dict(MD5=md5), size, component_and_section, priority_name,
242 package, version, changes, self.policy, self.logger)242 package, version, changes, self.policy, self.logger)
@@ -246,7 +246,7 @@
246 dsc = self.getBaseDsc()246 dsc = self.getBaseDsc()
247 uploadfile = self.createDSCFile(247 uploadfile = self.createDSCFile(
248 "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42", None)248 "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42", None)
249 self.assertEquals(249 self.assertEqual(
250 "text/x-debian-source-package", uploadfile.content_type)250 "text/x-debian-source-package", uploadfile.content_type)
251251
252 def test_storeInDatabase(self):252 def test_storeInDatabase(self):
@@ -260,8 +260,8 @@
260 uploadfile.changelog = "DUMMY"260 uploadfile.changelog = "DUMMY"
261 uploadfile.files = []261 uploadfile.files = []
262 release = uploadfile.storeInDatabase(None)262 release = uploadfile.storeInDatabase(None)
263 self.assertEquals("0.42", release.version)263 self.assertEqual("0.42", release.version)
264 self.assertEquals("dpkg, bzr", release.builddepends)264 self.assertEqual("dpkg, bzr", release.builddepends)
265265
266 def test_storeInDatabase_case_sensitivity(self):266 def test_storeInDatabase_case_sensitivity(self):
267 # storeInDatabase supports field names with different cases,267 # storeInDatabase supports field names with different cases,
@@ -275,7 +275,7 @@
275 uploadfile.files = []275 uploadfile.files = []
276 uploadfile.changelog = "DUMMY"276 uploadfile.changelog = "DUMMY"
277 release = uploadfile.storeInDatabase(None)277 release = uploadfile.storeInDatabase(None)
278 self.assertEquals("dpkg, bzr", release.builddepends)278 self.assertEqual("dpkg, bzr", release.builddepends)
279279
280 def test_user_defined_fields(self):280 def test_user_defined_fields(self):
281 # storeInDatabase updates user_defined_fields.281 # storeInDatabase updates user_defined_fields.
@@ -289,7 +289,7 @@
289 uploadfile.files = []289 uploadfile.files = []
290 release = uploadfile.storeInDatabase(None)290 release = uploadfile.storeInDatabase(None)
291 # DSCFile lowercases the field names291 # DSCFile lowercases the field names
292 self.assertEquals(292 self.assertEqual(
293 [["Python-Version", u"2.5"]], release.user_defined_fields)293 [["Python-Version", u"2.5"]], release.user_defined_fields)
294294
295 def test_homepage(self):295 def test_homepage(self):
@@ -303,7 +303,7 @@
303 uploadfile.changelog = "DUMMY"303 uploadfile.changelog = "DUMMY"
304 uploadfile.files = []304 uploadfile.files = []
305 release = uploadfile.storeInDatabase(None)305 release = uploadfile.storeInDatabase(None)
306 self.assertEquals(u"http://samba.org/~jelmer/bzr", release.homepage)306 self.assertEqual(u"http://samba.org/~jelmer/bzr", release.homepage)
307307
308 def test_checkBuild(self):308 def test_checkBuild(self):
309 # checkBuild() verifies consistency with a build.309 # checkBuild() verifies consistency with a build.
@@ -320,7 +320,7 @@
320 uploadfile.checkBuild(build)320 uploadfile.checkBuild(build)
321 # checkBuild() sets the build status to FULLYBUILT and321 # checkBuild() sets the build status to FULLYBUILT and
322 # removes the upload log.322 # removes the upload log.
323 self.assertEquals(BuildStatus.FULLYBUILT, build.status)323 self.assertEqual(BuildStatus.FULLYBUILT, build.status)
324 self.assertIs(None, build.upload_log)324 self.assertIs(None, build.upload_log)
325325
326 def test_checkBuild_inconsistent(self):326 def test_checkBuild_inconsistent(self):
@@ -399,7 +399,7 @@
399 # Unknown priorities automatically get changed to 'extra'.399 # Unknown priorities automatically get changed to 'extra'.
400 uploadfile = self.createDebBinaryUploadFile(400 uploadfile = self.createDebBinaryUploadFile(
401 "foo_0.42_i386.deb", "main/net", "unknown", "mypkg", "0.42", None)401 "foo_0.42_i386.deb", "main/net", "unknown", "mypkg", "0.42", None)
402 self.assertEquals("extra", uploadfile.priority_name)402 self.assertEqual("extra", uploadfile.priority_name)
403403
404 def test_parseControl(self):404 def test_parseControl(self):
405 # parseControl sets various fields on DebBinaryUploadFile.405 # parseControl sets various fields on DebBinaryUploadFile.
@@ -408,10 +408,10 @@
408 None)408 None)
409 control = self.getBaseControl()409 control = self.getBaseControl()
410 uploadfile.parseControl(control)410 uploadfile.parseControl(control)
411 self.assertEquals("python", uploadfile.section_name)411 self.assertEqual("python", uploadfile.section_name)
412 self.assertEquals("dulwich", uploadfile.source_name)412 self.assertEqual("dulwich", uploadfile.source_name)
413 self.assertEquals("0.42", uploadfile.source_version)413 self.assertEqual("0.42", uploadfile.source_version)
414 self.assertEquals("0.42", uploadfile.control_version)414 self.assertEqual("0.42", uploadfile.control_version)
415415
416 def test_verifyFormat_control_xz(self):416 def test_verifyFormat_control_xz(self):
417 # verifyFormat accepts .debs with an xz-compressed control member.417 # verifyFormat accepts .debs with an xz-compressed control member.
@@ -452,15 +452,15 @@
452 uploadfile.parseControl(control)452 uploadfile.parseControl(control)
453 build = self.factory.makeBinaryPackageBuild()453 build = self.factory.makeBinaryPackageBuild()
454 bpr = uploadfile.storeInDatabase(build)454 bpr = uploadfile.storeInDatabase(build)
455 self.assertEquals(u'python (<< 2.7), python (>= 2.5)', bpr.depends)455 self.assertEqual(u'python (<< 2.7), python (>= 2.5)', bpr.depends)
456 self.assertEquals(456 self.assertEqual(
457 u"Dulwich is a Python implementation of the file formats "457 u"Dulwich is a Python implementation of the file formats "
458 u"and protocols", bpr.description)458 u"and protocols", bpr.description)
459 self.assertEquals(False, bpr.essential)459 self.assertEqual(False, bpr.essential)
460 self.assertEquals(524, bpr.installedsize)460 self.assertEqual(524, bpr.installedsize)
461 self.assertEquals(True, bpr.architecturespecific)461 self.assertEqual(True, bpr.architecturespecific)
462 self.assertEquals(u"", bpr.recommends)462 self.assertEqual(u"", bpr.recommends)
463 self.assertEquals("0.42", bpr.version)463 self.assertEqual("0.42", bpr.version)
464464
465 def test_user_defined_fields(self):465 def test_user_defined_fields(self):
466 # storeInDatabase stores user defined fields.466 # storeInDatabase stores user defined fields.
@@ -472,7 +472,7 @@
472 uploadfile.parseControl(control)472 uploadfile.parseControl(control)
473 build = self.factory.makeBinaryPackageBuild()473 build = self.factory.makeBinaryPackageBuild()
474 bpr = uploadfile.storeInDatabase(build)474 bpr = uploadfile.storeInDatabase(build)
475 self.assertEquals(475 self.assertEqual(
476 [[u"Python-Version", u"2.5"]], bpr.user_defined_fields)476 [[u"Python-Version", u"2.5"]], bpr.user_defined_fields)
477477
478 def test_user_defined_fields_newlines(self):478 def test_user_defined_fields_newlines(self):
@@ -485,7 +485,7 @@
485 uploadfile.parseControl(control)485 uploadfile.parseControl(control)
486 build = self.factory.makeBinaryPackageBuild()486 build = self.factory.makeBinaryPackageBuild()
487 bpr = uploadfile.storeInDatabase(build)487 bpr = uploadfile.storeInDatabase(build)
488 self.assertEquals(488 self.assertEqual(
489 [489 [
490 [u"RandomData", u"Foo\nbar\nbla\n"],490 [u"RandomData", u"Foo\nbar\nbla\n"],
491 ], bpr.user_defined_fields)491 ], bpr.user_defined_fields)
@@ -500,7 +500,7 @@
500 uploadfile.parseControl(control)500 uploadfile.parseControl(control)
501 build = self.factory.makeBinaryPackageBuild()501 build = self.factory.makeBinaryPackageBuild()
502 bpr = uploadfile.storeInDatabase(build)502 bpr = uploadfile.storeInDatabase(build)
503 self.assertEquals(503 self.assertEqual(
504 u"http://samba.org/~jelmer/dulwich", bpr.homepage)504 u"http://samba.org/~jelmer/dulwich", bpr.homepage)
505505
506 def test_checkBuild(self):506 def test_checkBuild(self):
@@ -516,7 +516,7 @@
516 uploadfile.checkBuild(build)516 uploadfile.checkBuild(build)
517 # checkBuild() sets the build status to FULLYBUILT and517 # checkBuild() sets the build status to FULLYBUILT and
518 # removes the upload log.518 # removes the upload log.
519 self.assertEquals(BuildStatus.FULLYBUILT, build.status)519 self.assertEqual(BuildStatus.FULLYBUILT, build.status)
520 self.assertIs(None, build.upload_log)520 self.assertIs(None, build.upload_log)
521521
522 def test_checkBuild_inconsistent(self):522 def test_checkBuild_inconsistent(self):
@@ -549,7 +549,7 @@
549 control = self.getBaseControl()549 control = self.getBaseControl()
550 control["Source"] = "foo"550 control["Source"] = "foo"
551 uploadfile.parseControl(control)551 uploadfile.parseControl(control)
552 self.assertEquals(552 self.assertEqual(
553 spph.sourcepackagerelease, uploadfile.findSourcePackageRelease())553 spph.sourcepackagerelease, uploadfile.findSourcePackageRelease())
554554
555 def test_findSourcePackageRelease_no_spph(self):555 def test_findSourcePackageRelease_no_spph(self):
@@ -594,5 +594,5 @@
594 control = self.getBaseControl()594 control = self.getBaseControl()
595 control["Source"] = "foo"595 control["Source"] = "foo"
596 uploadfile.parseControl(control)596 uploadfile.parseControl(control)
597 self.assertEquals(597 self.assertEqual(
598 spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease())598 spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease())
599599
=== modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2016-07-02 07:55:26 +0000
+++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2018-01-02 16:24:23 +0000
@@ -1146,7 +1146,7 @@
1146 # primary archive.1146 # primary archive.
1147 upload_dir = self.queueUpload(1147 upload_dir = self.queueUpload(
1148 "bar_1.0-2_3.0-quilt_without_orig", "~name16/ubuntu")1148 "bar_1.0-2_3.0-quilt_without_orig", "~name16/ubuntu")
1149 self.assertEquals(1149 self.assertEqual(
1150 self.processUpload(self.uploadprocessor, upload_dir),1150 self.processUpload(self.uploadprocessor, upload_dir),
1151 ['accepted'])1151 ['accepted'])
11521152
11531153
=== modified file 'lib/lp/archiveuploader/tests/test_recipeuploads.py'
--- lib/lp/archiveuploader/tests/test_recipeuploads.py 2015-04-20 15:59:52 +0000
+++ lib/lp/archiveuploader/tests/test_recipeuploads.py 2018-01-02 16:24:23 +0000
@@ -60,7 +60,7 @@
60 '%d/ubuntu/bar_1.0-1_source.changes' % self.build.archive.id)60 '%d/ubuntu/bar_1.0-1_source.changes' % self.build.archive.id)
61 self.layer.txn.commit()61 self.layer.txn.commit()
6262
63 self.assertEquals(UploadStatusEnum.ACCEPTED, result,63 self.assertEqual(UploadStatusEnum.ACCEPTED, result,
64 "Source upload failed\nGot: %s" % self.log.getLogBuffer())64 "Source upload failed\nGot: %s" % self.log.getLogBuffer())
6565
66 self.assertEqual(BuildStatus.FULLYBUILT, self.build.status)66 self.assertEqual(BuildStatus.FULLYBUILT, self.build.status)
6767
=== modified file 'lib/lp/archiveuploader/tests/test_uploadpolicy.py'
--- lib/lp/archiveuploader/tests/test_uploadpolicy.py 2017-05-02 23:02:41 +0000
+++ lib/lp/archiveuploader/tests/test_uploadpolicy.py 2018-01-02 16:24:23 +0000
@@ -70,7 +70,7 @@
7070
71 policy.validateUploadType(upload)71 policy.validateUploadType(upload)
7272
73 self.assertEquals([], upload.rejections)73 self.assertEqual([], upload.rejections)
7474
75 def test_binaryful_accepted(self):75 def test_binaryful_accepted(self):
76 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)76 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)
@@ -78,7 +78,7 @@
7878
79 policy.validateUploadType(upload)79 policy.validateUploadType(upload)
8080
81 self.assertEquals([], upload.rejections)81 self.assertEqual([], upload.rejections)
8282
83 def test_mixed_accepted(self):83 def test_mixed_accepted(self):
84 policy = make_policy(accepted_type=ArchiveUploadType.MIXED_ONLY)84 policy = make_policy(accepted_type=ArchiveUploadType.MIXED_ONLY)
@@ -86,7 +86,7 @@
8686
87 policy.validateUploadType(upload)87 policy.validateUploadType(upload)
8888
89 self.assertEquals([], upload.rejections)89 self.assertEqual([], upload.rejections)
9090
91 def test_sourceful_not_accepted(self):91 def test_sourceful_not_accepted(self):
92 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)92 policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY)
9393
=== modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py'
--- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2017-09-17 10:35:57 +0000
+++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2018-01-02 16:24:23 +0000
@@ -1778,7 +1778,7 @@
1778 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)1778 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)
1779 spph = self.publishPackage("bar", "1.0-1")1779 spph = self.publishPackage("bar", "1.0-1")
17801780
1781 self.assertEquals(1781 self.assertEqual(
1782 sorted((sprf.libraryfile.filename, sprf.filetype)1782 sorted((sprf.libraryfile.filename, sprf.filetype)
1783 for sprf in spph.sourcepackagerelease.files),1783 for sprf in spph.sourcepackagerelease.files),
1784 [('bar_1.0-1.debian.tar.bz2',1784 [('bar_1.0-1.debian.tar.bz2',
@@ -1819,11 +1819,11 @@
18191819
1820 # Upload another source sharing the same (component) orig.1820 # Upload another source sharing the same (component) orig.
1821 upload_dir = self.queueUpload("bar_1.0-2_3.0-quilt_without_orig")1821 upload_dir = self.queueUpload("bar_1.0-2_3.0-quilt_without_orig")
1822 self.assertEquals(1822 self.assertEqual(
1823 self.processUpload(uploadprocessor, upload_dir), ['accepted'])1823 self.processUpload(uploadprocessor, upload_dir), ['accepted'])
18241824
1825 queue_item = uploadprocessor.last_processed_upload.queue_root1825 queue_item = uploadprocessor.last_processed_upload.queue_root
1826 self.assertEquals(1826 self.assertEqual(
1827 sorted((sprf.libraryfile.filename, sprf.filetype) for sprf1827 sorted((sprf.libraryfile.filename, sprf.filetype) for sprf
1828 in queue_item.sources[0].sourcepackagerelease.files),1828 in queue_item.sources[0].sourcepackagerelease.files),
1829 [('bar_1.0-2.debian.tar.bz2',1829 [('bar_1.0-2.debian.tar.bz2',
@@ -1859,7 +1859,7 @@
1859 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)1859 "rejected" in str(msg), "Failed to upload bar source:\n%s" % msg)
1860 spph = self.publishPackage("bar", "1.0")1860 spph = self.publishPackage("bar", "1.0")
18611861
1862 self.assertEquals(1862 self.assertEqual(
1863 sorted((sprf.libraryfile.filename, sprf.filetype)1863 sorted((sprf.libraryfile.filename, sprf.filetype)
1864 for sprf in spph.sourcepackagerelease.files),1864 for sprf in spph.sourcepackagerelease.files),
1865 [('bar_1.0.dsc',1865 [('bar_1.0.dsc',
@@ -2194,10 +2194,9 @@
2194 self.options.builds = True2194 self.options.builds = True
2195 BuildUploadHandler(self.uploadprocessor, self.incoming_folder,2195 BuildUploadHandler(self.uploadprocessor, self.incoming_folder,
2196 leaf_name).process()2196 leaf_name).process()
2197 self.assertEquals(1, len(self.oopses))2197 self.assertEqual(1, len(self.oopses))
2198 self.assertEquals(2198 self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
2199 BuildStatus.FAILEDTOUPLOAD, build.status)2199 self.assertEqual(builder, build.builder)
2200 self.assertEquals(builder, build.builder)
2201 self.assertIsNot(None, build.duration)2200 self.assertIsNot(None, build.duration)
2202 log_contents = build.upload_log.read()2201 log_contents = build.upload_log.read()
2203 self.assertTrue('ERROR Exception while processing upload '2202 self.assertTrue('ERROR Exception while processing upload '
@@ -2254,7 +2253,7 @@
2254 build = self.factory.makeSourcePackageRecipeBuild(sourcename=u"bar",2253 build = self.factory.makeSourcePackageRecipeBuild(sourcename=u"bar",
2255 distroseries=self.breezy, archive=archive,2254 distroseries=self.breezy, archive=archive,
2256 requester=archive.owner)2255 requester=archive.owner)
2257 self.assertEquals(archive.owner, build.requester)2256 self.assertEqual(archive.owner, build.requester)
2258 self.switchToUploader()2257 self.switchToUploader()
2259 # Commit so the build cookie has the right ids.2258 # Commit so the build cookie has the right ids.
2260 self.layer.txn.commit()2259 self.layer.txn.commit()
@@ -2279,8 +2278,8 @@
2279 # Properly uploaded source packages should result in the2278 # Properly uploaded source packages should result in the
2280 # build status changing to FULLYBUILT.2279 # build status changing to FULLYBUILT.
2281 build = self.doSuccessRecipeBuild()2280 build = self.doSuccessRecipeBuild()
2282 self.assertEquals(BuildStatus.FULLYBUILT, build.status)2281 self.assertEqual(BuildStatus.FULLYBUILT, build.status)
2283 self.assertEquals(None, build.builder)2282 self.assertIsNone(build.builder)
2284 self.assertIsNot(None, build.duration)2283 self.assertIsNot(None, build.duration)
2285 # Upon full build the upload log is unset.2284 # Upon full build the upload log is unset.
2286 self.assertIs(None, build.upload_log)2285 self.assertIs(None, build.upload_log)
@@ -2319,8 +2318,8 @@
23192318
2320 def testSourcePackageRecipeBuild_fail(self):2319 def testSourcePackageRecipeBuild_fail(self):
2321 build = self.doFailureRecipeBuild()2320 build = self.doFailureRecipeBuild()
2322 self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status)2321 self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
2323 self.assertEquals(None, build.builder)2322 self.assertIsNone(build.builder)
2324 self.assertIsNot(None, build.duration)2323 self.assertIsNot(None, build.duration)
2325 self.assertIsNot(None, build.upload_log)2324 self.assertIsNot(None, build.upload_log)
23262325
@@ -2366,8 +2365,8 @@
23662365
2367 def testSourcePackageRecipeBuild_deleted_recipe(self):2366 def testSourcePackageRecipeBuild_deleted_recipe(self):
2368 build = self.doDeletedRecipeBuild()2367 build = self.doDeletedRecipeBuild()
2369 self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status)2368 self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status)
2370 self.assertEquals(None, build.builder)2369 self.assertIsNone(build.builder)
2371 self.assertIsNot(None, build.duration)2370 self.assertIsNot(None, build.duration)
2372 self.assertIs(None, build.upload_log)2371 self.assertIs(None, build.upload_log)
23732372
@@ -2437,7 +2436,7 @@
2437 # The build status is not changed2436 # The build status is not changed
2438 self.assertTrue(2437 self.assertTrue(
2439 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))2438 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))
2440 self.assertEquals(BuildStatus.BUILDING, build.status)2439 self.assertEqual(BuildStatus.BUILDING, build.status)
2441 self.assertLogContains("Build status is BUILDING. Ignoring.")2440 self.assertLogContains("Build status is BUILDING. Ignoring.")
24422441
2443 def testBuildWithInvalidStatus(self):2442 def testBuildWithInvalidStatus(self):
@@ -2451,7 +2450,7 @@
2451 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))2450 os.path.exists(os.path.join(self.incoming_folder, leaf_name)))
2452 self.assertTrue(2451 self.assertTrue(
2453 os.path.exists(os.path.join(self.failed_folder, leaf_name)))2452 os.path.exists(os.path.join(self.failed_folder, leaf_name)))
2454 self.assertEquals(BuildStatus.NEEDSBUILD, build.status)2453 self.assertEqual(BuildStatus.NEEDSBUILD, build.status)
2455 self.assertLogContains(2454 self.assertLogContains(
2456 "Expected build status to be UPLOADING or BUILDING, was "2455 "Expected build status to be UPLOADING or BUILDING, was "
2457 "NEEDSBUILD.")2456 "NEEDSBUILD.")
@@ -2486,7 +2485,7 @@
2486 """Tests for parse_build_upload_leaf_name."""2485 """Tests for parse_build_upload_leaf_name."""
24872486
2488 def test_valid(self):2487 def test_valid(self):
2489 self.assertEquals(2488 self.assertEqual(
2490 ('PACKAGEBUILD', 60),2489 ('PACKAGEBUILD', 60),
2491 parse_build_upload_leaf_name("20100812-PACKAGEBUILD-60"))2490 parse_build_upload_leaf_name("20100812-PACKAGEBUILD-60"))
24922491
24932492
=== modified file 'lib/lp/archiveuploader/tests/test_utils.py'
--- lib/lp/archiveuploader/tests/test_utils.py 2016-06-01 01:59:32 +0000
+++ lib/lp/archiveuploader/tests/test_utils.py 2018-01-02 16:24:23 +0000
@@ -30,116 +30,116 @@
30 """lp.archiveuploader.utils.determine_source_file_type should work."""30 """lp.archiveuploader.utils.determine_source_file_type should work."""
3131
32 # .dsc -> DSC32 # .dsc -> DSC
33 self.assertEquals(33 self.assertEqual(
34 determine_source_file_type('foo_1.0-1.dsc'),34 determine_source_file_type('foo_1.0-1.dsc'),
35 SourcePackageFileType.DSC)35 SourcePackageFileType.DSC)
3636
37 # .diff.gz -> DIFF37 # .diff.gz -> DIFF
38 self.assertEquals(38 self.assertEqual(
39 determine_source_file_type('foo_1.0-1.diff.gz'),39 determine_source_file_type('foo_1.0-1.diff.gz'),
40 SourcePackageFileType.DIFF)40 SourcePackageFileType.DIFF)
4141
42 # DIFFs can only be gzipped.42 # DIFFs can only be gzipped.
43 self.assertEquals(43 self.assertEqual(
44 determine_source_file_type('foo_1.0.diff.bz2'), None)44 determine_source_file_type('foo_1.0.diff.bz2'), None)
4545
46 # Plain original tarballs can be gzipped or bzip2ed.46 # Plain original tarballs can be gzipped or bzip2ed.
47 self.assertEquals(47 self.assertEqual(
48 determine_source_file_type('foo_1.0.orig.tar.gz'),48 determine_source_file_type('foo_1.0.orig.tar.gz'),
49 SourcePackageFileType.ORIG_TARBALL)49 SourcePackageFileType.ORIG_TARBALL)
50 self.assertEquals(50 self.assertEqual(
51 determine_source_file_type('foo_1.0.orig.tar.bz2'),51 determine_source_file_type('foo_1.0.orig.tar.bz2'),
52 SourcePackageFileType.ORIG_TARBALL)52 SourcePackageFileType.ORIG_TARBALL)
53 self.assertEquals(53 self.assertEqual(
54 determine_source_file_type('foo_1.0.orig.tar.xz'),54 determine_source_file_type('foo_1.0.orig.tar.xz'),
55 SourcePackageFileType.ORIG_TARBALL)55 SourcePackageFileType.ORIG_TARBALL)
5656
57 # Component original tarballs too.57 # Component original tarballs too.
58 self.assertEquals(58 self.assertEqual(
59 determine_source_file_type('foo_1.0.orig-foo.tar.gz'),59 determine_source_file_type('foo_1.0.orig-foo.tar.gz'),
60 SourcePackageFileType.COMPONENT_ORIG_TARBALL)60 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
61 self.assertEquals(61 self.assertEqual(
62 determine_source_file_type('foo_1.0.orig-bar.tar.bz2'),62 determine_source_file_type('foo_1.0.orig-bar.tar.bz2'),
63 SourcePackageFileType.COMPONENT_ORIG_TARBALL)63 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
64 self.assertEquals(64 self.assertEqual(
65 determine_source_file_type('foo_1.0.orig-bar.tar.xz'),65 determine_source_file_type('foo_1.0.orig-bar.tar.xz'),
66 SourcePackageFileType.COMPONENT_ORIG_TARBALL)66 SourcePackageFileType.COMPONENT_ORIG_TARBALL)
6767
68 # And Debian tarballs...68 # And Debian tarballs...
69 self.assertEquals(69 self.assertEqual(
70 determine_source_file_type('foo_1.0-1.debian.tar.gz'),70 determine_source_file_type('foo_1.0-1.debian.tar.gz'),
71 SourcePackageFileType.DEBIAN_TARBALL)71 SourcePackageFileType.DEBIAN_TARBALL)
72 self.assertEquals(72 self.assertEqual(
73 determine_source_file_type('foo_1.0-2.debian.tar.bz2'),73 determine_source_file_type('foo_1.0-2.debian.tar.bz2'),
74 SourcePackageFileType.DEBIAN_TARBALL)74 SourcePackageFileType.DEBIAN_TARBALL)
75 self.assertEquals(75 self.assertEqual(
76 determine_source_file_type('foo_1.0-2.debian.tar.xz'),76 determine_source_file_type('foo_1.0-2.debian.tar.xz'),
77 SourcePackageFileType.DEBIAN_TARBALL)77 SourcePackageFileType.DEBIAN_TARBALL)
7878
79 # And even native tarballs!79 # And even native tarballs!
80 self.assertEquals(80 self.assertEqual(
81 determine_source_file_type('foo_1.0.tar.gz'),81 determine_source_file_type('foo_1.0.tar.gz'),
82 SourcePackageFileType.NATIVE_TARBALL)82 SourcePackageFileType.NATIVE_TARBALL)
83 self.assertEquals(83 self.assertEqual(
84 determine_source_file_type('foo_1.0.tar.bz2'),84 determine_source_file_type('foo_1.0.tar.bz2'),
85 SourcePackageFileType.NATIVE_TARBALL)85 SourcePackageFileType.NATIVE_TARBALL)
86 self.assertEquals(86 self.assertEqual(
87 determine_source_file_type('foo_1.0.tar.xz'),87 determine_source_file_type('foo_1.0.tar.xz'),
88 SourcePackageFileType.NATIVE_TARBALL)88 SourcePackageFileType.NATIVE_TARBALL)
8989
90 # (Component) original tarball signatures are detected for any90 # (Component) original tarball signatures are detected for any
91 # supported compression method.91 # supported compression method.
92 self.assertEquals(92 self.assertEqual(
93 determine_source_file_type('foo_1.0.orig.tar.gz.asc'),93 determine_source_file_type('foo_1.0.orig.tar.gz.asc'),
94 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)94 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
95 self.assertEquals(95 self.assertEqual(
96 determine_source_file_type('foo_1.0.orig.tar.bz2.asc'),96 determine_source_file_type('foo_1.0.orig.tar.bz2.asc'),
97 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)97 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
98 self.assertEquals(98 self.assertEqual(
99 determine_source_file_type('foo_1.0.orig.tar.xz.asc'),99 determine_source_file_type('foo_1.0.orig.tar.xz.asc'),
100 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)100 SourcePackageFileType.ORIG_TARBALL_SIGNATURE)
101 self.assertEquals(101 self.assertEqual(
102 determine_source_file_type('foo_1.0.orig-foo.tar.gz.asc'),102 determine_source_file_type('foo_1.0.orig-foo.tar.gz.asc'),
103 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)103 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
104 self.assertEquals(104 self.assertEqual(
105 determine_source_file_type('foo_1.0.orig-bar.tar.bz2.asc'),105 determine_source_file_type('foo_1.0.orig-bar.tar.bz2.asc'),
106 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)106 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
107 self.assertEquals(107 self.assertEqual(
108 determine_source_file_type('foo_1.0.orig-bar.tar.xz.asc'),108 determine_source_file_type('foo_1.0.orig-bar.tar.xz.asc'),
109 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)109 SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE)
110110
111 self.assertEquals(None, determine_source_file_type('foo_1.0'))111 self.assertIsNone(determine_source_file_type('foo_1.0'))
112 self.assertEquals(None, determine_source_file_type('foo_1.0.blah.gz'))112 self.assertIsNone(determine_source_file_type('foo_1.0.blah.gz'))
113113
114 def test_determine_binary_file_type(self):114 def test_determine_binary_file_type(self):
115 """lp.archiveuploader.utils.determine_binary_file_type should work."""115 """lp.archiveuploader.utils.determine_binary_file_type should work."""
116 # .deb -> DEB116 # .deb -> DEB
117 self.assertEquals(117 self.assertEqual(
118 determine_binary_file_type('foo_1.0-1_all.deb'),118 determine_binary_file_type('foo_1.0-1_all.deb'),
119 BinaryPackageFileType.DEB)119 BinaryPackageFileType.DEB)
120120
121 # .ddeb -> DDEB121 # .ddeb -> DDEB
122 self.assertEquals(122 self.assertEqual(
123 determine_binary_file_type('foo_1.0-1_all.ddeb'),123 determine_binary_file_type('foo_1.0-1_all.ddeb'),
124 BinaryPackageFileType.DDEB)124 BinaryPackageFileType.DDEB)
125125
126 # .udeb -> UDEB126 # .udeb -> UDEB
127 self.assertEquals(127 self.assertEqual(
128 determine_binary_file_type('foo_1.0-1_all.udeb'),128 determine_binary_file_type('foo_1.0-1_all.udeb'),
129 BinaryPackageFileType.UDEB)129 BinaryPackageFileType.UDEB)
130130
131 self.assertEquals(determine_binary_file_type('foo_1.0'), None)131 self.assertEqual(determine_binary_file_type('foo_1.0'), None)
132 self.assertEquals(determine_binary_file_type('foo_1.0.notdeb'), None)132 self.assertEqual(determine_binary_file_type('foo_1.0.notdeb'), None)
133133
134 def testPrefixMultilineString(self):134 def testPrefixMultilineString(self):
135 """lp.archiveuploader.utils.prefix_multi_line_string should work"""135 """lp.archiveuploader.utils.prefix_multi_line_string should work"""
136 from lp.archiveuploader.utils import prefix_multi_line_string136 from lp.archiveuploader.utils import prefix_multi_line_string
137 self.assertEquals("A:foo\nA:bar",137 self.assertEqual("A:foo\nA:bar",
138 prefix_multi_line_string("foo\nbar", "A:"))138 prefix_multi_line_string("foo\nbar", "A:"))
139 self.assertEquals("A:foo\nA:bar",139 self.assertEqual("A:foo\nA:bar",
140 prefix_multi_line_string("foo\n\nbar", "A:"))140 prefix_multi_line_string("foo\n\nbar", "A:"))
141 self.assertEquals("A:foo\nA:\nA:bar",141 self.assertEqual("A:foo\nA:\nA:bar",
142 prefix_multi_line_string("foo\n\nbar", "A:", 1))142 prefix_multi_line_string("foo\n\nbar", "A:", 1))
143143
144 def testExtractComponent(self):144 def testExtractComponent(self):
145 """lp.archiveuploader.utils.extract_component_from_section should work145 """lp.archiveuploader.utils.extract_component_from_section should work
@@ -147,21 +147,21 @@
147 from lp.archiveuploader.utils import extract_component_from_section147 from lp.archiveuploader.utils import extract_component_from_section
148148
149 (sect, comp) = extract_component_from_section("libs")149 (sect, comp) = extract_component_from_section("libs")
150 self.assertEquals(sect, "libs")150 self.assertEqual(sect, "libs")
151 self.assertEquals(comp, "main")151 self.assertEqual(comp, "main")
152152
153 (sect, comp) = extract_component_from_section("restricted/libs")153 (sect, comp) = extract_component_from_section("restricted/libs")
154 self.assertEquals(sect, "libs")154 self.assertEqual(sect, "libs")
155 self.assertEquals(comp, "restricted")155 self.assertEqual(comp, "restricted")
156156
157 (sect, comp) = extract_component_from_section("libs", "multiverse")157 (sect, comp) = extract_component_from_section("libs", "multiverse")
158 self.assertEquals(sect, "libs")158 self.assertEqual(sect, "libs")
159 self.assertEquals(comp, "multiverse")159 self.assertEqual(comp, "multiverse")
160160
161 (sect, comp) = extract_component_from_section("restricted/libs",161 (sect, comp) = extract_component_from_section("restricted/libs",
162 "multiverse")162 "multiverse")
163 self.assertEquals(sect, "libs")163 self.assertEqual(sect, "libs")
164 self.assertEquals(comp, "restricted")164 self.assertEqual(comp, "restricted")
165165
166 def testParseMaintainerOkay(self):166 def testParseMaintainerOkay(self):
167 """lp.archiveuploader.utils.parse_maintainer should parse correctly167 """lp.archiveuploader.utils.parse_maintainer should parse correctly
@@ -224,9 +224,9 @@
224224
225 for case in cases:225 for case in cases:
226 (name, email) = parse_maintainer_bytes(case[0], 'Maintainer')226 (name, email) = parse_maintainer_bytes(case[0], 'Maintainer')
227 self.assertEquals(case[2], name)227 self.assertEqual(case[2], name)
228 self.assertEquals(case[3], email)228 self.assertEqual(case[3], email)
229 self.assertEquals(case[1], rfc822_encode_address(name, email))229 self.assertEqual(case[1], rfc822_encode_address(name, email))
230230
231 def testParseMaintainerRaises(self):231 def testParseMaintainerRaises(self):
232 """lp.archiveuploader.utils.parse_maintainer should raise on incorrect232 """lp.archiveuploader.utils.parse_maintainer should raise on incorrect
@@ -251,7 +251,7 @@
251 def test_re_isadeb(self):251 def test_re_isadeb(self):
252 # Verify that the three binary extensions match the regexp.252 # Verify that the three binary extensions match the regexp.
253 for extension in ('deb', 'ddeb', 'udeb'):253 for extension in ('deb', 'ddeb', 'udeb'):
254 self.assertEquals(254 self.assertEqual(
255 ('foo-bar', '1.0', 'i386', extension),255 ('foo-bar', '1.0', 'i386', extension),
256 re_isadeb.match('foo-bar_1.0_i386.%s' % extension).groups())256 re_isadeb.match('foo-bar_1.0_i386.%s' % extension).groups())
257257
@@ -270,13 +270,13 @@
270 'orig-foo_bar.tar.gz',270 'orig-foo_bar.tar.gz',
271 'debian.tar.gz', 'debian.tar.bz2', 'debian.tar.xz')271 'debian.tar.gz', 'debian.tar.bz2', 'debian.tar.xz')
272 for extension in extensions:272 for extension in extensions:
273 self.assertEquals(273 self.assertEqual(
274 ('foo-bar', '1.0', extension),274 ('foo-bar', '1.0', extension),
275 re_issource.match('foo-bar_1.0.%s' % extension).groups())275 re_issource.match('foo-bar_1.0.%s' % extension).groups())
276276
277 # While orig-*.tar.gz is all interpreted as extension, *orig-*.tar.gz277 # While orig-*.tar.gz is all interpreted as extension, *orig-*.tar.gz
278 # is taken to have an extension of just 'tar.gz'.278 # is taken to have an extension of just 'tar.gz'.
279 self.assertEquals(279 self.assertEqual(
280 ('foo-bar', '1.0.porig-bar', 'tar.gz'),280 ('foo-bar', '1.0.porig-bar', 'tar.gz'),
281 re_issource.match('foo-bar_1.0.porig-bar.tar.gz').groups())281 re_issource.match('foo-bar_1.0.porig-bar.tar.gz').groups())
282282
@@ -301,7 +301,7 @@
301 extract_dpkg_source(301 extract_dpkg_source(
302 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')),302 datadir(os.path.join('suite', 'bar_1.0-1', 'bar_1.0-1.dsc')),
303 temp_dir)303 temp_dir)
304 self.assertEquals(["bar-1.0"], os.listdir(temp_dir))304 self.assertEqual(["bar-1.0"], os.listdir(temp_dir))
305 self.assertContentEqual(305 self.assertContentEqual(
306 ["THIS_IS_BAR", "debian"],306 ["THIS_IS_BAR", "debian"],
307 os.listdir(os.path.join(temp_dir, "bar-1.0")))307 os.listdir(os.path.join(temp_dir, "bar-1.0")))
@@ -311,4 +311,4 @@
311 err = self.assertRaises(311 err = self.assertRaises(
312 DpkgSourceError, extract_dpkg_source,312 DpkgSourceError, extract_dpkg_source,
313 "thispathdoesntexist", temp_dir)313 "thispathdoesntexist", temp_dir)
314 self.assertEquals(2, err.result)314 self.assertEqual(2, err.result)
315315
=== modified file 'lib/lp/blueprints/browser/tests/test_breadcrumbs.py'
--- lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2017-10-25 13:10:41 +0000
+++ lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
@@ -27,15 +27,15 @@
27 crumbs = self.getBreadcrumbsForObject(27 crumbs = self.getBreadcrumbsForObject(
28 self.product, rootsite='blueprints')28 self.product, rootsite='blueprints')
29 last_crumb = crumbs[-1]29 last_crumb = crumbs[-1]
30 self.assertEquals(last_crumb.url, self.product_specs_url)30 self.assertEqual(last_crumb.url, self.product_specs_url)
31 self.assertEquals(last_crumb.text, 'Blueprints')31 self.assertEqual(last_crumb.text, 'Blueprints')
3232
33 def test_person(self):33 def test_person(self):
34 crumbs = self.getBreadcrumbsForObject(34 crumbs = self.getBreadcrumbsForObject(
35 self.person, rootsite='blueprints')35 self.person, rootsite='blueprints')
36 last_crumb = crumbs[-1]36 last_crumb = crumbs[-1]
37 self.assertEquals(last_crumb.url, self.person_specs_url)37 self.assertEqual(last_crumb.url, self.person_specs_url)
38 self.assertEquals(last_crumb.text, 'Blueprints')38 self.assertEqual(last_crumb.text, 'Blueprints')
3939
4040
41class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase):41class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase):
@@ -53,6 +53,5 @@
53 def test_specification(self):53 def test_specification(self):
54 crumbs = self.getBreadcrumbsForObject(self.specification)54 crumbs = self.getBreadcrumbsForObject(self.specification)
55 last_crumb = crumbs[-1]55 last_crumb = crumbs[-1]
56 self.assertEquals(last_crumb.url, self.specification_url)56 self.assertEqual(last_crumb.url, self.specification_url)
57 self.assertEquals(57 self.assertEqual(last_crumb.text, self.specification.title)
58 last_crumb.text, self.specification.title)
5958
=== modified file 'lib/lp/blueprints/model/tests/test_specification.py'
--- lib/lp/blueprints/model/tests/test_specification.py 2017-10-25 13:10:41 +0000
+++ lib/lp/blueprints/model/tests/test_specification.py 2018-01-02 16:24:23 +0000
@@ -495,7 +495,7 @@
495 assignee=None, milestone=milestone)495 assignee=None, milestone=milestone)
496496
497 # We start with no work items.497 # We start with no work items.
498 self.assertEquals([], list(spec.work_items))498 self.assertEqual([], list(spec.work_items))
499499
500 login_person(spec.owner)500 login_person(spec.owner)
501 spec.updateWorkItems([work_item1_data, work_item2_data])501 spec.updateWorkItems([work_item1_data, work_item2_data])
502502
=== modified file 'lib/lp/bugs/adapters/tests/test_bugchange.py'
--- lib/lp/bugs/adapters/tests/test_bugchange.py 2012-03-13 00:45:33 +0000
+++ lib/lp/bugs/adapters/tests/test_bugchange.py 2018-01-02 16:24:23 +0000
@@ -71,8 +71,7 @@
7171
72 change = list(get_bug_changes(bug_delta))[0]72 change = list(get_bug_changes(bug_delta))[0]
73 self.assertTrue(isinstance(change, BugDescriptionChange))73 self.assertTrue(isinstance(change, BugDescriptionChange))
74 self.assertEquals(74 self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
75 BugNotificationLevel.METADATA, change.change_level)
7675
77 def test_change_level_lifecycle_status_closing(self):76 def test_change_level_lifecycle_status_closing(self):
78 # Changing a bug task status from NEW to FIXRELEASED makes this77 # Changing a bug task status from NEW to FIXRELEASED makes this
@@ -87,8 +86,7 @@
87 bugtask_deltas=bugtask_delta)86 bugtask_deltas=bugtask_delta)
8887
89 change = list(get_bug_changes(bug_delta))[0]88 change = list(get_bug_changes(bug_delta))[0]
90 self.assertEquals(89 self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
91 BugNotificationLevel.LIFECYCLE, change.change_level)
9290
93 def test_change_level_lifecycle_status_reopening(self):91 def test_change_level_lifecycle_status_reopening(self):
94 # Changing a bug task status from FIXRELEASED to TRIAGED makes this92 # Changing a bug task status from FIXRELEASED to TRIAGED makes this
@@ -103,9 +101,7 @@
103 bugtask_deltas=bugtask_delta)101 bugtask_deltas=bugtask_delta)
104102
105 change = list(get_bug_changes(bug_delta))[0]103 change = list(get_bug_changes(bug_delta))[0]
106 self.assertEquals(104 self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
107 BugNotificationLevel.LIFECYCLE,
108 change.change_level)
109105
110 def test_change_level_metadata_status_worked_on(self):106 def test_change_level_metadata_status_worked_on(self):
111 # Changing a bug task status from TRIAGED to FIXCOMMITTED makes this107 # Changing a bug task status from TRIAGED to FIXCOMMITTED makes this
@@ -120,8 +116,7 @@
120 bugtask_deltas=bugtask_delta)116 bugtask_deltas=bugtask_delta)
121117
122 change = list(get_bug_changes(bug_delta))[0]118 change = list(get_bug_changes(bug_delta))[0]
123 self.assertEquals(119 self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
124 BugNotificationLevel.METADATA, change.change_level)
125120
126 def test_change_level_metadata_status_stays_closed(self):121 def test_change_level_metadata_status_stays_closed(self):
127 # Changing a bug task status from OPINION to WONTFIX makes this122 # Changing a bug task status from OPINION to WONTFIX makes this
@@ -136,8 +131,7 @@
136 bugtask_deltas=bugtask_delta)131 bugtask_deltas=bugtask_delta)
137132
138 change = list(get_bug_changes(bug_delta))[0]133 change = list(get_bug_changes(bug_delta))[0]
139 self.assertEquals(134 self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
140 BugNotificationLevel.METADATA, change.change_level)
141135
142 def test_change_level_metadata_duplicate_of_unresolved(self):136 def test_change_level_metadata_duplicate_of_unresolved(self):
143 # Marking a bug as a duplicate of an unresolved bug is a137 # Marking a bug as a duplicate of an unresolved bug is a
@@ -153,8 +147,7 @@
153 })147 })
154148
155 change = list(get_bug_changes(bug_delta))[0]149 change = list(get_bug_changes(bug_delta))[0]
156 self.assertEquals(150 self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
157 BugNotificationLevel.METADATA, change.change_level)
158151
159 def test_change_level_lifecycle_duplicate_of_resolved(self):152 def test_change_level_lifecycle_duplicate_of_resolved(self):
160 # Marking a bug as a duplicate of a resolved bug is153 # Marking a bug as a duplicate of a resolved bug is
@@ -170,8 +163,7 @@
170 })163 })
171164
172 change = list(get_bug_changes(bug_delta))[0]165 change = list(get_bug_changes(bug_delta))[0]
173 self.assertEquals(166 self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
174 BugNotificationLevel.LIFECYCLE, change.change_level)
175167
176 def test_change_level_metadata_not_duplicate_of_unresolved(self):168 def test_change_level_metadata_not_duplicate_of_unresolved(self):
177 # Un-marking a bug as a duplicate of an unresolved bug is a169 # Un-marking a bug as a duplicate of an unresolved bug is a
@@ -187,8 +179,7 @@
187 })179 })
188180
189 change = list(get_bug_changes(bug_delta))[0]181 change = list(get_bug_changes(bug_delta))[0]
190 self.assertEquals(182 self.assertEqual(BugNotificationLevel.METADATA, change.change_level)
191 BugNotificationLevel.METADATA, change.change_level)
192183
193 def test_change_level_lifecycle_not_duplicate_of_resolved(self):184 def test_change_level_lifecycle_not_duplicate_of_resolved(self):
194 # Un-marking a bug as a duplicate of a resolved bug is185 # Un-marking a bug as a duplicate of a resolved bug is
@@ -203,5 +194,4 @@
203 'old': duplicate_of})194 'old': duplicate_of})
204195
205 change = list(get_bug_changes(bug_delta))[0]196 change = list(get_bug_changes(bug_delta))[0]
206 self.assertEquals(197 self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level)
207 BugNotificationLevel.LIFECYCLE, change.change_level)
208198
=== modified file 'lib/lp/bugs/browser/tests/test_breadcrumbs.py'
--- lib/lp/bugs/browser/tests/test_breadcrumbs.py 2014-02-19 00:35:25 +0000
+++ lib/lp/bugs/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
@@ -24,17 +24,17 @@
24 def test_bugtask(self):24 def test_bugtask(self):
25 crumbs = self.getBreadcrumbsForObject(self.bugtask)25 crumbs = self.getBreadcrumbsForObject(self.bugtask)
26 last_crumb = crumbs[-1]26 last_crumb = crumbs[-1]
27 self.assertEquals(self.bugtask_url, last_crumb.url)27 self.assertEqual(self.bugtask_url, last_crumb.url)
28 self.assertEquals("Bug #%d" % self.bug.id, last_crumb.text)28 self.assertEqual("Bug #%d" % self.bug.id, last_crumb.text)
29 self.assertEquals(29 self.assertEqual(
30 u"Bug #%d \u201cborked\u201d" % self.bug.id, last_crumb.detail)30 u"Bug #%d \u201cborked\u201d" % self.bug.id, last_crumb.detail)
3131
32 def test_bugtask_child(self):32 def test_bugtask_child(self):
33 crumbs = self.getBreadcrumbsForObject(33 crumbs = self.getBreadcrumbsForObject(
34 self.bugtask, view_name='+activity')34 self.bugtask, view_name='+activity')
35 self.assertEquals(crumbs[-1].url, "%s/+activity" % self.bugtask_url)35 self.assertEqual(crumbs[-1].url, "%s/+activity" % self.bugtask_url)
36 self.assertEquals(crumbs[-2].url, self.bugtask_url)36 self.assertEqual(crumbs[-2].url, self.bugtask_url)
37 self.assertEquals(crumbs[-2].text, "Bug #%d" % self.bug.id)37 self.assertEqual(crumbs[-2].text, "Bug #%d" % self.bug.id)
3838
39 def test_bugtask_comment(self):39 def test_bugtask_comment(self):
40 login_person(self.bug.owner)40 login_person(self.bug.owner)
@@ -88,13 +88,13 @@
88 person_bugs_url = canonical_url(person, rootsite='bugs')88 person_bugs_url = canonical_url(person, rootsite='bugs')
89 crumbs = self.getBreadcrumbsForObject(person, rootsite='bugs')89 crumbs = self.getBreadcrumbsForObject(person, rootsite='bugs')
90 last_crumb = crumbs[-1]90 last_crumb = crumbs[-1]
91 self.assertEquals(person_bugs_url, last_crumb.url)91 self.assertEqual(person_bugs_url, last_crumb.url)
92 self.assertEquals("Bugs", last_crumb.text)92 self.assertEqual("Bugs", last_crumb.text)
9393
94 def test_bugtarget(self):94 def test_bugtarget(self):
95 project = self.factory.makeProduct(name='fnord')95 project = self.factory.makeProduct(name='fnord')
96 project_bugs_url = canonical_url(project, rootsite='bugs')96 project_bugs_url = canonical_url(project, rootsite='bugs')
97 crumbs = self.getBreadcrumbsForObject(project, rootsite='bugs')97 crumbs = self.getBreadcrumbsForObject(project, rootsite='bugs')
98 last_crumb = crumbs[-1]98 last_crumb = crumbs[-1]
99 self.assertEquals(project_bugs_url, last_crumb.url)99 self.assertEqual(project_bugs_url, last_crumb.url)
100 self.assertEquals("Bugs", last_crumb.text)100 self.assertEqual("Bugs", last_crumb.text)
101101
=== modified file 'lib/lp/bugs/browser/tests/test_bug_views.py'
--- lib/lp/bugs/browser/tests/test_bug_views.py 2017-10-21 18:14:14 +0000
+++ lib/lp/bugs/browser/tests/test_bug_views.py 2018-01-02 16:24:23 +0000
@@ -654,7 +654,7 @@
654 view = create_initialized_view(654 view = create_initialized_view(
655 bug.default_bugtask, '+addcomment', form=form)655 bug.default_bugtask, '+addcomment', form=form)
656 expected_error = u'Either a comment or attachment must be provided.'656 expected_error = u'Either a comment or attachment must be provided.'
657 self.assertEquals(view.errors[0], expected_error)657 self.assertEqual(view.errors[0], expected_error)
658658
659 def test_whitespaces_message_with_attached_file(self):659 def test_whitespaces_message_with_attached_file(self):
660 # If the message only contains whitespaces but a file660 # If the message only contains whitespaces but a file
661661
=== modified file 'lib/lp/bugs/browser/tests/test_bugnomination.py'
--- lib/lp/bugs/browser/tests/test_bugnomination.py 2016-10-05 08:44:13 +0000
+++ lib/lp/bugs/browser/tests/test_bugnomination.py 2018-01-02 16:24:23 +0000
@@ -243,7 +243,7 @@
243 return view243 return view
244244
245 def assertApproves(self, nomination):245 def assertApproves(self, nomination):
246 self.assertEquals(246 self.assertEqual(
247 302,247 302,
248 self.getNominationEditView(248 self.getNominationEditView(
249 nomination,249 nomination,
250250
=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
--- lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 10:54:31 +0000
+++ lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 16:24:23 +0000
@@ -1751,7 +1751,7 @@
1751 self.setAttribute(1751 self.setAttribute(
1752 task, 'assignee',1752 task, 'assignee',
1753 self.factory.makePerson(displayname="Foo &<>", name='foo'))1753 self.factory.makePerson(displayname="Foo &<>", name='foo'))
1754 self.assertEquals(1754 self.assertEqual(
1755 "nobody &#8594; Foo &amp;&lt;&gt; (foo)",1755 "nobody &#8594; Foo &amp;&lt;&gt; (foo)",
1756 BugActivityItem(task.bug.activity[-1]).change_details)1756 BugActivityItem(task.bug.activity[-1]).change_details)
17571757
@@ -1759,7 +1759,7 @@
1759 with celebrity_logged_in('admin'):1759 with celebrity_logged_in('admin'):
1760 bug = self.factory.makeBug(title="foo")1760 bug = self.factory.makeBug(title="foo")
1761 self.setAttribute(bug, 'title', "bar &<>")1761 self.setAttribute(bug, 'title', "bar &<>")
1762 self.assertEquals(1762 self.assertEqual(
1763 "- foo<br />+ bar &amp;&lt;&gt;",1763 "- foo<br />+ bar &amp;&lt;&gt;",
1764 BugActivityItem(bug.activity[-1]).change_details)1764 BugActivityItem(bug.activity[-1]).change_details)
17651765
17661766
=== modified file 'lib/lp/bugs/browser/tests/test_expose.py'
--- lib/lp/bugs/browser/tests/test_expose.py 2015-09-09 16:47:34 +0000
+++ lib/lp/bugs/browser/tests/test_expose.py 2018-01-02 16:24:23 +0000
@@ -249,7 +249,7 @@
249 expose_user_administered_teams_to_js(self.request, self.user, context,249 expose_user_administered_teams_to_js(self.request, self.user, context,
250 absoluteURL=fake_absoluteURL)250 absoluteURL=fake_absoluteURL)
251 team_info = self.request.objects['administratedTeams']251 team_info = self.request.objects['administratedTeams']
252 self.assertEquals(len(team_info), 0)252 self.assertEqual(len(team_info), 0)
253253
254 def test_teams_for_distro_with_bug_super(self):254 def test_teams_for_distro_with_bug_super(self):
255 self._setup_teams(self.user)255 self._setup_teams(self.user)
256256
=== modified file 'lib/lp/bugs/mail/tests/test_handler.py'
--- lib/lp/bugs/mail/tests/test_handler.py 2016-03-23 17:55:39 +0000
+++ lib/lp/bugs/mail/tests/test_handler.py 2018-01-02 16:24:23 +0000
@@ -98,7 +98,7 @@
98 # NB SignedMessage by default isn't actually signed, it just has the98 # NB SignedMessage by default isn't actually signed, it just has the
99 # capability of knowing about signing.99 # capability of knowing about signing.
100 message = self.factory.makeSignedMessage(body=' affects malone\nhi!')100 message = self.factory.makeSignedMessage(body=' affects malone\nhi!')
101 self.assertEquals(message.signature, None)101 self.assertEqual(message.signature, None)
102102
103 # Pretend that the mail auth has given us a logged-in user.103 # Pretend that the mail auth has given us a logged-in user.
104 handler = MaloneHandler()104 handler = MaloneHandler()
@@ -106,8 +106,8 @@
106 mail_handled, add_comment_to_bug, commands = \106 mail_handled, add_comment_to_bug, commands = \
107 handler.extractAndAuthenticateCommands(message,107 handler.extractAndAuthenticateCommands(message,
108 'new@bugs.launchpad.net')108 'new@bugs.launchpad.net')
109 self.assertEquals(mail_handled, None)109 self.assertEqual(mail_handled, None)
110 self.assertEquals(map(str, commands), [110 self.assertEqual(map(str, commands), [
111 'bug new',111 'bug new',
112 'affects malone',112 'affects malone',
113 ])113 ])
114114
=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
--- lib/lp/bugs/model/tests/test_bugtask.py 2017-05-08 11:38:20 +0000
+++ lib/lp/bugs/model/tests/test_bugtask.py 2018-01-02 16:24:23 +0000
@@ -729,7 +729,7 @@
729 names = set(729 names = set(
730 name for interface in providedBy(delta) for name in interface)730 name for interface in providedBy(delta) for name in interface)
731 for name in names:731 for name in names:
732 self.assertEquals(getattr(delta, name), expected_delta.get(name))732 self.assertEqual(getattr(delta, name), expected_delta.get(name))
733733
734 def test_get_bugwatch_delta(self):734 def test_get_bugwatch_delta(self):
735 # Exercise getDelta() with a change to bugwatch.735 # Exercise getDelta() with a change to bugwatch.
@@ -1199,8 +1199,8 @@
11991199
1200 # Get a debbugs watch.1200 # Get a debbugs watch.
1201 watch_debbugs_327452 = bugwatchset.get(9)1201 watch_debbugs_327452 = bugwatchset.get(9)
1202 self.assertEquals(watch_debbugs_327452.bugtracker.name, "debbugs")1202 self.assertEqual(watch_debbugs_327452.bugtracker.name, "debbugs")
1203 self.assertEquals(watch_debbugs_327452.remotebug, "327452")1203 self.assertEqual(watch_debbugs_327452.remotebug, "327452")
12041204
1205 # Associate the watch to a Fix Released task.1205 # Associate the watch to a Fix Released task.
1206 debian = getUtility(IDistributionSet).getByName("debian")1206 debian = getUtility(IDistributionSet).getByName("debian")
@@ -2208,7 +2208,7 @@
2208 def test_distribution_to_package_works(self):2208 def test_distribution_to_package_works(self):
2209 distro = self.factory.makeDistribution()2209 distro = self.factory.makeDistribution()
2210 dsp = self.factory.makeDistributionSourcePackage(distribution=distro)2210 dsp = self.factory.makeDistributionSourcePackage(distribution=distro)
2211 self.assertEquals(dsp.distribution, distro)2211 self.assertEqual(dsp.distribution, distro)
2212 self.assertTransitionWorks(distro, dsp)2212 self.assertTransitionWorks(distro, dsp)
22132213
2214 def test_package_to_package_works(self):2214 def test_package_to_package_works(self):
22152215
=== modified file 'lib/lp/bugs/scripts/checkwatches/tests/test_core.py'
--- lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 10:54:31 +0000
+++ lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 16:24:23 +0000
@@ -244,7 +244,7 @@
244 transaction.commit()244 transaction.commit()
245 master._updateBugTracker(bug_tracker)245 master._updateBugTracker(bug_tracker)
246 for bug_watch in bug_watches:246 for bug_watch in bug_watches:
247 self.assertEquals(247 self.assertEqual(
248 BugWatchActivityStatus.CONNECTION_ERROR,248 BugWatchActivityStatus.CONNECTION_ERROR,
249 bug_watch.last_error_type)249 bug_watch.last_error_type)
250 self.assertEqual(250 self.assertEqual(
@@ -264,7 +264,7 @@
264 transaction.commit()264 transaction.commit()
265 master._updateBugTracker(bug_tracker)265 master._updateBugTracker(bug_tracker)
266 for bug_watch in bug_watches:266 for bug_watch in bug_watches:
267 self.assertEquals(267 self.assertEqual(
268 BugWatchActivityStatus.UNKNOWN,268 BugWatchActivityStatus.UNKNOWN,
269 bug_watch.last_error_type)269 bug_watch.last_error_type)
270 self.assertEqual(270 self.assertEqual(
271271
=== modified file 'lib/lp/bugs/scripts/tests/test_bugnotification.py'
--- lib/lp/bugs/scripts/tests/test_bugnotification.py 2015-08-06 12:09:28 +0000
+++ lib/lp/bugs/scripts/tests/test_bugnotification.py 2018-01-02 16:24:23 +0000
@@ -439,20 +439,20 @@
439439
440 def test_with_nothing(self):440 def test_with_nothing(self):
441 # Nothing is generated if an empty list is passed in.441 # Nothing is generated if an empty list is passed in.
442 self.assertEquals([], list(notification_comment_batches([])))442 self.assertEqual([], list(notification_comment_batches([])))
443443
444 def test_with_one_non_comment_notification(self):444 def test_with_one_non_comment_notification(self):
445 # Given a single non-comment notification, a single tuple is445 # Given a single non-comment notification, a single tuple is
446 # generated.446 # generated.
447 notification = FakeNotification(False)447 notification = FakeNotification(False)
448 self.assertEquals(448 self.assertEqual(
449 [(1, notification)],449 [(1, notification)],
450 list(notification_comment_batches([notification])))450 list(notification_comment_batches([notification])))
451451
452 def test_with_one_comment_notification(self):452 def test_with_one_comment_notification(self):
453 # Given a single comment notification, a single tuple is generated.453 # Given a single comment notification, a single tuple is generated.
454 notification = FakeNotification(True)454 notification = FakeNotification(True)
455 self.assertEquals(455 self.assertEqual(
456 [(1, notification)],456 [(1, notification)],
457 list(notification_comment_batches([notification])))457 list(notification_comment_batches([notification])))
458458
@@ -462,7 +462,7 @@
462 notification1 = FakeNotification(True)462 notification1 = FakeNotification(True)
463 notification2 = FakeNotification(False)463 notification2 = FakeNotification(False)
464 notifications = [notification1, notification2]464 notifications = [notification1, notification2]
465 self.assertEquals(465 self.assertEqual(
466 [(1, notification1), (1, notification2)],466 [(1, notification1), (1, notification2)],
467 list(notification_comment_batches(notifications)))467 list(notification_comment_batches(notifications)))
468468
@@ -472,7 +472,7 @@
472 notification1 = FakeNotification(False)472 notification1 = FakeNotification(False)
473 notification2 = FakeNotification(True)473 notification2 = FakeNotification(True)
474 notifications = [notification1, notification2]474 notifications = [notification1, notification2]
475 self.assertEquals(475 self.assertEqual(
476 [(1, notification1), (1, notification2)],476 [(1, notification1), (1, notification2)],
477 list(notification_comment_batches(notifications)))477 list(notification_comment_batches(notifications)))
478478
@@ -483,7 +483,7 @@
483 notification2 = FakeNotification(True)483 notification2 = FakeNotification(True)
484 notification3 = FakeNotification(False)484 notification3 = FakeNotification(False)
485 notifications = [notification1, notification2, notification3]485 notifications = [notification1, notification2, notification3]
486 self.assertEquals(486 self.assertEqual(
487 [(1, notification1), (1, notification2), (1, notification3)],487 [(1, notification1), (1, notification2), (1, notification3)],
488 list(notification_comment_batches(notifications)))488 list(notification_comment_batches(notifications)))
489489
@@ -500,7 +500,7 @@
500 notification1, notification2,500 notification1, notification2,
501 notification3, notification4,501 notification3, notification4,
502 ]502 ]
503 self.assertEquals(503 self.assertEqual(
504 [(1, notification1), (1, notification2),504 [(1, notification1), (1, notification2),
505 (1, notification3), (2, notification4)],505 (1, notification3), (2, notification4)],
506 list(notification_comment_batches(notifications)))506 list(notification_comment_batches(notifications)))
@@ -511,20 +511,20 @@
511511
512 def test_with_nothing(self):512 def test_with_nothing(self):
513 # Nothing is generated if an empty list is passed in.513 # Nothing is generated if an empty list is passed in.
514 self.assertEquals([], list(notification_batches([])))514 self.assertEqual([], list(notification_batches([])))
515515
516 def test_with_one_non_comment_notification(self):516 def test_with_one_non_comment_notification(self):
517 # Given a single non-comment notification, a single batch is517 # Given a single non-comment notification, a single batch is
518 # generated.518 # generated.
519 notification = FakeNotification(False)519 notification = FakeNotification(False)
520 self.assertEquals(520 self.assertEqual(
521 [[notification]],521 [[notification]],
522 list(notification_batches([notification])))522 list(notification_batches([notification])))
523523
524 def test_with_one_comment_notification(self):524 def test_with_one_comment_notification(self):
525 # Given a single comment notification, a single batch is generated.525 # Given a single comment notification, a single batch is generated.
526 notification = FakeNotification(True)526 notification = FakeNotification(True)
527 self.assertEquals(527 self.assertEqual(
528 [[notification]],528 [[notification]],
529 list(notification_batches([notification])))529 list(notification_batches([notification])))
530530
@@ -534,7 +534,7 @@
534 notification1 = FakeNotification(True)534 notification1 = FakeNotification(True)
535 notification2 = FakeNotification(False)535 notification2 = FakeNotification(False)
536 notifications = [notification1, notification2]536 notifications = [notification1, notification2]
537 self.assertEquals(537 self.assertEqual(
538 [[notification1, notification2]],538 [[notification1, notification2]],
539 list(notification_batches(notifications)))539 list(notification_batches(notifications)))
540540
@@ -544,7 +544,7 @@
544 notification1 = FakeNotification(False)544 notification1 = FakeNotification(False)
545 notification2 = FakeNotification(True)545 notification2 = FakeNotification(True)
546 notifications = [notification1, notification2]546 notifications = [notification1, notification2]
547 self.assertEquals(547 self.assertEqual(
548 [[notification1, notification2]],548 [[notification1, notification2]],
549 list(notification_batches(notifications)))549 list(notification_batches(notifications)))
550550
@@ -555,7 +555,7 @@
555 notification2 = FakeNotification(True)555 notification2 = FakeNotification(True)
556 notification3 = FakeNotification(False)556 notification3 = FakeNotification(False)
557 notifications = [notification1, notification2, notification3]557 notifications = [notification1, notification2, notification3]
558 self.assertEquals(558 self.assertEqual(
559 [[notification1, notification2, notification3]],559 [[notification1, notification2, notification3]],
560 list(notification_batches(notifications)))560 list(notification_batches(notifications)))
561561
@@ -571,7 +571,7 @@
571 notification1, notification2,571 notification1, notification2,
572 notification3, notification4,572 notification3, notification4,
573 ]573 ]
574 self.assertEquals(574 self.assertEqual(
575 [[notification1, notification2, notification3], [notification4]],575 [[notification1, notification2, notification3], [notification4]],
576 list(notification_batches(notifications)))576 list(notification_batches(notifications)))
577577
@@ -579,20 +579,20 @@
579 # Batches are grouped by bug.579 # Batches are grouped by bug.
580 notifications = [FakeNotification(bug=1) for number in range(5)]580 notifications = [FakeNotification(bug=1) for number in range(5)]
581 observed = list(notification_batches(notifications))581 observed = list(notification_batches(notifications))
582 self.assertEquals([notifications], observed)582 self.assertEqual([notifications], observed)
583583
584 def test_notifications_for_different_bugs(self):584 def test_notifications_for_different_bugs(self):
585 # Batches are grouped by bug.585 # Batches are grouped by bug.
586 notifications = [FakeNotification(bug=number) for number in range(5)]586 notifications = [FakeNotification(bug=number) for number in range(5)]
587 expected = [[notification] for notification in notifications]587 expected = [[notification] for notification in notifications]
588 observed = list(notification_batches(notifications))588 observed = list(notification_batches(notifications))
589 self.assertEquals(expected, observed)589 self.assertEqual(expected, observed)
590590
591 def test_notifications_for_same_owner(self):591 def test_notifications_for_same_owner(self):
592 # Batches are grouped by owner.592 # Batches are grouped by owner.
593 notifications = [FakeNotification(owner=1) for number in range(5)]593 notifications = [FakeNotification(owner=1) for number in range(5)]
594 observed = list(notification_batches(notifications))594 observed = list(notification_batches(notifications))
595 self.assertEquals([notifications], observed)595 self.assertEqual([notifications], observed)
596596
597 def test_notifications_for_different_owners(self):597 def test_notifications_for_different_owners(self):
598 # Batches are grouped by owner.598 # Batches are grouped by owner.
@@ -600,7 +600,7 @@
600 FakeNotification(owner=number) for number in range(5)]600 FakeNotification(owner=number) for number in range(5)]
601 expected = [[notification] for notification in notifications]601 expected = [[notification] for notification in notifications]
602 observed = list(notification_batches(notifications))602 observed = list(notification_batches(notifications))
603 self.assertEquals(expected, observed)603 self.assertEqual(expected, observed)
604604
605 def test_notifications_with_mixed_bugs_and_owners(self):605 def test_notifications_with_mixed_bugs_and_owners(self):
606 # Batches are grouped by bug and owner.606 # Batches are grouped by bug and owner.
@@ -612,7 +612,7 @@
612 ]612 ]
613 expected = [[notification] for notification in notifications]613 expected = [[notification] for notification in notifications]
614 observed = list(notification_batches(notifications))614 observed = list(notification_batches(notifications))
615 self.assertEquals(expected, observed)615 self.assertEqual(expected, observed)
616616
617 def test_notifications_with_mixed_bugs_and_owners_2(self):617 def test_notifications_with_mixed_bugs_and_owners_2(self):
618 # Batches are grouped by bug and owner.618 # Batches are grouped by bug and owner.
@@ -624,7 +624,7 @@
624 ]624 ]
625 expected = [notifications[0:2], notifications[2:4]]625 expected = [notifications[0:2], notifications[2:4]]
626 observed = list(notification_batches(notifications))626 observed = list(notification_batches(notifications))
627 self.assertEquals(expected, observed)627 self.assertEqual(expected, observed)
628628
629 def test_notifications_with_mixed_bugs_owners_and_comments(self):629 def test_notifications_with_mixed_bugs_owners_and_comments(self):
630 # Batches are grouped by bug, owner and comments.630 # Batches are grouped by bug, owner and comments.
@@ -636,7 +636,7 @@
636 ]636 ]
637 expected = [notifications[0:3], notifications[3:4]]637 expected = [notifications[0:3], notifications[3:4]]
638 observed = list(notification_batches(notifications))638 observed = list(notification_batches(notifications))
639 self.assertEquals(expected, observed)639 self.assertEqual(expected, observed)
640640
641641
642class EmailNotificationTestBase(TestCaseWithFactory):642class EmailNotificationTestBase(TestCaseWithFactory):
@@ -1122,7 +1122,7 @@
1122 self.addFilter(u"Test filter")1122 self.addFilter(u"Test filter")
11231123
1124 the_subscriber = self.subscription.subscriber1124 the_subscriber = self.subscription.subscriber
1125 self.assertEquals(1125 self.assertEqual(
1126 {other_person.preferredemail.email: [u"Someone's filter"],1126 {other_person.preferredemail.email: [u"Someone's filter"],
1127 the_subscriber.preferredemail.email: [u"Test filter"]},1127 the_subscriber.preferredemail.email: [u"Test filter"]},
1128 self.getSubscriptionEmailHeaders(by_person=True))1128 self.getSubscriptionEmailHeaders(by_person=True))
11291129
=== modified file 'lib/lp/buildmaster/browser/tests/test_processor.py'
--- lib/lp/buildmaster/browser/tests/test_processor.py 2015-04-20 11:07:41 +0000
+++ lib/lp/buildmaster/browser/tests/test_processor.py 2018-01-02 16:24:23 +0000
@@ -16,7 +16,7 @@
1616
17 def test_processor_url(self):17 def test_processor_url(self):
18 quantum = self.factory.makeProcessor('quantum')18 quantum = self.factory.makeProcessor('quantum')
19 self.assertEquals(19 self.assertEqual(
20 '/+processors/quantum',20 '/+processors/quantum',
21 canonical_url(quantum, force_local_path=True))21 canonical_url(quantum, force_local_path=True))
2222
@@ -24,4 +24,4 @@
24 quantum = self.factory.makeProcessor('quantum')24 quantum = self.factory.makeProcessor('quantum')
25 obj, view, request = test_traverse(25 obj, view, request = test_traverse(
26 'http://api.launchpad.dev/devel/+processors/quantum')26 'http://api.launchpad.dev/devel/+processors/quantum')
27 self.assertEquals(quantum, obj)27 self.assertEqual(quantum, obj)
2828
=== modified file 'lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py'
--- lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2016-06-01 15:13:12 +0000
+++ lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2018-01-02 16:24:23 +0000
@@ -269,7 +269,7 @@
269 result=True)269 result=True)
270270
271 def assertResultCount(self, count, result):271 def assertResultCount(self, count, result):
272 self.assertEquals(272 self.assertEqual(
273 1, len(os.listdir(os.path.join(self.upload_root, result))))273 1, len(os.listdir(os.path.join(self.upload_root, result))))
274274
275 @defer.inlineCallbacks275 @defer.inlineCallbacks
276276
=== modified file 'lib/lp/buildmaster/tests/test_processor.py'
--- lib/lp/buildmaster/tests/test_processor.py 2015-04-20 11:07:41 +0000
+++ lib/lp/buildmaster/tests/test_processor.py 2018-01-02 16:24:23 +0000
@@ -27,7 +27,7 @@
27 def test_getByName(self):27 def test_getByName(self):
28 processor_set = getUtility(IProcessorSet)28 processor_set = getUtility(IProcessorSet)
29 q1 = self.factory.makeProcessor(name='q1')29 q1 = self.factory.makeProcessor(name='q1')
30 self.assertEquals(q1, processor_set.getByName('q1'))30 self.assertEqual(q1, processor_set.getByName('q1'))
3131
32 def test_getByName_not_found(self):32 def test_getByName_not_found(self):
33 processor_set = getUtility(IProcessorSet)33 processor_set = getUtility(IProcessorSet)
@@ -42,7 +42,7 @@
42 self.factory.makeProcessor(name='q1')42 self.factory.makeProcessor(name='q1')
43 self.factory.makeProcessor(name='i686')43 self.factory.makeProcessor(name='i686')
44 self.factory.makeProcessor(name='g4')44 self.factory.makeProcessor(name='g4')
45 self.assertEquals(45 self.assertEqual(
46 ['g4', 'i686', 'q1'],46 ['g4', 'i686', 'q1'],
47 sorted(47 sorted(
48 processor.name for processor in processor_set.getAll()48 processor.name for processor in processor_set.getAll()
@@ -68,7 +68,7 @@
68 processor = self.webservice.named_get(68 processor = self.webservice.named_get(
69 '/+processors', 'getByName', name='transmeta',69 '/+processors', 'getByName', name='transmeta',
70 api_version='devel').jsonBody()70 api_version='devel').jsonBody()
71 self.assertEquals('transmeta', processor['name'])71 self.assertEqual('transmeta', processor['name'])
7272
73 def test_default_collection(self):73 def test_default_collection(self):
74 # Make it easy to filter out sample data74 # Make it easy to filter out sample data
@@ -82,7 +82,7 @@
8282
83 collection = self.webservice.get(83 collection = self.webservice.get(
84 '/+processors?ws.size=10', api_version='devel').jsonBody()84 '/+processors?ws.size=10', api_version='devel').jsonBody()
85 self.assertEquals(85 self.assertEqual(
86 ['g4', 'i686', 'q1'],86 ['g4', 'i686', 'q1'],
87 sorted(87 sorted(
88 processor['name'] for processor in collection['entries']88 processor['name'] for processor in collection['entries']
8989
=== modified file 'lib/lp/buildmaster/tests/test_queuedepth.py'
--- lib/lp/buildmaster/tests/test_queuedepth.py 2015-05-14 08:50:41 +0000
+++ lib/lp/buildmaster/tests/test_queuedepth.py 2018-01-02 16:24:23 +0000
@@ -75,7 +75,7 @@
75 time_stamp = job.date_started or datetime.now(utc)75 time_stamp = job.date_started or datetime.now(utc)
76 estimate = job.getEstimatedJobStartTime(now=time_stamp)76 estimate = job.getEstimatedJobStartTime(now=time_stamp)
77 if delay_in_seconds is None:77 if delay_in_seconds is None:
78 test.assertEquals(78 test.assertEqual(
79 delay_in_seconds, estimate,79 delay_in_seconds, estimate,
80 "An estimate should not be possible at present but one was "80 "An estimate should not be possible at present but one was "
81 "returned (%s) nevertheless." % estimate)81 "returned (%s) nevertheless." % estimate)
@@ -509,7 +509,7 @@
509 builder.builderok = False509 builder.builderok = False
510510
511 # No builders capable of running the job at hand are available now.511 # No builders capable of running the job at hand are available now.
512 self.assertEquals(0, builders_for_job(apg_job))512 self.assertEqual(0, builders_for_job(apg_job))
513 # The "minimum time to builder" estimation logic is not aware of this513 # The "minimum time to builder" estimation logic is not aware of this
514 # though.514 # though.
515 check_mintime_to_builder(self, apg_job, 0)515 check_mintime_to_builder(self, apg_job, 0)
@@ -526,7 +526,7 @@
526526
527 # All native builders are disabled now. No builders capable of527 # All native builders are disabled now. No builders capable of
528 # running the job at hand are available.528 # running the job at hand are available.
529 self.assertEquals(0, builders_for_job(job))529 self.assertEqual(0, builders_for_job(job))
530 # The "minimum time to builder" estimation logic is not aware of the530 # The "minimum time to builder" estimation logic is not aware of the
531 # fact that no builders capable of running the job are available.531 # fact that no builders capable of running the job are available.
532 check_mintime_to_builder(self, job, 0)532 check_mintime_to_builder(self, job, 0)
@@ -678,7 +678,7 @@
678 builder.builderok = False678 builder.builderok = False
679679
680 # No builders capable of running the job at hand are available now.680 # No builders capable of running the job at hand are available now.
681 self.assertEquals(0, builders_for_job(apg_job))681 self.assertEqual(0, builders_for_job(apg_job))
682 check_mintime_to_builder(self, apg_job, 0)682 check_mintime_to_builder(self, apg_job, 0)
683683
684 # Let's add a processor-independent job to the mix.684 # Let's add a processor-independent job to the mix.
@@ -687,7 +687,7 @@
687 sourcename='my-recipe-digikam', score=9999)687 sourcename='my-recipe-digikam', score=9999)
688 # There are still builders available for the processor-independent688 # There are still builders available for the processor-independent
689 # job.689 # job.
690 self.assertEquals(6, builders_for_job(job))690 self.assertEqual(6, builders_for_job(job))
691 # Even free ones.691 # Even free ones.
692 self.assertTrue(692 self.assertTrue(
693 bq._getFreeBuildersCount(job.processor, job.virtualized) > 0,693 bq._getFreeBuildersCount(job.processor, job.virtualized) > 0,
@@ -702,7 +702,7 @@
702702
703 # There are no builders capable of running even the processor703 # There are no builders capable of running even the processor
704 # independent jobs now.704 # independent jobs now.
705 self.assertEquals(0, builders_for_job(job))705 self.assertEqual(0, builders_for_job(job))
706 check_mintime_to_builder(self, job, 0)706 check_mintime_to_builder(self, job, 0)
707707
708 # Re-enable the native hppa builders.708 # Re-enable the native hppa builders.
@@ -840,9 +840,9 @@
840 check_delay_for_job(self, zsh_job, 0)840 check_delay_for_job(self, zsh_job, 0)
841841
842 # Assign the zsh job to a builder.842 # Assign the zsh job to a builder.
843 self.assertEquals((None, False), bash_job._getHeadJobPlatform())843 self.assertEqual((None, False), bash_job._getHeadJobPlatform())
844 assign_to_builder(self, 'xx-recipe-zsh', 1, None)844 assign_to_builder(self, 'xx-recipe-zsh', 1, None)
845 self.assertEquals((1, False), bash_job._getHeadJobPlatform())845 self.assertEqual((1, False), bash_job._getHeadJobPlatform())
846846
847 # Now that the highest-scored job is out of the way, the estimation847 # Now that the highest-scored job is out of the way, the estimation
848 # for the 'bash' recipe build is 222 seconds shorter.848 # for the 'bash' recipe build is 222 seconds shorter.
@@ -858,7 +858,7 @@
858 # Also, the platform of the postgres job is returned since it *is*858 # Also, the platform of the postgres job is returned since it *is*
859 # the head job now.859 # the head job now.
860 pg_platform = (postgres_job.processor.id, postgres_job.virtualized)860 pg_platform = (postgres_job.processor.id, postgres_job.virtualized)
861 self.assertEquals(pg_platform, postgres_job._getHeadJobPlatform())861 self.assertEqual(pg_platform, postgres_job._getHeadJobPlatform())
862862
863863
864class TestJobDispatchTimeEstimation(MultiArchBuildsBase):864class TestJobDispatchTimeEstimation(MultiArchBuildsBase):
@@ -948,7 +948,7 @@
948 # processor-independent jobs:948 # processor-independent jobs:
949 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47 + 9:14)/6 = 831949 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47 + 9:14)/6 = 831
950 check_estimate(self, gcc_job, 1671)950 check_estimate(self, gcc_job, 1671)
951 self.assertEquals(5, builders_for_job(gcc_job))951 self.assertEqual(5, builders_for_job(gcc_job))
952952
953 def test_proc_indep_virtual_true(self):953 def test_proc_indep_virtual_true(self):
954 xxr_build, xxr_job = find_job(self, 'xxr-apt-build', None)954 xxr_build, xxr_job = find_job(self, 'xxr-apt-build', None)
@@ -1029,8 +1029,8 @@
1029 # processor-independent jobs :1029 # processor-independent jobs :
1030 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47)/5 = 8871030 # (12:56 + 11:05 + 18:30 + 16:38 + 14:47)/5 = 887
1031 # waiting time for next builder: = 1201031 # waiting time for next builder: = 120
1032 self.assertEquals(2, builders_for_job(vim_job))1032 self.assertEqual(2, builders_for_job(vim_job))
1033 self.assertEquals(9, builders_for_job(xxr_job))1033 self.assertEqual(9, builders_for_job(xxr_job))
1034 check_estimate(self, vim_job, 2747)1034 check_estimate(self, vim_job, 2747)
10351035
1036 def test_estimation_binary_virtual_headjob(self):1036 def test_estimation_binary_virtual_headjob(self):
10371037
=== modified file 'lib/lp/buildmaster/tests/test_webservice.py'
--- lib/lp/buildmaster/tests/test_webservice.py 2015-09-29 01:38:34 +0000
+++ lib/lp/buildmaster/tests/test_webservice.py 2018-01-02 16:24:23 +0000
@@ -79,7 +79,7 @@
79 logout()79 logout()
80 results = self.webservice.named_get(80 results = self.webservice.named_get(
81 '/builders', 'getBuildQueueSizes', api_version='devel')81 '/builders', 'getBuildQueueSizes', api_version='devel')
82 self.assertEquals(82 self.assertEqual(
83 ['nonvirt', 'virt'], sorted(results.jsonBody().keys()))83 ['nonvirt', 'virt'], sorted(results.jsonBody().keys()))
8484
85 def test_getBuildersForQueue(self):85 def test_getBuildersForQueue(self):
@@ -99,7 +99,7 @@
99 '/builders', 'getBuildersForQueue',99 '/builders', 'getBuildersForQueue',
100 processor=api_url(quantum), virtualized=True,100 processor=api_url(quantum), virtualized=True,
101 api_version='devel').jsonBody()101 api_version='devel').jsonBody()
102 self.assertEquals(102 self.assertEqual(
103 ['quantum_builder1', 'quantum_builder2'],103 ['quantum_builder1', 'quantum_builder2'],
104 sorted(builder['name'] for builder in results['entries']))104 sorted(builder['name'] for builder in results['entries']))
105105
106106
=== modified file 'lib/lp/code/browser/tests/test_branch.py'
--- lib/lp/code/browser/tests/test_branch.py 2017-11-10 11:28:43 +0000
+++ lib/lp/code/browser/tests/test_branch.py 2018-01-02 16:24:23 +0000
@@ -1046,7 +1046,7 @@
1046 browser.contents,1046 browser.contents,
1047 Contains('Public branches are not allowed for target Commercial.'))1047 Contains('Public branches are not allowed for target Commercial.'))
1048 with person_logged_in(owner):1048 with person_logged_in(owner):
1049 self.assertEquals(initial_target, branch.target.context)1049 self.assertEqual(initial_target, branch.target.context)
10501050
1051 def test_information_type_in_ui(self):1051 def test_information_type_in_ui(self):
1052 # The information_type of a branch can be changed via the UI by an1052 # The information_type of a branch can be changed via the UI by an
10531053
=== modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py'
--- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2017-10-21 18:14:14 +0000
+++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2018-01-02 16:24:23 +0000
@@ -443,7 +443,7 @@
443 self.makeBranchAndPackage(), '+new-recipe', user=self.chef)443 self.makeBranchAndPackage(), '+new-recipe', user=self.chef)
444 # The options for the owner include the Good Chefs team.444 # The options for the owner include the Good Chefs team.
445 options = browser.getControl(name='field.owner.owner').displayOptions445 options = browser.getControl(name='field.owner.owner').displayOptions
446 self.assertEquals(446 self.assertEqual(
447 ['Good Chefs (good-chefs)', 'Master Chef (chef)'],447 ['Good Chefs (good-chefs)', 'Master Chef (chef)'],
448 sorted([str(option) for option in options]))448 sorted([str(option) for option in options]))
449449
450450
=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py 2017-11-06 09:32:45 +0000
+++ lib/lp/code/model/tests/test_branch.py 2018-01-02 16:24:23 +0000
@@ -1240,8 +1240,8 @@
1240 branch_id = self.branch.id1240 branch_id = self.branch.id
1241 branch_set = getUtility(IBranchLookup)1241 branch_set = getUtility(IBranchLookup)
1242 self.branch.destroySelf()1242 self.branch.destroySelf()
1243 self.assert_(branch_set.get(branch_id) is None,1243 self.assertIsNone(
1244 "The branch has not been deleted.")1244 branch_set.get(branch_id), "The branch has not been deleted.")
12451245
1246 def test_stackedBranchDisablesDeletion(self):1246 def test_stackedBranchDisablesDeletion(self):
1247 # A branch that is stacked upon cannot be deleted.1247 # A branch that is stacked upon cannot be deleted.
12481248
=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
--- lib/lp/code/model/tests/test_branchmergeproposal.py 2017-11-24 17:22:34 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposal.py 2018-01-02 16:24:23 +0000
@@ -2354,13 +2354,13 @@
2354 self.factory.makeRevisionsForBranch(bmp.source_branch, count=5)2354 self.factory.makeRevisionsForBranch(bmp.source_branch, count=5)
2355 r1 = bmp.source_branch.getBranchRevision(sequence=1)2355 r1 = bmp.source_branch.getBranchRevision(sequence=1)
2356 initial_revisions = list(bmp.getUnlandedSourceBranchRevisions())2356 initial_revisions = list(bmp.getUnlandedSourceBranchRevisions())
2357 self.assertEquals(5, len(initial_revisions))2357 self.assertEqual(5, len(initial_revisions))
2358 self.assertIn(r1, initial_revisions)2358 self.assertIn(r1, initial_revisions)
2359 # If we push one of the revisions into the target, it disappears2359 # If we push one of the revisions into the target, it disappears
2360 # from the unlanded list.2360 # from the unlanded list.
2361 bmp.target_branch.createBranchRevision(1, r1.revision)2361 bmp.target_branch.createBranchRevision(1, r1.revision)
2362 partial_revisions = list(bmp.getUnlandedSourceBranchRevisions())2362 partial_revisions = list(bmp.getUnlandedSourceBranchRevisions())
2363 self.assertEquals(4, len(partial_revisions))2363 self.assertEqual(4, len(partial_revisions))
2364 self.assertNotIn(r1, partial_revisions)2364 self.assertNotIn(r1, partial_revisions)
23652365
23662366
23672367
=== modified file 'lib/lp/code/model/tests/test_codeimportjob.py'
--- lib/lp/code/model/tests/test_codeimportjob.py 2017-10-04 01:53:48 +0000
+++ lib/lp/code/model/tests/test_codeimportjob.py 2018-01-02 16:24:23 +0000
@@ -137,7 +137,7 @@
137 """Assert that the expected job is chosen by getJobForMachine."""137 """Assert that the expected job is chosen by getJobForMachine."""
138 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(138 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(
139 self.machine.hostname, worker_limit=10)139 self.machine.hostname, worker_limit=10)
140 self.assert_(observed_job is not None, "No job was selected.")140 self.assertIsNotNone(observed_job, "No job was selected.")
141 self.assertEqual(desired_job, observed_job,141 self.assertEqual(desired_job, observed_job,
142 "Expected job not selected.")142 "Expected job not selected.")
143143
@@ -145,7 +145,7 @@
145 """Assert that no job is selected."""145 """Assert that no job is selected."""
146 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(146 observed_job = getUtility(ICodeImportJobSet).getJobForMachine(
147 'machine', worker_limit=10)147 'machine', worker_limit=10)
148 self.assert_(observed_job is None, "Job unexpectedly selected.")148 self.assertIsNone(observed_job, "Job unexpectedly selected.")
149149
150 def test_nothingSelectedIfNothingCreated(self):150 def test_nothingSelectedIfNothingCreated(self):
151 # There are no due jobs pending if we don't create any (this151 # There are no due jobs pending if we don't create any (this
@@ -775,7 +775,7 @@
775 getUtility(ICodeImportJobWorkflow).finishJob(775 getUtility(ICodeImportJobWorkflow).finishJob(
776 running_job, CodeImportResultStatus.SUCCESS, None)776 running_job, CodeImportResultStatus.SUCCESS, None)
777 new_job = code_import.import_job777 new_job = code_import.import_job
778 self.assert_(new_job is not None)778 self.assertIsNotNone(new_job)
779 self.assertEqual(new_job.state, CodeImportJobState.PENDING)779 self.assertEqual(new_job.state, CodeImportJobState.PENDING)
780 self.assertEqual(new_job.machine, None)780 self.assertEqual(new_job.machine, None)
781 self.assertEqual(781 self.assertEqual(
@@ -791,7 +791,7 @@
791 getUtility(ICodeImportJobWorkflow).finishJob(791 getUtility(ICodeImportJobWorkflow).finishJob(
792 running_job, CodeImportResultStatus.SUCCESS_PARTIAL, None)792 running_job, CodeImportResultStatus.SUCCESS_PARTIAL, None)
793 new_job = code_import.import_job793 new_job = code_import.import_job
794 self.assert_(new_job is not None)794 self.assertIsNotNone(new_job)
795 self.assertEqual(new_job.state, CodeImportJobState.PENDING)795 self.assertEqual(new_job.state, CodeImportJobState.PENDING)
796 self.assertEqual(new_job.machine, None)796 self.assertEqual(new_job.machine, None)
797 self.assertSqlAttributeEqualsDate(new_job, 'date_due', UTC_NOW)797 self.assertSqlAttributeEqualsDate(new_job, 'date_due', UTC_NOW)
798798
=== modified file 'lib/lp/code/model/tests/test_recipebuilder.py'
--- lib/lp/code/model/tests/test_recipebuilder.py 2017-10-04 01:53:48 +0000
+++ lib/lp/code/model/tests/test_recipebuilder.py 2018-01-02 16:24:23 +0000
@@ -128,7 +128,7 @@
128 job.setBuilder(builder, OkSlave())128 job.setBuilder(builder, OkSlave())
129 logger = BufferLogger()129 logger = BufferLogger()
130 job.verifyBuildRequest(logger)130 job.verifyBuildRequest(logger)
131 self.assertEquals("", logger.getLogBuffer())131 self.assertEqual("", logger.getLogBuffer())
132132
133 def test_verifyBuildRequest_non_virtual(self):133 def test_verifyBuildRequest_non_virtual(self):
134 # verifyBuildRequest will raise if a non-virtual builder is proposed.134 # verifyBuildRequest will raise if a non-virtual builder is proposed.
135135
=== modified file 'lib/lp/code/model/tests/test_revision.py'
--- lib/lp/code/model/tests/test_revision.py 2017-10-04 01:49:22 +0000
+++ lib/lp/code/model/tests/test_revision.py 2018-01-02 16:24:23 +0000
@@ -215,7 +215,7 @@
215 # IRevisionSet.getByRevisionId returns the revision with that id.215 # IRevisionSet.getByRevisionId returns the revision with that id.
216 revision = self.factory.makeRevision()216 revision = self.factory.makeRevision()
217 found = self.revision_set.getByRevisionId(revision.revision_id)217 found = self.revision_set.getByRevisionId(revision.revision_id)
218 self.assertEquals(revision, found)218 self.assertEqual(revision, found)
219219
220 def test_getRevisionById_nonexistent(self):220 def test_getRevisionById_nonexistent(self):
221 # IRevisionSet.getByRevisionId returns None if there is no revision221 # IRevisionSet.getByRevisionId returns None if there is no revision
222222
=== modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py'
--- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2017-10-04 01:53:48 +0000
+++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2018-01-02 16:24:23 +0000
@@ -356,9 +356,9 @@
356 date_created=datetime.now(utc) - timedelta(hours=24, seconds=1),356 date_created=datetime.now(utc) - timedelta(hours=24, seconds=1),
357 status=BuildStatus.FULLYBUILT)357 status=BuildStatus.FULLYBUILT)
358 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()358 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
359 self.assertEquals(1, len(daily_builds))359 self.assertEqual(1, len(daily_builds))
360 actual_title = [b.title for b in daily_builds]360 actual_title = [b.title for b in daily_builds]
361 self.assertEquals([build.title], actual_title)361 self.assertEqual([build.title], actual_title)
362362
363 def test_makeDailyBuilds_with_an_older_and_newer_build(self):363 def test_makeDailyBuilds_with_an_older_and_newer_build(self):
364 # If a recipe has been built twice, and the most recent build is364 # If a recipe has been built twice, and the most recent build is
@@ -374,7 +374,7 @@
374 date_created=datetime.now(utc) - timediff,374 date_created=datetime.now(utc) - timediff,
375 status=BuildStatus.FULLYBUILT)375 status=BuildStatus.FULLYBUILT)
376 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()376 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
377 self.assertEquals([], list(daily_builds))377 self.assertEqual([], list(daily_builds))
378378
379 def test_makeDailyBuilds_with_new_build_different_archive(self):379 def test_makeDailyBuilds_with_new_build_different_archive(self):
380 # If a recipe has been built into an archive that isn't the380 # If a recipe has been built into an archive that isn't the
@@ -390,7 +390,7 @@
390 status=BuildStatus.FULLYBUILT)390 status=BuildStatus.FULLYBUILT)
391 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()391 daily_builds = SourcePackageRecipeBuild.makeDailyBuilds()
392 actual_title = [b.title for b in daily_builds]392 actual_title = [b.title for b in daily_builds]
393 self.assertEquals([build.title], actual_title)393 self.assertEqual([build.title], actual_title)
394394
395 def test_makeDailyBuilds_with_disallowed_series(self):395 def test_makeDailyBuilds_with_disallowed_series(self):
396 # If a recipe is set to build into a disallowed series,396 # If a recipe is set to build into a disallowed series,
@@ -402,7 +402,7 @@
402 distroseries = list(recipe.distroseries)[0]402 distroseries = list(recipe.distroseries)[0]
403 removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE403 removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE
404 SourcePackageRecipeBuild.makeDailyBuilds(logger)404 SourcePackageRecipeBuild.makeDailyBuilds(logger)
405 self.assertEquals([], self.oopses)405 self.assertEqual([], self.oopses)
406 self.assertIn(406 self.assertIn(
407 "DEBUG - cannot build against Warty (4.10).",407 "DEBUG - cannot build against Warty (4.10).",
408 logger.getLogBuffer())408 logger.getLogBuffer())
@@ -452,7 +452,7 @@
452 def test_getUploader(self):452 def test_getUploader(self):
453 # For ACL purposes the uploader is the build requester.453 # For ACL purposes the uploader is the build requester.
454 build = self.makeSourcePackageRecipeBuild()454 build = self.makeSourcePackageRecipeBuild()
455 self.assertEquals(build.requester,455 self.assertEqual(build.requester,
456 build.getUploader(None))456 build.getUploader(None))
457457
458 def test_getByBuildFarmJob(self):458 def test_getByBuildFarmJob(self):
@@ -497,7 +497,7 @@
497 build.updateStatus(BuildStatus.FULLYBUILT)497 build.updateStatus(BuildStatus.FULLYBUILT)
498 IStore(build).flush()498 IStore(build).flush()
499 build.notify()499 build.notify()
500 self.assertEquals(0, len(pop_notifications()))500 self.assertEqual(0, len(pop_notifications()))
501501
502 def test_notify_when_recipe_deleted(self):502 def test_notify_when_recipe_deleted(self):
503 """Notify does nothing if recipe has been deleted."""503 """Notify does nothing if recipe has been deleted."""
@@ -516,4 +516,4 @@
516 IStore(build).flush()516 IStore(build).flush()
517 build.notify()517 build.notify()
518 notifications = pop_notifications()518 notifications = pop_notifications()
519 self.assertEquals(0, len(notifications))519 self.assertEqual(0, len(notifications))
520520
=== modified file 'lib/lp/code/tests/test_branch_webservice.py'
--- lib/lp/code/tests/test_branch_webservice.py 2017-10-04 01:53:48 +0000
+++ lib/lp/code/tests/test_branch_webservice.py 2018-01-02 16:24:23 +0000
@@ -114,7 +114,7 @@
114 target_branch=target, initial_comment='Merge\nit!',114 target_branch=target, initial_comment='Merge\nit!',
115 needs_review=True, commit_message='It was merged!\n',115 needs_review=True, commit_message='It was merged!\n',
116 reviewers=[source.owner.self_link], review_types=[])116 reviewers=[source.owner.self_link], review_types=[])
117 self.assertEquals(117 self.assertEqual(
118 exception.content,118 exception.content,
119 'reviewers and review_types must be equal length.')119 'reviewers and review_types must be equal length.')
120120
@@ -148,7 +148,7 @@
148 BadRequest, source.createMergeProposal,148 BadRequest, source.createMergeProposal,
149 target_branch=source, initial_comment='Merge\nit!',149 target_branch=source, initial_comment='Merge\nit!',
150 needs_review=True, commit_message='It was merged!\n')150 needs_review=True, commit_message='It was merged!\n')
151 self.assertEquals(151 self.assertEqual(
152 exception.content,152 exception.content,
153 'Source and target branches must be different.')153 'Source and target branches must be different.')
154154
155155
=== modified file 'lib/lp/code/tests/test_bzr.py'
--- lib/lp/code/tests/test_bzr.py 2017-10-04 01:49:22 +0000
+++ lib/lp/code/tests/test_bzr.py 2018-01-02 16:24:23 +0000
@@ -85,7 +85,7 @@
8585
86 def test_empty(self):86 def test_empty(self):
87 branch = self.make_branch('test')87 branch = self.make_branch('test')
88 self.assertEquals([], branch_revision_history(branch))88 self.assertEqual([], branch_revision_history(branch))
8989
90 def test_some_commits(self):90 def test_some_commits(self):
91 branch = self.make_branch('test')91 branch = self.make_branch('test')
@@ -93,7 +93,7 @@
93 tree.commit('acommit', rev_id=b'A')93 tree.commit('acommit', rev_id=b'A')
94 tree.commit('bcommit', rev_id=b'B')94 tree.commit('bcommit', rev_id=b'B')
95 tree.commit('ccommit', rev_id=b'C')95 tree.commit('ccommit', rev_id=b'C')
96 self.assertEquals(96 self.assertEqual(
97 [b'A', b'B', b'C'], branch_revision_history(tree.branch))97 [b'A', b'B', b'C'], branch_revision_history(tree.branch))
9898
9999
100100
=== modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py'
--- lib/lp/code/xmlrpc/tests/test_codehosting.py 2016-12-31 05:01:10 +0000
+++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2018-01-02 16:24:23 +0000
@@ -258,7 +258,7 @@
258 self.assertUnmirrored(branch)258 self.assertUnmirrored(branch)
259259
260 branch.requestMirror()260 branch.requestMirror()
261 self.assertEquals(261 self.assertEqual(
262 branch.id, self.codehosting_api.acquireBranchToPull([])[0])262 branch.id, self.codehosting_api.acquireBranchToPull([])[0])
263263
264 failure_message = self.factory.getUniqueString()264 failure_message = self.factory.getUniqueString()
265265
=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
--- lib/lp/codehosting/codeimport/tests/test_worker.py 2017-01-12 18:01:56 +0000
+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2018-01-02 16:24:23 +0000
@@ -253,7 +253,7 @@
253 target_url = store._getMirrorURL(self.arbitrary_branch_id)253 target_url = store._getMirrorURL(self.arbitrary_branch_id)
254 knit_format = format_registry.get('knit')()254 knit_format = format_registry.get('knit')()
255 tree = create_branch_with_one_revision(target_url, format=knit_format)255 tree = create_branch_with_one_revision(target_url, format=knit_format)
256 self.assertNotEquals(256 self.assertNotEqual(
257 tree.bzrdir._format.repository_format.network_name(),257 tree.bzrdir._format.repository_format.network_name(),
258 default_format.repository_format.network_name())258 default_format.repository_format.network_name())
259259
@@ -261,8 +261,8 @@
261 new_branch = store.pull(261 new_branch = store.pull(
262 self.arbitrary_branch_id, self.temp_dir, default_format)262 self.arbitrary_branch_id, self.temp_dir, default_format)
263 # Make sure backup.bzr is removed, as it interferes with CSCVS.263 # Make sure backup.bzr is removed, as it interferes with CSCVS.
264 self.assertEquals(os.listdir(self.temp_dir), [".bzr"])264 self.assertEqual(os.listdir(self.temp_dir), [".bzr"])
265 self.assertEquals(new_branch.repository._format.network_name(),265 self.assertEqual(new_branch.repository._format.network_name(),
266 default_format.repository_format.network_name())266 default_format.repository_format.network_name())
267267
268 def test_pushUpgradesFormat(self):268 def test_pushUpgradesFormat(self):
@@ -292,13 +292,13 @@
292 # Only .bzr is left behind. The scanner removes branches292 # Only .bzr is left behind. The scanner removes branches
293 # in which invalid directories (such as .bzr.retire.293 # in which invalid directories (such as .bzr.retire.
294 # exist). (bug #798560)294 # exist). (bug #798560)
295 self.assertEquals(295 self.assertEqual(
296 target_branch.user_transport.list_dir("."),296 target_branch.user_transport.list_dir("."),
297 [".bzr"])297 [".bzr"])
298 self.assertEqual(298 self.assertEqual(
299 default_format.get_branch_format(),299 default_format.get_branch_format(),
300 target_branch._format)300 target_branch._format)
301 self.assertEquals(301 self.assertEqual(
302 target_branch.last_revision_info(),302 target_branch.last_revision_info(),
303 new_branch.last_revision_info())303 new_branch.last_revision_info())
304304
@@ -461,7 +461,7 @@
461 store = ImportDataStore(transport, source_details)461 store = ImportDataStore(transport, source_details)
462 local_name = '%s.tar.gz' % (self.factory.getUniqueString('tarball'),)462 local_name = '%s.tar.gz' % (self.factory.getUniqueString('tarball'),)
463 store.fetch(local_name)463 store.fetch(local_name)
464 self.assertEquals(content, open(local_name).read())464 self.assertEqual(content, open(local_name).read())
465465
466 def test_fetch_with_dest_transport(self):466 def test_fetch_with_dest_transport(self):
467 # The second, optional, argument to fetch is the transport in which to467 # The second, optional, argument to fetch is the transport in which to
@@ -478,7 +478,7 @@
478 self.get_transport(local_prefix).ensure_base()478 self.get_transport(local_prefix).ensure_base()
479 local_name = '%s.tar.gz' % (self.factory.getUniqueString(),)479 local_name = '%s.tar.gz' % (self.factory.getUniqueString(),)
480 store.fetch(local_name, self.get_transport(local_prefix))480 store.fetch(local_name, self.get_transport(local_prefix))
481 self.assertEquals(481 self.assertEqual(
482 content, open(os.path.join(local_prefix, local_name)).read())482 content, open(os.path.join(local_prefix, local_name)).read())
483483
484 def test_put_copiesFileToTransport(self):484 def test_put_copiesFileToTransport(self):
@@ -494,7 +494,7 @@
494 # That the remote name is like this is part of the interface of494 # That the remote name is like this is part of the interface of
495 # ImportDataStore.495 # ImportDataStore.
496 remote_name = '%08x.tar.gz' % (source_details.target_id,)496 remote_name = '%08x.tar.gz' % (source_details.target_id,)
497 self.assertEquals(content, transport.get_bytes(remote_name))497 self.assertEqual(content, transport.get_bytes(remote_name))
498498
499 def test_put_ensures_base(self):499 def test_put_ensures_base(self):
500 # Put ensures that the directory pointed to by the transport exists.500 # Put ensures that the directory pointed to by the transport exists.
@@ -522,7 +522,7 @@
522 # That the remote name is like this is part of the interface of522 # That the remote name is like this is part of the interface of
523 # ImportDataStore.523 # ImportDataStore.
524 remote_name = '%08x.tar.gz' % (source_details.target_id,)524 remote_name = '%08x.tar.gz' % (source_details.target_id,)
525 self.assertEquals(content, transport.get_bytes(remote_name))525 self.assertEqual(content, transport.get_bytes(remote_name))
526526
527527
528class MockForeignWorkingTree:528class MockForeignWorkingTree:
@@ -1110,7 +1110,7 @@
1110 # There should only be one revision there, the other1110 # There should only be one revision there, the other
1111 # one is in the stacked-on repository.1111 # one is in the stacked-on repository.
1112 self.addCleanup(stacked_on.lock_read().unlock)1112 self.addCleanup(stacked_on.lock_read().unlock)
1113 self.assertEquals(1113 self.assertEqual(
1114 base_rev_count,1114 base_rev_count,
1115 len(stacked_on.repository.revisions.keys()))1115 len(stacked_on.repository.revisions.keys()))
1116 worker = self.makeImportWorker(1116 worker = self.makeImportWorker(
@@ -1120,15 +1120,15 @@
1120 self.assertEqual(1120 self.assertEqual(
1121 CodeImportWorkerExitCode.SUCCESS, worker.run())1121 CodeImportWorkerExitCode.SUCCESS, worker.run())
1122 branch = self.getStoredBazaarBranch(worker)1122 branch = self.getStoredBazaarBranch(worker)
1123 self.assertEquals(1123 self.assertEqual(
1124 base_rev_count,1124 base_rev_count,
1125 len(stacked_on.repository.revisions.keys()))1125 len(stacked_on.repository.revisions.keys()))
1126 # There should only be one revision there, the other1126 # There should only be one revision there, the other
1127 # one is in the stacked-on repository.1127 # one is in the stacked-on repository.
1128 self.addCleanup(branch.lock_read().unlock)1128 self.addCleanup(branch.lock_read().unlock)
1129 self.assertEquals(1,1129 self.assertEqual(1,
1130 len(branch.repository.revisions.without_fallbacks().keys()))1130 len(branch.repository.revisions.without_fallbacks().keys()))
1131 self.assertEquals(stacked_on.base, branch.get_stacked_on_url())1131 self.assertEqual(stacked_on.base, branch.get_stacked_on_url())
11321132
11331133
1134class TestGitImport(WorkerTest, TestActualImportMixin,1134class TestGitImport(WorkerTest, TestActualImportMixin,
@@ -1197,7 +1197,7 @@
1197 source_details.url = urlutils.join_segment_parameters(1197 source_details.url = urlutils.join_segment_parameters(
1198 source_details.url, {"branch": "other"})1198 source_details.url, {"branch": "other"})
1199 source_transport = get_transport_from_url(source_details.url)1199 source_transport = get_transport_from_url(source_details.url)
1200 self.assertEquals(1200 self.assertEqual(
1201 {"branch": "other"},1201 {"branch": "other"},
1202 source_transport.get_segment_parameters())1202 source_transport.get_segment_parameters())
1203 worker = self.makeImportWorker(source_details,1203 worker = self.makeImportWorker(source_details,
@@ -1207,7 +1207,7 @@
1207 CodeImportWorkerExitCode.SUCCESS, worker.run())1207 CodeImportWorkerExitCode.SUCCESS, worker.run())
1208 branch = worker.getBazaarBranch()1208 branch = worker.getBazaarBranch()
1209 lastrev = branch.repository.get_revision(branch.last_revision())1209 lastrev = branch.repository.get_revision(branch.last_revision())
1210 self.assertEquals(lastrev.message, "Message for other")1210 self.assertEqual(lastrev.message, "Message for other")
12111211
12121212
1213class TestBzrSvnImport(WorkerTest, SubversionImportHelpers,1213class TestBzrSvnImport(WorkerTest, SubversionImportHelpers,
@@ -1311,7 +1311,7 @@
1311 self.policy = CodeImportBranchOpenPolicy("bzr", "bzr")1311 self.policy = CodeImportBranchOpenPolicy("bzr", "bzr")
13121312
1313 def test_follows_references(self):1313 def test_follows_references(self):
1314 self.assertEquals(True, self.policy.shouldFollowReferences())1314 self.assertEqual(True, self.policy.shouldFollowReferences())
13151315
1316 def assertBadUrl(self, url):1316 def assertBadUrl(self, url):
1317 self.assertRaises(BadUrl, self.policy.checkOneURL, url)1317 self.assertRaises(BadUrl, self.policy.checkOneURL, url)
@@ -1378,7 +1378,7 @@
1378 branch_url = self.bazaar_store._getMirrorURL(1378 branch_url = self.bazaar_store._getMirrorURL(
1379 worker.source_details.target_id)1379 worker.source_details.target_id)
1380 branch = Branch.open(branch_url)1380 branch = Branch.open(branch_url)
1381 self.assertEquals(self.revid, branch.last_revision())1381 self.assertEqual(self.revid, branch.last_revision())
13821382
1383 def test_redirect_to_forbidden_url(self):1383 def test_redirect_to_forbidden_url(self):
1384 class NewUrlBlacklistPolicy(BranchOpenPolicy):1384 class NewUrlBlacklistPolicy(BranchOpenPolicy):
13851385
=== modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py'
--- lib/lp/codehosting/scanner/tests/test_buglinks.py 2016-02-04 05:43:46 +0000
+++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2018-01-02 16:24:23 +0000
@@ -61,7 +61,7 @@
61 # Parsing a single line should give a dict with a single entry,61 # Parsing a single line should give a dict with a single entry,
62 # mapping the bug_id to the status.62 # mapping the bug_id to the status.
63 bugs = self.extractBugInfo("https://launchpad.net/bugs/9999 fixed")63 bugs = self.extractBugInfo("https://launchpad.net/bugs/9999 fixed")
64 self.assertEquals(bugs, {9999: 'fixed'})64 self.assertEqual(bugs, {9999: 'fixed'})
6565
66 def test_multiple(self):66 def test_multiple(self):
67 # Information about more than one bug can be specified. Make sure that67 # Information about more than one bug can be specified. Make sure that
@@ -69,39 +69,39 @@
69 bugs = self.extractBugInfo(69 bugs = self.extractBugInfo(
70 "https://launchpad.net/bugs/9999 fixed\n"70 "https://launchpad.net/bugs/9999 fixed\n"
71 "https://launchpad.net/bugs/8888 fixed")71 "https://launchpad.net/bugs/8888 fixed")
72 self.assertEquals(bugs, {9999: 'fixed',72 self.assertEqual(bugs, {9999: 'fixed',
73 8888: 'fixed'})73 8888: 'fixed'})
7474
75 def test_empty(self):75 def test_empty(self):
76 # If the property is empty, then return an empty dict.76 # If the property is empty, then return an empty dict.
77 bugs = self.extractBugInfo('')77 bugs = self.extractBugInfo('')
78 self.assertEquals(bugs, {})78 self.assertEqual(bugs, {})
7979
80 def test_bad_bug(self):80 def test_bad_bug(self):
81 # If the given bug is not a valid integer, then skip it, generate an81 # If the given bug is not a valid integer, then skip it, generate an
82 # OOPS and continue processing.82 # OOPS and continue processing.
83 bugs = self.extractBugInfo('https://launchpad.net/~jml fixed')83 bugs = self.extractBugInfo('https://launchpad.net/~jml fixed')
84 self.assertEquals(bugs, {})84 self.assertEqual(bugs, {})
8585
86 def test_non_launchpad_bug(self):86 def test_non_launchpad_bug(self):
87 # References to bugs on sites other than launchpad are ignored.87 # References to bugs on sites other than launchpad are ignored.
88 bugs = self.extractBugInfo('http://bugs.debian.org/1234 fixed')88 bugs = self.extractBugInfo('http://bugs.debian.org/1234 fixed')
89 self.assertEquals(bugs, {})89 self.assertEqual(bugs, {})
9090
91 def test_duplicated_line(self):91 def test_duplicated_line(self):
92 # If a particular line is duplicated, silently ignore the duplicates.92 # If a particular line is duplicated, silently ignore the duplicates.
93 bugs = self.extractBugInfo(93 bugs = self.extractBugInfo(
94 'https://launchpad.net/bugs/9999 fixed\n'94 'https://launchpad.net/bugs/9999 fixed\n'
95 'https://launchpad.net/bugs/9999 fixed')95 'https://launchpad.net/bugs/9999 fixed')
96 self.assertEquals(bugs, {9999: 'fixed'})96 self.assertEqual(bugs, {9999: 'fixed'})
9797
98 def test_strict_url_checking(self):98 def test_strict_url_checking(self):
99 # Ignore URLs that look like a Launchpad bug URL but aren't.99 # Ignore URLs that look like a Launchpad bug URL but aren't.
100 bugs = self.extractBugInfo('https://launchpad.net/people/1234 fixed')100 bugs = self.extractBugInfo('https://launchpad.net/people/1234 fixed')
101 self.assertEquals(bugs, {})101 self.assertEqual(bugs, {})
102 bugs = self.extractBugInfo(102 bugs = self.extractBugInfo(
103 'https://launchpad.net/bugs/foo/1234 fixed')103 'https://launchpad.net/bugs/foo/1234 fixed')
104 self.assertEquals(bugs, {})104 self.assertEqual(bugs, {})
105105
106106
107class TestBugLinking(BzrSyncTestCase):107class TestBugLinking(BzrSyncTestCase):
108108
=== modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py'
--- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 10:54:31 +0000
+++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 16:24:23 +0000
@@ -359,7 +359,7 @@
359 self.commitRevision(committer=author)359 self.commitRevision(committer=author)
360 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)360 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
361 db_author = RevisionAuthor.selectOneBy(name=author)361 db_author = RevisionAuthor.selectOneBy(name=author)
362 self.assertEquals(db_author.name, author)362 self.assertEqual(db_author.name, author)
363363
364 def test_new_parent(self):364 def test_new_parent(self):
365 # Importing two revisions should import a new parent.365 # Importing two revisions should import a new parent.
@@ -371,13 +371,13 @@
371 def test_sync_updates_branch(self):371 def test_sync_updates_branch(self):
372 # test that the last scanned revision ID is recorded372 # test that the last scanned revision ID is recorded
373 self.syncAndCount()373 self.syncAndCount()
374 self.assertEquals(NULL_REVISION, self.db_branch.last_scanned_id)374 self.assertEqual(NULL_REVISION, self.db_branch.last_scanned_id)
375 last_modified = self.db_branch.date_last_modified375 last_modified = self.db_branch.date_last_modified
376 last_scanned = self.db_branch.last_scanned376 last_scanned = self.db_branch.last_scanned
377 self.commitRevision()377 self.commitRevision()
378 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)378 self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1)
379 self.assertEquals(self.bzr_branch.last_revision(),379 self.assertEqual(self.bzr_branch.last_revision(),
380 self.db_branch.last_scanned_id)380 self.db_branch.last_scanned_id)
381 self.assertTrue(self.db_branch.last_scanned > last_scanned,381 self.assertTrue(self.db_branch.last_scanned > last_scanned,
382 "last_scanned was not updated")382 "last_scanned was not updated")
383 self.assertTrue(self.db_branch.date_last_modified > last_modified,383 self.assertTrue(self.db_branch.date_last_modified > last_modified,
@@ -814,7 +814,7 @@
814 self.makeBzrSync(self.db_branch).syncBranchAndClose()814 self.makeBzrSync(self.db_branch).syncBranchAndClose()
815 # Check that properties were saved to the revision.815 # Check that properties were saved to the revision.
816 bzr_revision = self.bzr_branch.repository.get_revision('rev1')816 bzr_revision = self.bzr_branch.repository.get_revision('rev1')
817 self.assertEquals(properties, bzr_revision.properties)817 self.assertEqual(properties, bzr_revision.properties)
818 # Check that properties are stored in the database.818 # Check that properties are stored in the database.
819 db_revision = getUtility(IRevisionSet).getByRevisionId('rev1')819 db_revision = getUtility(IRevisionSet).getByRevisionId('rev1')
820 self.assertEquals(properties, db_revision.getProperties())820 self.assertEqual(properties, db_revision.getProperties())
821821
=== modified file 'lib/lp/codehosting/sshserver/tests/test_session.py'
--- lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 10:54:31 +0000
+++ lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 16:24:23 +0000
@@ -435,7 +435,7 @@
435 self.assertRaises(ForbiddenCommand, lookup_command_template, 'foo')435 self.assertRaises(ForbiddenCommand, lookup_command_template, 'foo')
436436
437 def test_bzr(self):437 def test_bzr(self):
438 self.assertEquals(438 self.assertEqual(
439 config.root + '/bin/py ' + get_bzr_path() +439 config.root + '/bin/py ' + get_bzr_path() +
440 ' lp-serve --inet %(user_id)s',440 ' lp-serve --inet %(user_id)s',
441 lookup_command_template(441 lookup_command_template(
442442
=== modified file 'lib/lp/codehosting/tests/test_safe_open.py'
--- lib/lp/codehosting/tests/test_safe_open.py 2012-09-06 00:01:38 +0000
+++ lib/lp/codehosting/tests/test_safe_open.py 2018-01-02 16:24:23 +0000
@@ -79,9 +79,8 @@
79 # When branch references are forbidden, checkAndFollowBranchReference79 # When branch references are forbidden, checkAndFollowBranchReference
80 # does not raise on non-references.80 # does not raise on non-references.
81 opener = self.makeBranchOpener(False, ['a', None])81 opener = self.makeBranchOpener(False, ['a', None])
82 self.assertEquals(82 self.assertEqual('a', opener.checkAndFollowBranchReference('a'))
83 'a', opener.checkAndFollowBranchReference('a'))83 self.assertEqual(['a'], opener.follow_reference_calls)
84 self.assertEquals(['a'], opener.follow_reference_calls)
8584
86 def testBranchReferenceForbidden(self):85 def testBranchReferenceForbidden(self):
87 # checkAndFollowBranchReference raises BranchReferenceForbidden if86 # checkAndFollowBranchReference raises BranchReferenceForbidden if
@@ -91,16 +90,15 @@
91 self.assertRaises(90 self.assertRaises(
92 BranchReferenceForbidden,91 BranchReferenceForbidden,
93 opener.checkAndFollowBranchReference, 'a')92 opener.checkAndFollowBranchReference, 'a')
94 self.assertEquals(['a'], opener.follow_reference_calls)93 self.assertEqual(['a'], opener.follow_reference_calls)
9594
96 def testAllowedReference(self):95 def testAllowedReference(self):
97 # checkAndFollowBranchReference does not raise if following references96 # checkAndFollowBranchReference does not raise if following references
98 # is allowed and the source URL points to a branch reference to a97 # is allowed and the source URL points to a branch reference to a
99 # permitted location.98 # permitted location.
100 opener = self.makeBranchOpener(True, ['a', 'b', None])99 opener = self.makeBranchOpener(True, ['a', 'b', None])
101 self.assertEquals(100 self.assertEqual('b', opener.checkAndFollowBranchReference('a'))
102 'b', opener.checkAndFollowBranchReference('a'))101 self.assertEqual(['a', 'b'], opener.follow_reference_calls)
103 self.assertEquals(['a', 'b'], opener.follow_reference_calls)
104102
105 def testCheckReferencedURLs(self):103 def testCheckReferencedURLs(self):
106 # checkAndFollowBranchReference checks if the URL a reference points104 # checkAndFollowBranchReference checks if the URL a reference points
@@ -109,7 +107,7 @@
109 True, ['a', 'b', None], unsafe_urls=set('b'))107 True, ['a', 'b', None], unsafe_urls=set('b'))
110 self.assertRaises(108 self.assertRaises(
111 BadUrl, opener.checkAndFollowBranchReference, 'a')109 BadUrl, opener.checkAndFollowBranchReference, 'a')
112 self.assertEquals(['a'], opener.follow_reference_calls)110 self.assertEqual(['a'], opener.follow_reference_calls)
113111
114 def testSelfReferencingBranch(self):112 def testSelfReferencingBranch(self):
115 # checkAndFollowBranchReference raises BranchReferenceLoopError if113 # checkAndFollowBranchReference raises BranchReferenceLoopError if
@@ -118,7 +116,7 @@
118 opener = self.makeBranchOpener(True, ['a', 'a'])116 opener = self.makeBranchOpener(True, ['a', 'a'])
119 self.assertRaises(117 self.assertRaises(
120 BranchLoopError, opener.checkAndFollowBranchReference, 'a')118 BranchLoopError, opener.checkAndFollowBranchReference, 'a')
121 self.assertEquals(['a'], opener.follow_reference_calls)119 self.assertEqual(['a'], opener.follow_reference_calls)
122120
123 def testBranchReferenceLoop(self):121 def testBranchReferenceLoop(self):
124 # checkAndFollowBranchReference raises BranchReferenceLoopError if122 # checkAndFollowBranchReference raises BranchReferenceLoopError if
@@ -128,7 +126,7 @@
128 opener = self.makeBranchOpener(True, references)126 opener = self.makeBranchOpener(True, references)
129 self.assertRaises(127 self.assertRaises(
130 BranchLoopError, opener.checkAndFollowBranchReference, 'a')128 BranchLoopError, opener.checkAndFollowBranchReference, 'a')
131 self.assertEquals(['a', 'b'], opener.follow_reference_calls)129 self.assertEqual(['a', 'b'], opener.follow_reference_calls)
132130
133131
134class TrackingProber(BzrProber):132class TrackingProber(BzrProber):
@@ -166,7 +164,7 @@
166 opener = self.makeBranchOpener([b.base], probers=[])164 opener = self.makeBranchOpener([b.base], probers=[])
167 self.assertRaises(NotBranchError, opener.open, b.base)165 self.assertRaises(NotBranchError, opener.open, b.base)
168 opener = self.makeBranchOpener([b.base], probers=[BzrProber])166 opener = self.makeBranchOpener([b.base], probers=[BzrProber])
169 self.assertEquals(b.base, opener.open(b.base).base)167 self.assertEqual(b.base, opener.open(b.base).base)
170168
171 def testDefaultProbers(self):169 def testDefaultProbers(self):
172 # If no probers are specified to the constructor170 # If no probers are specified to the constructor
@@ -180,18 +178,18 @@
180 TrackingProber.seen_urls = []178 TrackingProber.seen_urls = []
181 opener = self.makeBranchOpener(["."], probers=[TrackingProber])179 opener = self.makeBranchOpener(["."], probers=[TrackingProber])
182 self.assertRaises(NotBranchError, opener.open, ".")180 self.assertRaises(NotBranchError, opener.open, ".")
183 self.assertEquals(1, len(TrackingProber.seen_urls))181 self.assertEqual(1, len(TrackingProber.seen_urls))
184 TrackingProber.seen_urls = []182 TrackingProber.seen_urls = []
185 # And make sure it's registered in such a way that BzrDir.open would183 # And make sure it's registered in such a way that BzrDir.open would
186 # use it.184 # use it.
187 self.assertRaises(NotBranchError, BzrDir.open, ".")185 self.assertRaises(NotBranchError, BzrDir.open, ".")
188 self.assertEquals(1, len(TrackingProber.seen_urls))186 self.assertEqual(1, len(TrackingProber.seen_urls))
189 TrackingProber.seen_urls = []187 TrackingProber.seen_urls = []
190 # Make sure that SafeBranchOpener doesn't use it if no188 # Make sure that SafeBranchOpener doesn't use it if no
191 # probers were specified189 # probers were specified
192 opener = self.makeBranchOpener(["."])190 opener = self.makeBranchOpener(["."])
193 self.assertRaises(NotBranchError, opener.open, ".")191 self.assertRaises(NotBranchError, opener.open, ".")
194 self.assertEquals(0, len(TrackingProber.seen_urls))192 self.assertEqual(0, len(TrackingProber.seen_urls))
195193
196 def testAllowedURL(self):194 def testAllowedURL(self):
197 # checkSource does not raise an exception for branches stacked on195 # checkSource does not raise an exception for branches stacked on
@@ -289,8 +287,7 @@
289 opener = self.makeBranchOpener(287 opener = self.makeBranchOpener(
290 [a.base, b.base], probers=[TrackingProber])288 [a.base, b.base], probers=[TrackingProber])
291 opener.open(b.base)289 opener.open(b.base)
292 self.assertEquals(290 self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base]))
293 set(TrackingProber.seen_urls), set([b.base, a.base]))
294291
295 def testCustomOpenerWithBranchReference(self):292 def testCustomOpenerWithBranchReference(self):
296 # A custom function for opening a control dir can be specified.293 # A custom function for opening a control dir can be specified.
@@ -301,8 +298,7 @@
301 opener = self.makeBranchOpener(298 opener = self.makeBranchOpener(
302 [a.base, b.base], probers=[TrackingProber])299 [a.base, b.base], probers=[TrackingProber])
303 opener.open(b.base)300 opener.open(b.base)
304 self.assertEquals(301 self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base]))
305 set(TrackingProber.seen_urls), set([b.base, a.base]))
306302
307 def test_ignore_fallbacks(self):303 def test_ignore_fallbacks(self):
308 """"Cross-format stacking doesn't error with ignore_fallbacks."""304 """"Cross-format stacking doesn't error with ignore_fallbacks."""
309305
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2017-10-21 18:14:14 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2018-01-02 16:24:23 +0000
@@ -592,7 +592,7 @@
592 [launchpad]592 [launchpad]
593 default_batch_size: 2593 default_batch_size: 2
594 """)594 """)
595 self.assert_(595 self.assertTrue(
596 isinstance(view.milestone_batch_navigator, BatchNavigator),596 isinstance(view.milestone_batch_navigator, BatchNavigator),
597 'milestone_batch_navigator is not a BatchNavigator object: %r'597 'milestone_batch_navigator is not a BatchNavigator object: %r'
598 % view.milestone_batch_navigator)598 % view.milestone_batch_navigator)
@@ -693,7 +693,7 @@
693 distroseries = self.factory.makeDistroSeries()693 distroseries = self.factory.makeDistroSeries()
694 formatted_dict = seriesToVocab(distroseries)694 formatted_dict = seriesToVocab(distroseries)
695695
696 self.assertEquals(696 self.assertEqual(
697 ['api_uri', 'title', 'value'],697 ['api_uri', 'title', 'value'],
698 sorted(formatted_dict.keys()))698 sorted(formatted_dict.keys()))
699699
@@ -1477,9 +1477,9 @@
1477 job_source = getUtility(IPlainPackageCopyJobSource)1477 job_source = getUtility(IPlainPackageCopyJobSource)
1478 jobs = list(1478 jobs = list(
1479 job_source.getActiveJobs(series.distribution.main_archive))1479 job_source.getActiveJobs(series.distribution.main_archive))
1480 self.assertEquals(1, len(jobs))1480 self.assertEqual(1, len(jobs))
1481 job = jobs[0]1481 job = jobs[0]
1482 self.assertEquals(series, job.target_distroseries)1482 self.assertEqual(series, job.target_distroseries)
1483 self.assertEqual(dsd.source_package_name.name, job.package_name)1483 self.assertEqual(dsd.source_package_name.name, job.package_name)
1484 self.assertEqual(dsd.parent_source_version, job.package_version)1484 self.assertEqual(dsd.parent_source_version, job.package_version)
1485 self.assertEqual(PackagePublishingPocket.RELEASE, job.target_pocket)1485 self.assertEqual(PackagePublishingPocket.RELEASE, job.target_pocket)
@@ -2161,7 +2161,7 @@
2161 derived_series, '+localpackagediffs', method='GET',2161 derived_series, '+localpackagediffs', method='GET',
2162 query_string='start=1&batch=1')2162 query_string='start=1&batch=1')
21632163
2164 self.assertEquals(2164 self.assertEqual(
2165 'http://127.0.0.1?start=1&batch=1',2165 'http://127.0.0.1?start=1&batch=1',
2166 view.action_url)2166 view.action_url)
21672167
21682168
=== modified file 'lib/lp/registry/browser/tests/test_person.py'
--- lib/lp/registry/browser/tests/test_person.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/browser/tests/test_person.py 2018-01-02 16:24:23 +0000
@@ -189,7 +189,7 @@
189189
190 def test_should_be_profile_page_when_delegating(self):190 def test_should_be_profile_page_when_delegating(self):
191 """The profile page is the OpenID identifier in normal situation."""191 """The profile page is the OpenID identifier in normal situation."""
192 self.assertEquals(192 self.assertEqual(
193 'http://launchpad.dev/~eris', self.view.openid_identity_url)193 'http://launchpad.dev/~eris', self.view.openid_identity_url)
194194
195 def test_should_be_production_profile_page_when_not_delegating(self):195 def test_should_be_production_profile_page_when_not_delegating(self):
@@ -202,7 +202,7 @@
202 [launchpad]202 [launchpad]
203 non_restricted_hostname: prod.launchpad.dev203 non_restricted_hostname: prod.launchpad.dev
204 '''))204 '''))
205 self.assertEquals(205 self.assertEqual(
206 'http://prod.launchpad.dev/~eris', self.view.openid_identity_url)206 'http://prod.launchpad.dev/~eris', self.view.openid_identity_url)
207207
208208
209209
=== modified file 'lib/lp/registry/browser/tests/test_person_webservice.py'
--- lib/lp/registry/browser/tests/test_person_webservice.py 2017-06-01 12:58:53 +0000
+++ lib/lp/registry/browser/tests/test_person_webservice.py 2018-01-02 16:24:23 +0000
@@ -151,7 +151,7 @@
151 self.assertEqual(response.status, 200)151 self.assertEqual(response.status, 200)
152152
153 rendered_comment = response.body153 rendered_comment = response.body
154 self.assertEquals(154 self.assertEqual(
155 rendered_comment,155 rendered_comment,
156 '<a href="/~test-person" class="sprite person">Test Person</a>')156 '<a href="/~test-person" class="sprite person">Test Person</a>')
157157
158158
=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_distribution.py 2018-01-02 16:24:23 +0000
@@ -151,7 +151,7 @@
151 distroseries = self.factory.makeDistroSeries()151 distroseries = self.factory.makeDistroSeries()
152 spph = self.factory.makeSourcePackagePublishingHistory(152 spph = self.factory.makeSourcePackagePublishingHistory(
153 distroseries=distroseries, sourcepackagename='my-package')153 distroseries=distroseries, sourcepackagename='my-package')
154 self.assertEquals(154 self.assertEqual(
155 spph.sourcepackagerelease.sourcepackagename,155 spph.sourcepackagerelease.sourcepackagename,
156 distroseries.distribution.guessPublishedSourcePackageName(156 distroseries.distribution.guessPublishedSourcePackageName(
157 'my-package'))157 'my-package'))
@@ -164,7 +164,7 @@
164 archive=distroseries.main_archive,164 archive=distroseries.main_archive,
165 binarypackagename='binary-package',165 binarypackagename='binary-package',
166 source_package_release=spph.sourcepackagerelease)166 source_package_release=spph.sourcepackagerelease)
167 self.assertEquals(167 self.assertEqual(
168 spph.sourcepackagerelease.sourcepackagename,168 spph.sourcepackagerelease.sourcepackagename,
169 distroseries.distribution.guessPublishedSourcePackageName(169 distroseries.distribution.guessPublishedSourcePackageName(
170 'binary-package'))170 'binary-package'))
@@ -188,7 +188,7 @@
188 distroseries2 = self.factory.makeDistroSeries()188 distroseries2 = self.factory.makeDistroSeries()
189 spph = self.factory.makeSourcePackagePublishingHistory(189 spph = self.factory.makeSourcePackagePublishingHistory(
190 distroseries=distroseries1, sourcepackagename='my-package')190 distroseries=distroseries1, sourcepackagename='my-package')
191 self.assertEquals(191 self.assertEqual(
192 spph.sourcepackagerelease.sourcepackagename,192 spph.sourcepackagerelease.sourcepackagename,
193 distroseries1.distribution.guessPublishedSourcePackageName(193 distroseries1.distribution.guessPublishedSourcePackageName(
194 'my-package'))194 'my-package'))
@@ -206,7 +206,7 @@
206 self.factory.makeBinaryPackagePublishingHistory(206 self.factory.makeBinaryPackagePublishingHistory(
207 archive=distroseries.main_archive,207 archive=distroseries.main_archive,
208 binarypackagename='my-package', sourcepackagename='other-package')208 binarypackagename='my-package', sourcepackagename='other-package')
209 self.assertEquals(209 self.assertEqual(
210 my_spph.sourcepackagerelease.sourcepackagename,210 my_spph.sourcepackagerelease.sourcepackagename,
211 distroseries.distribution.guessPublishedSourcePackageName(211 distroseries.distribution.guessPublishedSourcePackageName(
212 'my-package'))212 'my-package'))
@@ -223,7 +223,7 @@
223 archive=distroseries.main_archive,223 archive=distroseries.main_archive,
224 sourcepackagename='new-source-name',224 sourcepackagename='new-source-name',
225 binarypackagename='my-package')225 binarypackagename='my-package')
226 self.assertEquals(226 self.assertEqual(
227 'new-source-name',227 'new-source-name',
228 distroseries.distribution.guessPublishedSourcePackageName(228 distroseries.distribution.guessPublishedSourcePackageName(
229 'my-package').name)229 'my-package').name)
@@ -235,7 +235,7 @@
235 sourcepackagename='my-package')235 sourcepackagename='my-package')
236 self.factory.makeRelatedBranchesForSourcePackage(236 self.factory.makeRelatedBranchesForSourcePackage(
237 sourcepackage=sourcepackage)237 sourcepackage=sourcepackage)
238 self.assertEquals(238 self.assertEqual(
239 'my-package',239 'my-package',
240 sourcepackage.distribution.guessPublishedSourcePackageName(240 sourcepackage.distribution.guessPublishedSourcePackageName(
241 'my-package').name)241 'my-package').name)
@@ -371,14 +371,14 @@
371371
372 def test_get_none(self):372 def test_get_none(self):
373 distro = self.factory.makeDistribution()373 distro = self.factory.makeDistribution()
374 self.assertEquals([],374 self.assertEqual([],
375 list(distro.getSeriesByStatus(SeriesStatus.FROZEN)))375 list(distro.getSeriesByStatus(SeriesStatus.FROZEN)))
376376
377 def test_get_current(self):377 def test_get_current(self):
378 distro = self.factory.makeDistribution()378 distro = self.factory.makeDistribution()
379 series = self.factory.makeDistroSeries(distribution=distro,379 series = self.factory.makeDistroSeries(distribution=distro,
380 status=SeriesStatus.CURRENT)380 status=SeriesStatus.CURRENT)
381 self.assertEquals([series],381 self.assertEqual([series],
382 list(distro.getSeriesByStatus(SeriesStatus.CURRENT)))382 list(distro.getSeriesByStatus(SeriesStatus.CURRENT)))
383383
384384
@@ -396,13 +396,13 @@
396 distro = self.factory.makeDistribution()396 distro = self.factory.makeDistribution()
397 series = self.factory.makeDistroSeries(distribution=distro,397 series = self.factory.makeDistroSeries(distribution=distro,
398 name="dappere")398 name="dappere")
399 self.assertEquals(series, distro.getSeries("dappere"))399 self.assertEqual(series, distro.getSeries("dappere"))
400400
401 def test_get_by_version(self):401 def test_get_by_version(self):
402 distro = self.factory.makeDistribution()402 distro = self.factory.makeDistribution()
403 series = self.factory.makeDistroSeries(distribution=distro,403 series = self.factory.makeDistroSeries(distribution=distro,
404 name="dappere", version="42.6")404 name="dappere", version="42.6")
405 self.assertEquals(series, distro.getSeries("42.6"))405 self.assertEqual(series, distro.getSeries("42.6"))
406406
407 def test_development_series_alias(self):407 def test_development_series_alias(self):
408 distro = self.factory.makeDistribution()408 distro = self.factory.makeDistribution()
409409
=== modified file 'lib/lp/registry/tests/test_distributionmirror_prober.py'
--- lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 16:24:23 +0000
@@ -261,7 +261,7 @@
261261
262 protocol.factory = FakeFactory('http://foo.bar/')262 protocol.factory = FakeFactory('http://foo.bar/')
263 protocol.makeConnection(FakeTransport())263 protocol.makeConnection(FakeTransport())
264 self.assertEquals(264 self.assertEqual(
265 'Launchpad Mirror Prober ( https://launchpad.net/ )',265 'Launchpad Mirror Prober ( https://launchpad.net/ )',
266 headers['User-Agent'])266 headers['User-Agent'])
267267
@@ -475,10 +475,10 @@
475 there's no task currently running.475 there's no task currently running.
476 """476 """
477 self.multi_lock.run(self.callback)477 self.multi_lock.run(self.callback)
478 self.assertEquals(self.count, 1, "self.callback should have run.")478 self.assertEqual(self.count, 1, "self.callback should have run.")
479479
480 self.multi_lock.run(self.callback)480 self.multi_lock.run(self.callback)
481 self.assertEquals(481 self.assertEqual(
482 self.count, 2, "self.callback should have run twice.")482 self.count, 2, "self.callback should have run twice.")
483483
484 def test_run_waits_for_first_lock(self):484 def test_run_waits_for_first_lock(self):
@@ -489,7 +489,7 @@
489489
490 # Run self.callback when self.multi_lock is acquired.490 # Run self.callback when self.multi_lock is acquired.
491 self.multi_lock.run(self.callback)491 self.multi_lock.run(self.callback)
492 self.assertEquals(492 self.assertEqual(
493 self.count, 0, "self.callback should not have run yet.")493 self.count, 0, "self.callback should not have run yet.")
494494
495 # Release lock_one.495 # Release lock_one.
@@ -497,7 +497,7 @@
497497
498 # multi_lock will now have been able to acquire both semaphores, and498 # multi_lock will now have been able to acquire both semaphores, and
499 # so it will have run its task.499 # so it will have run its task.
500 self.assertEquals(self.count, 1, "self.callback should have run.")500 self.assertEqual(self.count, 1, "self.callback should have run.")
501501
502 def test_run_waits_for_second_lock(self):502 def test_run_waits_for_second_lock(self):
503 """MultiLock.run acquires the second lock before running functions."""503 """MultiLock.run acquires the second lock before running functions."""
@@ -507,7 +507,7 @@
507507
508 # Run self.callback when self.multi_lock is acquired.508 # Run self.callback when self.multi_lock is acquired.
509 self.multi_lock.run(self.callback)509 self.multi_lock.run(self.callback)
510 self.assertEquals(510 self.assertEqual(
511 self.count, 0, "self.callback should not have run yet.")511 self.count, 0, "self.callback should not have run yet.")
512512
513 # Release lock_two.513 # Release lock_two.
@@ -515,7 +515,7 @@
515515
516 # multi_lock will now have been able to acquire both semaphores, and516 # multi_lock will now have been able to acquire both semaphores, and
517 # so it will have run its task.517 # so it will have run its task.
518 self.assertEquals(self.count, 1, "self.callback should have run.")518 self.assertEqual(self.count, 1, "self.callback should have run.")
519519
520 def test_run_waits_for_current_task(self):520 def test_run_waits_for_current_task(self):
521 """MultiLock.run waits the end of the current task before running the521 """MultiLock.run waits the end of the current task before running the
@@ -527,7 +527,7 @@
527527
528 # Run self.callback when self.multi_lock is acquired.528 # Run self.callback when self.multi_lock is acquired.
529 self.multi_lock.run(self.callback)529 self.multi_lock.run(self.callback)
530 self.assertEquals(530 self.assertEqual(
531 self.count, 0, "self.callback should not have run yet.")531 self.count, 0, "self.callback should not have run yet.")
532532
533 # Release lock_one.533 # Release lock_one.
@@ -535,7 +535,7 @@
535535
536 # multi_lock will now have been able to acquire both semaphores, and536 # multi_lock will now have been able to acquire both semaphores, and
537 # so it will have run its task.537 # so it will have run its task.
538 self.assertEquals(self.count, 1, "self.callback should have run.")538 self.assertEqual(self.count, 1, "self.callback should have run.")
539539
540540
541class TestRedirectAwareProberFactoryAndProtocol(TestCase):541class TestRedirectAwareProberFactoryAndProtocol(TestCase):
@@ -879,28 +879,28 @@
879 # Since we have a single mirror to probe we need to have a single879 # Since we have a single mirror to probe we need to have a single
880 # DeferredSemaphore with a limit of PER_HOST_REQUESTS, to ensure we880 # DeferredSemaphore with a limit of PER_HOST_REQUESTS, to ensure we
881 # don't issue too many simultaneous connections on that host.881 # don't issue too many simultaneous connections on that host.
882 self.assertEquals(len(request_manager.host_locks), 1)882 self.assertEqual(len(request_manager.host_locks), 1)
883 multi_lock = request_manager.host_locks[mirror1_host]883 multi_lock = request_manager.host_locks[mirror1_host]
884 self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)884 self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
885 # Note that our multi_lock contains another semaphore to control the885 # Note that our multi_lock contains another semaphore to control the
886 # overall number of requests.886 # overall number of requests.
887 self.assertEquals(multi_lock.overall_lock.limit, OVERALL_REQUESTS)887 self.assertEqual(multi_lock.overall_lock.limit, OVERALL_REQUESTS)
888888
889 probe_function(mirror2, StringIO(), [], logging)889 probe_function(mirror2, StringIO(), [], logging)
890 # Now we have two mirrors to probe, but they have the same hostname,890 # Now we have two mirrors to probe, but they have the same hostname,
891 # so we'll still have a single semaphore in host_semaphores.891 # so we'll still have a single semaphore in host_semaphores.
892 self.assertEquals(mirror2_host, mirror1_host)892 self.assertEqual(mirror2_host, mirror1_host)
893 self.assertEquals(len(request_manager.host_locks), 1)893 self.assertEqual(len(request_manager.host_locks), 1)
894 multi_lock = request_manager.host_locks[mirror2_host]894 multi_lock = request_manager.host_locks[mirror2_host]
895 self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)895 self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
896896
897 probe_function(mirror3, StringIO(), [], logging)897 probe_function(mirror3, StringIO(), [], logging)
898 # This third mirror is on a separate host, so we'll have a second898 # This third mirror is on a separate host, so we'll have a second
899 # semaphore added to host_semaphores.899 # semaphore added to host_semaphores.
900 self.failUnless(mirror3_host != mirror1_host)900 self.assertTrue(mirror3_host != mirror1_host)
901 self.assertEquals(len(request_manager.host_locks), 2)901 self.assertEqual(len(request_manager.host_locks), 2)
902 multi_lock = request_manager.host_locks[mirror3_host]902 multi_lock = request_manager.host_locks[mirror3_host]
903 self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS)903 self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS)
904904
905 # When using an http_proxy, even though we'll actually connect to the905 # When using an http_proxy, even though we'll actually connect to the
906 # proxy, we'll use the mirror's host as the key to find the semaphore906 # proxy, we'll use the mirror's host as the key to find the semaphore
@@ -908,7 +908,7 @@
908 orig_proxy = os.getenv('http_proxy')908 orig_proxy = os.getenv('http_proxy')
909 os.environ['http_proxy'] = 'http://squid.internal:3128/'909 os.environ['http_proxy'] = 'http://squid.internal:3128/'
910 probe_function(mirror3, StringIO(), [], logging)910 probe_function(mirror3, StringIO(), [], logging)
911 self.assertEquals(len(request_manager.host_locks), 2)911 self.assertEqual(len(request_manager.host_locks), 2)
912 restore_http_proxy(orig_proxy)912 restore_http_proxy(orig_proxy)
913913
914914
915915
=== modified file 'lib/lp/registry/tests/test_distroseries.py'
--- lib/lp/registry/tests/test_distroseries.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_distroseries.py 2018-01-02 16:24:23 +0000
@@ -222,7 +222,7 @@
222 distroarchseries = self.factory.makeDistroArchSeries(222 distroarchseries = self.factory.makeDistroArchSeries(
223 distroseries=distroseries, architecturetag='i386',223 distroseries=distroseries, architecturetag='i386',
224 processor=processor)224 processor=processor)
225 self.assertEquals(225 self.assertEqual(
226 distroarchseries,226 distroarchseries,
227 distroseries.getDistroArchSeriesByProcessor(processor))227 distroseries.getDistroArchSeriesByProcessor(processor))
228228
@@ -236,7 +236,7 @@
236236
237 def test_getDerivedSeries(self):237 def test_getDerivedSeries(self):
238 dsp = self.factory.makeDistroSeriesParent()238 dsp = self.factory.makeDistroSeriesParent()
239 self.assertEquals(239 self.assertEqual(
240 [dsp.derived_series], dsp.parent_series.getDerivedSeries())240 [dsp.derived_series], dsp.parent_series.getDerivedSeries())
241241
242 def test_registrant_owner_differ(self):242 def test_registrant_owner_differ(self):
@@ -244,8 +244,8 @@
244 # distribution's owner.244 # distribution's owner.
245 registrant = self.factory.makePerson()245 registrant = self.factory.makePerson()
246 distroseries = self.factory.makeDistroSeries(registrant=registrant)246 distroseries = self.factory.makeDistroSeries(registrant=registrant)
247 self.assertEquals(distroseries.distribution.owner, distroseries.owner)247 self.assertEqual(distroseries.distribution.owner, distroseries.owner)
248 self.assertEquals(registrant, distroseries.registrant)248 self.assertEqual(registrant, distroseries.registrant)
249 self.assertNotEqual(distroseries.registrant, distroseries.owner)249 self.assertNotEqual(distroseries.registrant, distroseries.owner)
250250
251 def test_isDerivedSeries(self):251 def test_isDerivedSeries(self):
252252
=== modified file 'lib/lp/registry/tests/test_distroseriesdifference.py'
--- lib/lp/registry/tests/test_distroseriesdifference.py 2014-11-09 11:48:34 +0000
+++ lib/lp/registry/tests/test_distroseriesdifference.py 2018-01-02 16:24:23 +0000
@@ -436,7 +436,7 @@
436 packagesets = self._setupPackageSets(436 packagesets = self._setupPackageSets(
437 ds_diff, ds_diff.parent_series, 5)437 ds_diff, ds_diff.parent_series, 5)
438 parent_packagesets = ds_diff.parent_packagesets438 parent_packagesets = ds_diff.parent_packagesets
439 self.assertEquals(439 self.assertEqual(
440 sorted([packageset.name for packageset in packagesets]),440 sorted([packageset.name for packageset in packagesets]),
441 [packageset.name for packageset in parent_packagesets])441 [packageset.name for packageset in parent_packagesets])
442442
@@ -445,7 +445,7 @@
445 ds_diff = self.factory.makeDistroSeriesDifference()445 ds_diff = self.factory.makeDistroSeriesDifference()
446 packagesets = self._setupPackageSets(446 packagesets = self._setupPackageSets(
447 ds_diff, ds_diff.derived_series, 5)447 ds_diff, ds_diff.derived_series, 5)
448 self.assertEquals(448 self.assertEqual(
449 sorted([packageset.name for packageset in packagesets]),449 sorted([packageset.name for packageset in packagesets]),
450 [packageset.name for packageset in ds_diff.packagesets])450 [packageset.name for packageset in ds_diff.packagesets])
451451
452452
=== modified file 'lib/lp/registry/tests/test_distroseriesparent.py'
--- lib/lp/registry/tests/test_distroseriesparent.py 2014-07-30 23:48:56 +0000
+++ lib/lp/registry/tests/test_distroseriesparent.py 2018-01-02 16:24:23 +0000
@@ -135,7 +135,7 @@
135135
136 def assertCanEdit(self, dsp):136 def assertCanEdit(self, dsp):
137 dsp.initialized = False137 dsp.initialized = False
138 self.assertEquals(False, dsp.initialized)138 self.assertEqual(False, dsp.initialized)
139139
140 def test_distroseries_drivers_can_edit(self):140 def test_distroseries_drivers_can_edit(self):
141 # Test that distroseries drivers can edit the data.141 # Test that distroseries drivers can edit the data.
142142
=== modified file 'lib/lp/registry/tests/test_initderiveddistroseries.py'
--- lib/lp/registry/tests/test_initderiveddistroseries.py 2013-02-14 01:10:48 +0000
+++ lib/lp/registry/tests/test_initderiveddistroseries.py 2018-01-02 16:24:23 +0000
@@ -90,7 +90,7 @@
90 p.getBuiltBinaries()[0].binarypackagerelease.version)90 p.getBuiltBinaries()[0].binarypackagerelease.version)
91 for p in pub_sources])91 for p in pub_sources])
9292
93 self.assertEquals(pack_versions, binaries)93 self.assertEqual(pack_versions, binaries)
9494
95 def test_multiple_parents_binary_packages(self):95 def test_multiple_parents_binary_packages(self):
96 # An initialization from many parents (using the package copier)96 # An initialization from many parents (using the package copier)
9797
=== modified file 'lib/lp/registry/tests/test_milestonetag.py'
--- lib/lp/registry/tests/test_milestonetag.py 2015-01-29 14:14:01 +0000
+++ lib/lp/registry/tests/test_milestonetag.py 2018-01-02 16:24:23 +0000
@@ -38,7 +38,7 @@
3838
39 def test_no_tags(self):39 def test_no_tags(self):
40 # Ensure a newly created milestone does not have associated tags.40 # Ensure a newly created milestone does not have associated tags.
41 self.assertEquals([], self.milestone.getTags())41 self.assertEqual([], self.milestone.getTags())
4242
43 def test_tags_setting_and_retrieval(self):43 def test_tags_setting_and_retrieval(self):
44 # Ensure tags are correctly saved and retrieved from the db.44 # Ensure tags are correctly saved and retrieved from the db.
@@ -59,7 +59,7 @@
59 with person_logged_in(self.person):59 with person_logged_in(self.person):
60 self.milestone.setTags(self.tags, self.person)60 self.milestone.setTags(self.tags, self.person)
61 self.milestone.setTags([], self.person)61 self.milestone.setTags([], self.person)
62 self.assertEquals([], self.milestone.getTags())62 self.assertEqual([], self.milestone.getTags())
6363
64 def test_user_metadata(self):64 def test_user_metadata(self):
65 # Ensure the correct user metadata is created when tags are added.65 # Ensure the correct user metadata is created when tags are added.
6666
=== modified file 'lib/lp/registry/tests/test_person.py'
--- lib/lp/registry/tests/test_person.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_person.py 2018-01-02 16:24:23 +0000
@@ -807,7 +807,7 @@
807 login(user.preferredemail.email)807 login(user.preferredemail.email)
808 expected_error = ('This account cannot be deactivated because it owns '808 expected_error = ('This account cannot be deactivated because it owns '
809 'the following non-public products: private')809 'the following non-public products: private')
810 self.assertEquals([expected_error], user.canDeactivate())810 self.assertEqual([expected_error], user.canDeactivate())
811811
812 def test_deactivate_copes_with_names_already_in_use(self):812 def test_deactivate_copes_with_names_already_in_use(self):
813 """When a user deactivates their account, their name is changed.813 """When a user deactivates their account, their name is changed.
814814
=== modified file 'lib/lp/registry/tests/test_person_vocabularies.py'
--- lib/lp/registry/tests/test_person_vocabularies.py 2012-08-13 21:33:47 +0000
+++ lib/lp/registry/tests/test_person_vocabularies.py 2018-01-02 16:24:23 +0000
@@ -108,7 +108,7 @@
108 """108 """
109 if expected is not None:109 if expected is not None:
110 expected = expected % context.id110 expected = expected % context.id
111 self.assertEquals(111 self.assertEqual(
112 expected,112 expected,
113 removeSecurityProxy(113 removeSecurityProxy(
114 self.getVocabulary(context))._karma_context_constraint)114 self.getVocabulary(context))._karma_context_constraint)
@@ -233,7 +233,7 @@
233233
234 results = list(self.searchVocabulary(None, u'foobar'))234 results = list(self.searchVocabulary(None, u'foobar'))
235 with StormStatementRecorder() as recorder:235 with StormStatementRecorder() as recorder:
236 self.assertEquals(4, len(results))236 self.assertEqual(4, len(results))
237 for person in results:237 for person in results:
238 self.assertEqual(238 self.assertEqual(
239 expected_nicks[person.id], person.ircnicknames)239 expected_nicks[person.id], person.ircnicknames)
240240
=== modified file 'lib/lp/registry/tests/test_personroles.py'
--- lib/lp/registry/tests/test_personroles.py 2014-06-12 01:04:30 +0000
+++ lib/lp/registry/tests/test_personroles.py 2018-01-02 16:24:23 +0000
@@ -79,7 +79,7 @@
79 def test_inTeam(self):79 def test_inTeam(self):
80 # The method person.inTeam is available as the inTeam attribute.80 # The method person.inTeam is available as the inTeam attribute.
81 roles = IPersonRoles(self.person)81 roles = IPersonRoles(self.person)
82 self.assertEquals(self.person.inTeam, roles.inTeam)82 self.assertEqual(self.person.inTeam, roles.inTeam)
8383
84 def test_inTeam_works(self):84 def test_inTeam_works(self):
85 # Make sure it actually works.85 # Make sure it actually works.
8686
=== modified file 'lib/lp/registry/tests/test_personset.py'
--- lib/lp/registry/tests/test_personset.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_personset.py 2018-01-02 16:24:23 +0000
@@ -569,7 +569,7 @@
569569
570 ensured_person = self.person_set.ensurePerson(570 ensured_person = self.person_set.ensurePerson(
571 self.email_address, self.displayname, self.rationale)571 self.email_address, self.displayname, self.rationale)
572 self.assertEquals(testing_person.id, ensured_person.id)572 self.assertEqual(testing_person.id, ensured_person.id)
573 self.assertIsNot(573 self.assertIsNot(
574 ensured_person.displayname, self.displayname,574 ensured_person.displayname, self.displayname,
575 'Person.displayname should not be overridden.')575 'Person.displayname should not be overridden.')
@@ -655,10 +655,10 @@
655 u'other-openid-identifier', 'a@b.com')655 u'other-openid-identifier', 'a@b.com')
656656
657 self.assertEqual(other_person, person)657 self.assertEqual(other_person, person)
658 self.assert_(658 self.assertIn(
659 u'other-openid-identifier' in [659 u'other-openid-identifier',
660 identifier.identifier for identifier in removeSecurityProxy(660 [identifier.identifier for identifier in removeSecurityProxy(
661 person.account).openid_identifiers])661 person.account).openid_identifiers])
662662
663663
664class TestPersonSetGetOrCreateSoftwareCenterCustomer(TestCaseWithFactory):664class TestPersonSetGetOrCreateSoftwareCenterCustomer(TestCaseWithFactory):
665665
=== modified file 'lib/lp/registry/tests/test_pillar.py'
--- lib/lp/registry/tests/test_pillar.py 2016-04-14 05:16:26 +0000
+++ lib/lp/registry/tests/test_pillar.py 2018-01-02 16:24:23 +0000
@@ -40,7 +40,7 @@
40 pillar.name for pillar in40 pillar.name for pillar in
41 pillar_set.search(41 pillar_set.search(
42 getUtility(IPersonSet).getByName('mark'), 'lz', limit=5)]42 getUtility(IPersonSet).getByName('mark'), 'lz', limit=5)]
43 self.assertEquals(result_names, [u'launchzap', u'lz-bar', u'lz-foo'])43 self.assertEqual(result_names, [u'launchzap', u'lz-bar', u'lz-foo'])
4444
4545
46class TestPillarPerson(TestCaseWithFactory):46class TestPillarPerson(TestCaseWithFactory):
4747
=== modified file 'lib/lp/registry/tests/test_prf_filter.py'
--- lib/lp/registry/tests/test_prf_filter.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_prf_filter.py 2018-01-02 16:24:23 +0000
@@ -22,7 +22,7 @@
22 from logging import getLogger22 from logging import getLogger
23 parent = getLogger("foo")23 parent = getLogger("foo")
24 f = Filter(log_parent=parent)24 f = Filter(log_parent=parent)
25 self.assertEquals(f.log.parent, parent)25 self.assertEqual(f.log.parent, parent)
2626
2727
28class Filter_Init(unittest.TestCase):28class Filter_Init(unittest.TestCase):
@@ -31,15 +31,15 @@
31 from lp.registry.scripts.productreleasefinder.filter import (31 from lp.registry.scripts.productreleasefinder.filter import (
32 Filter)32 Filter)
33 f = Filter()33 f = Filter()
34 self.assertEquals(f.filters, [])34 self.assertEqual(f.filters, [])
3535
36 def testFiltersPropertyGiven(self):36 def testFiltersPropertyGiven(self):
37 """Filter constructor accepts argument to set filters property."""37 """Filter constructor accepts argument to set filters property."""
38 from lp.registry.scripts.productreleasefinder.filter import (38 from lp.registry.scripts.productreleasefinder.filter import (
39 Filter)39 Filter)
40 f = Filter(["wibble"])40 f = Filter(["wibble"])
41 self.assertEquals(len(f.filters), 1)41 self.assertEqual(len(f.filters), 1)
42 self.assertEquals(f.filters[0], "wibble")42 self.assertEqual(f.filters[0], "wibble")
4343
4444
45class Filter_CheckUrl(unittest.TestCase):45class Filter_CheckUrl(unittest.TestCase):
@@ -48,7 +48,7 @@
48 from lp.registry.scripts.productreleasefinder.filter import (48 from lp.registry.scripts.productreleasefinder.filter import (
49 Filter)49 Filter)
50 f = Filter()50 f = Filter()
51 self.assertEquals(f.check("file:///subdir/file"), None)51 self.assertEqual(f.check("file:///subdir/file"), None)
5252
53 def makeFilter(self, key, urlglob):53 def makeFilter(self, key, urlglob):
54 from lp.registry.scripts.productreleasefinder.filter import (54 from lp.registry.scripts.productreleasefinder.filter import (
@@ -59,27 +59,27 @@
59 def testNotMatching(self):59 def testNotMatching(self):
60 """Filter.check returns None if doesn't match a filter."""60 """Filter.check returns None if doesn't match a filter."""
61 f = self.makeFilter("foo", "file:///subdir/w*")61 f = self.makeFilter("foo", "file:///subdir/w*")
62 self.assertEquals(f.check("file:///subdir/file"), None)62 self.assertEqual(f.check("file:///subdir/file"), None)
6363
64 def testNoMatchingSlashes(self):64 def testNoMatchingSlashes(self):
65 """Filter.check that the glob does not match slashes."""65 """Filter.check that the glob does not match slashes."""
66 f = self.makeFilter("foo", "file:///*l*")66 f = self.makeFilter("foo", "file:///*l*")
67 self.assertEquals(f.check("file:///subdir/file"), None)67 self.assertEqual(f.check("file:///subdir/file"), None)
6868
69 def testReturnsMatching(self):69 def testReturnsMatching(self):
70 """Filter.check returns the matching keyword."""70 """Filter.check returns the matching keyword."""
71 f = self.makeFilter("foo", "file:///subdir/f*e")71 f = self.makeFilter("foo", "file:///subdir/f*e")
72 self.assertEquals(f.check("file:///subdir/file"), "foo")72 self.assertEqual(f.check("file:///subdir/file"), "foo")
7373
74 def testGlobSubdir(self):74 def testGlobSubdir(self):
75 # Filter.glob can contain slashes to match subdirs75 # Filter.glob can contain slashes to match subdirs
76 f = self.makeFilter("foo", "file:///sub*/f*e")76 f = self.makeFilter("foo", "file:///sub*/f*e")
77 self.assertEquals(f.check("file:///subdir/file"), "foo")77 self.assertEqual(f.check("file:///subdir/file"), "foo")
7878
79 def testReturnsNonMatchingBase(self):79 def testReturnsNonMatchingBase(self):
80 """Filter.check returns None if the base does not match."""80 """Filter.check returns None if the base does not match."""
81 f = self.makeFilter("foo", "http:f*e")81 f = self.makeFilter("foo", "http:f*e")
82 self.assertEquals(f.check("file:///subdir/file"), None)82 self.assertEqual(f.check("file:///subdir/file"), None)
8383
8484
85class Filter_IsPossibleParentUrl(unittest.TestCase):85class Filter_IsPossibleParentUrl(unittest.TestCase):
8686
=== modified file 'lib/lp/registry/tests/test_prf_hose.py'
--- lib/lp/registry/tests/test_prf_hose.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_prf_hose.py 2018-01-02 16:24:23 +0000
@@ -29,7 +29,7 @@
29 from logging import getLogger29 from logging import getLogger
30 parent = getLogger("foo")30 parent = getLogger("foo")
31 h = Hose(log_parent=parent)31 h = Hose(log_parent=parent)
32 self.assertEquals(h.log.parent, parent)32 self.assertEqual(h.log.parent, parent)
3333
3434
35class Hose_Filter(unittest.TestCase):35class Hose_Filter(unittest.TestCase):
@@ -45,7 +45,7 @@
45 """Hose creates Filter object with empty dictionary."""45 """Hose creates Filter object with empty dictionary."""
46 from lp.registry.scripts.productreleasefinder.hose import Hose46 from lp.registry.scripts.productreleasefinder.hose import Hose
47 h = Hose()47 h = Hose()
48 self.assertEquals(h.filter.filters, [])48 self.assertEqual(h.filter.filters, [])
4949
50 def testCreatesFiltersWithGiven(self):50 def testCreatesFiltersWithGiven(self):
51 """Hose creates Filter object with dictionary given."""51 """Hose creates Filter object with dictionary given."""
@@ -54,8 +54,8 @@
54 FilterPattern)54 FilterPattern)
55 pattern = FilterPattern("foo", "http:e*")55 pattern = FilterPattern("foo", "http:e*")
56 h = Hose([pattern])56 h = Hose([pattern])
57 self.assertEquals(len(h.filter.filters), 1)57 self.assertEqual(len(h.filter.filters), 1)
58 self.assertEquals(h.filter.filters[0], pattern)58 self.assertEqual(h.filter.filters[0], pattern)
5959
6060
61class Hose_Urls(unittest.TestCase):61class Hose_Urls(unittest.TestCase):
@@ -74,7 +74,7 @@
74 obs = Observer()74 obs = Observer()
75 instrument_method(obs, h, "reduceWork")75 instrument_method(obs, h, "reduceWork")
76 h.__init__()76 h.__init__()
77 self.assert_(obs.called_it)77 self.assertTrue(obs.called_it)
7878
79 def testPassesUrlList(self):79 def testPassesUrlList(self):
80 """Hose constructor passes url list to reduceWork."""80 """Hose constructor passes url list to reduceWork."""
@@ -94,8 +94,7 @@
94 obs = Observer()94 obs = Observer()
95 instrument_method(obs, h, "reduceWork")95 instrument_method(obs, h, "reduceWork")
96 h.__init__([pattern])96 h.__init__([pattern])
97 self.assertEquals(obs.args[0][0],97 self.assertEqual(obs.args[0][0], ["http://archive.ubuntu.com/"])
98 ["http://archive.ubuntu.com/"])
9998
100 def testSetsUrlProperty(self):99 def testSetsUrlProperty(self):
101 """Hose constructor sets urls property to reduceWork return value."""100 """Hose constructor sets urls property to reduceWork return value."""
@@ -106,7 +105,7 @@
106 return "wibble"105 return "wibble"
107106
108 h = TestHose()107 h = TestHose()
109 self.assertEquals(h.urls, "wibble")108 self.assertEqual(h.urls, "wibble")
110109
111110
112class Hose_ReduceWork(unittest.TestCase):111class Hose_ReduceWork(unittest.TestCase):
@@ -114,24 +113,24 @@
114 """Hose.reduceWork returns empty list when given one."""113 """Hose.reduceWork returns empty list when given one."""
115 from lp.registry.scripts.productreleasefinder.hose import Hose114 from lp.registry.scripts.productreleasefinder.hose import Hose
116 h = Hose()115 h = Hose()
117 self.assertEquals(h.reduceWork([]), [])116 self.assertEqual(h.reduceWork([]), [])
118117
119 def testReducedList(self):118 def testReducedList(self):
120 """Hose.reduceWork returns same list when nothing to do."""119 """Hose.reduceWork returns same list when nothing to do."""
121 from lp.registry.scripts.productreleasefinder.hose import Hose120 from lp.registry.scripts.productreleasefinder.hose import Hose
122 h = Hose()121 h = Hose()
123 self.assertEquals(h.reduceWork(["http://localhost/", "file:///usr/"]),122 self.assertEqual(h.reduceWork(["http://localhost/", "file:///usr/"]),
124 ["http://localhost/", "file:///usr/"])123 ["http://localhost/", "file:///usr/"])
125124
126 def testReducesList(self):125 def testReducesList(self):
127 """Hose.reduceWork removes children elements from list."""126 """Hose.reduceWork removes children elements from list."""
128 from lp.registry.scripts.productreleasefinder.hose import Hose127 from lp.registry.scripts.productreleasefinder.hose import Hose
129 h = Hose()128 h = Hose()
130 self.assertEquals(h.reduceWork(["http://localhost/",129 self.assertEqual(h.reduceWork(["http://localhost/",
131 "http://localhost/foo/bar/",130 "http://localhost/foo/bar/",
132 "http://localhost/wibble/",131 "http://localhost/wibble/",
133 "file:///usr/"]),132 "file:///usr/"]),
134 ["http://localhost/", "file:///usr/"])133 ["http://localhost/", "file:///usr/"])
135134
136135
137class Hose_LimitWalk(unittest.TestCase):136class Hose_LimitWalk(unittest.TestCase):
138137
=== modified file 'lib/lp/registry/tests/test_prf_log.py'
--- lib/lp/registry/tests/test_prf_log.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_prf_log.py 2018-01-02 16:24:23 +0000
@@ -20,20 +20,20 @@
20 def testNoParent(self):20 def testNoParent(self):
21 """get_logger works if no parent is given."""21 """get_logger works if no parent is given."""
22 from lp.registry.scripts.productreleasefinder.log import get_logger22 from lp.registry.scripts.productreleasefinder.log import get_logger
23 self.assertEquals(get_logger("test").name, "test")23 self.assertEqual(get_logger("test").name, "test")
2424
25 def testRootParent(self):25 def testRootParent(self):
26 """get_logger works if root logger is given."""26 """get_logger works if root logger is given."""
27 from lp.registry.scripts.productreleasefinder.log import get_logger27 from lp.registry.scripts.productreleasefinder.log import get_logger
28 from logging import root28 from logging import root
29 self.assertEquals(get_logger("test", root).name, "test")29 self.assertEqual(get_logger("test", root).name, "test")
3030
31 def testNormalParent(self):31 def testNormalParent(self):
32 """get_logger works if non-root logger is given."""32 """get_logger works if non-root logger is given."""
33 from lp.registry.scripts.productreleasefinder.log import get_logger33 from lp.registry.scripts.productreleasefinder.log import get_logger
34 from logging import getLogger34 from logging import getLogger
35 parent = getLogger("foo")35 parent = getLogger("foo")
36 self.assertEquals(get_logger("test", parent).name, "foo.test")36 self.assertEqual(get_logger("test", parent).name, "foo.test")
3737
38 def testDeepParent(self):38 def testDeepParent(self):
39 """get_logger works if deep-level logger is given."""39 """get_logger works if deep-level logger is given."""
@@ -41,4 +41,4 @@
41 from logging import getLogger41 from logging import getLogger
42 getLogger("foo")42 getLogger("foo")
43 parent2 = getLogger("foo.bar")43 parent2 = getLogger("foo.bar")
44 self.assertEquals(get_logger("test", parent2).name, "foo.bar.test")44 self.assertEqual(get_logger("test", parent2).name, "foo.bar.test")
4545
=== modified file 'lib/lp/registry/tests/test_prf_walker.py'
--- lib/lp/registry/tests/test_prf_walker.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_prf_walker.py 2018-01-02 16:24:23 +0000
@@ -29,7 +29,7 @@
29 from logging import getLogger29 from logging import getLogger
30 parent = getLogger("foo")30 parent = getLogger("foo")
31 w = WalkerBase("/", log_parent=parent)31 w = WalkerBase("/", log_parent=parent)
32 self.assertEquals(w.log.parent, parent)32 self.assertEqual(w.log.parent, parent)
3333
3434
35class WalkerBase_Base(TestCase):35class WalkerBase_Base(TestCase):
@@ -37,22 +37,22 @@
37 def testSetsBase(self):37 def testSetsBase(self):
38 """WalkerBase sets the base property."""38 """WalkerBase sets the base property."""
39 w = WalkerBase("ftp://localhost/")39 w = WalkerBase("ftp://localhost/")
40 self.assertEquals(w.base, "ftp://localhost/")40 self.assertEqual(w.base, "ftp://localhost/")
4141
42 def testSetsScheme(self):42 def testSetsScheme(self):
43 """WalkerBase sets the scheme property."""43 """WalkerBase sets the scheme property."""
44 w = WalkerBase("ftp://localhost/")44 w = WalkerBase("ftp://localhost/")
45 self.assertEquals(w.scheme, "ftp")45 self.assertEqual(w.scheme, "ftp")
4646
47 def testSetsHost(self):47 def testSetsHost(self):
48 """WalkerBase sets the host property."""48 """WalkerBase sets the host property."""
49 w = WalkerBase("ftp://localhost/")49 w = WalkerBase("ftp://localhost/")
50 self.assertEquals(w.host, "localhost")50 self.assertEqual(w.host, "localhost")
5151
52 def testNoScheme(self):52 def testNoScheme(self):
53 """WalkerBase works when given a URL with no scheme."""53 """WalkerBase works when given a URL with no scheme."""
54 w = WalkerBase("/")54 w = WalkerBase("/")
55 self.assertEquals(w.host, "")55 self.assertEqual(w.host, "")
5656
57 def testWrongScheme(self):57 def testWrongScheme(self):
58 """WalkerBase raises WalkerError when given an unhandled scheme."""58 """WalkerBase raises WalkerError when given an unhandled scheme."""
@@ -63,75 +63,75 @@
63 def testUnescapesHost(self):63 def testUnescapesHost(self):
64 """WalkerBase unescapes the host portion."""64 """WalkerBase unescapes the host portion."""
65 w = WalkerBase("ftp://local%40host/")65 w = WalkerBase("ftp://local%40host/")
66 self.assertEquals(w.host, "local@host")66 self.assertEqual(w.host, "local@host")
6767
68 def testNoUsername(self):68 def testNoUsername(self):
69 """WalkerBase stores None when there is no username."""69 """WalkerBase stores None when there is no username."""
70 w = WalkerBase("ftp://localhost/")70 w = WalkerBase("ftp://localhost/")
71 self.assertEquals(w.user, None)71 self.assertEqual(w.user, None)
7272
73 def testUsername(self):73 def testUsername(self):
74 """WalkerBase splits out the username from the host portion."""74 """WalkerBase splits out the username from the host portion."""
75 w = WalkerBase("ftp://scott@localhost/")75 w = WalkerBase("ftp://scott@localhost/")
76 self.assertEquals(w.user, "scott")76 self.assertEqual(w.user, "scott")
77 self.assertEquals(w.host, "localhost")77 self.assertEqual(w.host, "localhost")
7878
79 def testUnescapesUsername(self):79 def testUnescapesUsername(self):
80 """WalkerBase unescapes the username portion."""80 """WalkerBase unescapes the username portion."""
81 w = WalkerBase("ftp://scott%3awibble@localhost/")81 w = WalkerBase("ftp://scott%3awibble@localhost/")
82 self.assertEquals(w.user, "scott:wibble")82 self.assertEqual(w.user, "scott:wibble")
83 self.assertEquals(w.host, "localhost")83 self.assertEqual(w.host, "localhost")
8484
85 def testNoPassword(self):85 def testNoPassword(self):
86 """WalkerBase stores None when there is no password."""86 """WalkerBase stores None when there is no password."""
87 w = WalkerBase("ftp://scott@localhost/")87 w = WalkerBase("ftp://scott@localhost/")
88 self.assertEquals(w.passwd, None)88 self.assertEqual(w.passwd, None)
8989
90 def testPassword(self):90 def testPassword(self):
91 """WalkerBase splits out the password from the username."""91 """WalkerBase splits out the password from the username."""
92 w = WalkerBase("ftp://scott:wibble@localhost/")92 w = WalkerBase("ftp://scott:wibble@localhost/")
93 self.assertEquals(w.user, "scott")93 self.assertEqual(w.user, "scott")
94 self.assertEquals(w.passwd, "wibble")94 self.assertEqual(w.passwd, "wibble")
95 self.assertEquals(w.host, "localhost")95 self.assertEqual(w.host, "localhost")
9696
97 def testUnescapesPassword(self):97 def testUnescapesPassword(self):
98 """WalkerBase unescapes the password portion."""98 """WalkerBase unescapes the password portion."""
99 w = WalkerBase("ftp://scott:wibble%20wobble@localhost/")99 w = WalkerBase("ftp://scott:wibble%20wobble@localhost/")
100 self.assertEquals(w.user, "scott")100 self.assertEqual(w.user, "scott")
101 self.assertEquals(w.passwd, "wibble wobble")101 self.assertEqual(w.passwd, "wibble wobble")
102 self.assertEquals(w.host, "localhost")102 self.assertEqual(w.host, "localhost")
103103
104 def testPathOnly(self):104 def testPathOnly(self):
105 """WalkerBase stores the path if that's all there is."""105 """WalkerBase stores the path if that's all there is."""
106 w = WalkerBase("/path/to/something/")106 w = WalkerBase("/path/to/something/")
107 self.assertEquals(w.path, "/path/to/something/")107 self.assertEqual(w.path, "/path/to/something/")
108108
109 def testPathInUrl(self):109 def testPathInUrl(self):
110 """WalkerBase stores the path portion of a complete URL."""110 """WalkerBase stores the path portion of a complete URL."""
111 w = WalkerBase("ftp://localhost/path/to/something/")111 w = WalkerBase("ftp://localhost/path/to/something/")
112 self.assertEquals(w.path, "/path/to/something/")112 self.assertEqual(w.path, "/path/to/something/")
113113
114 def testAddsSlashToPath(self):114 def testAddsSlashToPath(self):
115 """WalkerBase adds a trailing slash to path if ommitted."""115 """WalkerBase adds a trailing slash to path if ommitted."""
116 w = WalkerBase("ftp://localhost/path/to/something")116 w = WalkerBase("ftp://localhost/path/to/something")
117 self.assertEquals(w.path, "/path/to/something/")117 self.assertEqual(w.path, "/path/to/something/")
118118
119 def testUnescapesPath(self):119 def testUnescapesPath(self):
120 """WalkerBase leaves the path escaped."""120 """WalkerBase leaves the path escaped."""
121 w = WalkerBase("ftp://localhost/some%20thing/")121 w = WalkerBase("ftp://localhost/some%20thing/")
122 self.assertEquals(w.path, "/some%20thing/")122 self.assertEqual(w.path, "/some%20thing/")
123123
124 def testStoresQuery(self):124 def testStoresQuery(self):
125 """WalkerBase stores the query portion of a supporting URL."""125 """WalkerBase stores the query portion of a supporting URL."""
126 w = WalkerBase("http://localhost/?foo")126 w = WalkerBase("http://localhost/?foo")
127 self.assertEquals(w.query, "foo")127 self.assertEqual(w.query, "foo")
128128
129 def testStoresFragment(self):129 def testStoresFragment(self):
130 """WalkerBase stores the fragment portion of a supporting URL."""130 """WalkerBase stores the fragment portion of a supporting URL."""
131 WalkerBase.FRAGMENTS = True131 WalkerBase.FRAGMENTS = True
132 try:132 try:
133 w = WalkerBase("http://localhost/#foo")133 w = WalkerBase("http://localhost/#foo")
134 self.assertEquals(w.fragment, "foo")134 self.assertEqual(w.fragment, "foo")
135 finally:135 finally:
136 WalkerBase.FRAGMENTS = False136 WalkerBase.FRAGMENTS = False
137137
@@ -204,14 +204,14 @@
204 from lp.registry.scripts.productreleasefinder.walker import (204 from lp.registry.scripts.productreleasefinder.walker import (
205 FTPWalker)205 FTPWalker)
206 w = FTPWalker("ftp://localhost/")206 w = FTPWalker("ftp://localhost/")
207 self.assertEquals(w.host, "localhost")207 self.assertEqual(w.host, "localhost")
208208
209 def testNoScheme(self):209 def testNoScheme(self):
210 """FTPWalker works when given a URL with no scheme."""210 """FTPWalker works when given a URL with no scheme."""
211 from lp.registry.scripts.productreleasefinder.walker import (211 from lp.registry.scripts.productreleasefinder.walker import (
212 FTPWalker)212 FTPWalker)
213 w = FTPWalker("/")213 w = FTPWalker("/")
214 self.assertEquals(w.host, "")214 self.assertEqual(w.host, "")
215215
216 def testWrongScheme(self):216 def testWrongScheme(self):
217 """FTPWalker raises WalkerError when given an unhandled scheme."""217 """FTPWalker raises WalkerError when given an unhandled scheme."""
@@ -224,14 +224,14 @@
224 from lp.registry.scripts.productreleasefinder.walker import (224 from lp.registry.scripts.productreleasefinder.walker import (
225 FTPWalker)225 FTPWalker)
226 w = FTPWalker("ftp://localhost/")226 w = FTPWalker("ftp://localhost/")
227 self.assertEquals(w.user, "anonymous")227 self.assertEqual(w.user, "anonymous")
228228
229 def testNoPassword(self):229 def testNoPassword(self):
230 """FTPWalker stores empty string when there is no password."""230 """FTPWalker stores empty string when there is no password."""
231 from lp.registry.scripts.productreleasefinder.walker import (231 from lp.registry.scripts.productreleasefinder.walker import (
232 FTPWalker)232 FTPWalker)
233 w = FTPWalker("ftp://scott@localhost/")233 w = FTPWalker("ftp://scott@localhost/")
234 self.assertEquals(w.passwd, "")234 self.assertEqual(w.passwd, "")
235235
236236
237class HTTPWalker_Base(TestCase):237class HTTPWalker_Base(TestCase):
@@ -241,21 +241,21 @@
241 from lp.registry.scripts.productreleasefinder.walker import (241 from lp.registry.scripts.productreleasefinder.walker import (
242 HTTPWalker)242 HTTPWalker)
243 w = HTTPWalker("http://localhost/")243 w = HTTPWalker("http://localhost/")
244 self.assertEquals(w.host, "localhost")244 self.assertEqual(w.host, "localhost")
245245
246 def testHttpsScheme(self):246 def testHttpsScheme(self):
247 """HTTPWalker works when initialized with an https-scheme URL."""247 """HTTPWalker works when initialized with an https-scheme URL."""
248 from lp.registry.scripts.productreleasefinder.walker import (248 from lp.registry.scripts.productreleasefinder.walker import (
249 HTTPWalker)249 HTTPWalker)
250 w = HTTPWalker("https://localhost/")250 w = HTTPWalker("https://localhost/")
251 self.assertEquals(w.host, "localhost")251 self.assertEqual(w.host, "localhost")
252252
253 def testNoScheme(self):253 def testNoScheme(self):
254 """HTTPWalker works when given a URL with no scheme."""254 """HTTPWalker works when given a URL with no scheme."""
255 from lp.registry.scripts.productreleasefinder.walker import (255 from lp.registry.scripts.productreleasefinder.walker import (
256 HTTPWalker)256 HTTPWalker)
257 w = HTTPWalker("/")257 w = HTTPWalker("/")
258 self.assertEquals(w.host, "")258 self.assertEqual(w.host, "")
259259
260 def testWrongScheme(self):260 def testWrongScheme(self):
261 """HTTPWalker raises WalkerError when given an unhandled scheme."""261 """HTTPWalker raises WalkerError when given an unhandled scheme."""
@@ -274,13 +274,13 @@
274 self.walker = HTTPWalker("http://localhost/")274 self.walker = HTTPWalker("http://localhost/")
275275
276 def verify_url_scheme_and_handler(self, scheme, handler):276 def verify_url_scheme_and_handler(self, scheme, handler):
277 self.assert_(scheme in self.walker.URL_SCHEMES)277 self.assertIn(scheme, self.walker.URL_SCHEMES)
278 self.assert_(handler in self.walker.handlers)278 self.assertIn(handler, self.walker.handlers)
279 # urllib2 uses a naming convention to select the handler for279 # urllib2 uses a naming convention to select the handler for
280 # a URL scheme. This test is sanity to check to ensure that the280 # a URL scheme. This test is sanity to check to ensure that the
281 # HTTPWalker's configuration of the OpenerDirector is will work.281 # HTTPWalker's configuration of the OpenerDirector is will work.
282 method_name = '%s_open' % scheme282 method_name = '%s_open' % scheme
283 self.assert_(safe_hasattr(handler, method_name))283 self.assertTrue(safe_hasattr(handler, method_name))
284284
285 def test_http_request(self):285 def test_http_request(self):
286 import urllib2286 import urllib2
@@ -503,7 +503,7 @@
503 """combine_url constructs the URL correctly."""503 """combine_url constructs the URL correctly."""
504 from lp.registry.scripts.productreleasefinder.walker import (504 from lp.registry.scripts.productreleasefinder.walker import (
505 combine_url)505 combine_url)
506 self.assertEquals(combine_url("file:///base", "/subdir/", "file"),506 self.assertEqual(combine_url("file:///base", "/subdir/", "file"),
507 "file:///subdir/file")507 "file:///subdir/file")
508 self.assertEquals(combine_url("file:///base", "/subdir", "file"),508 self.assertEqual(combine_url("file:///base", "/subdir", "file"),
509 "file:///subdir/file")509 "file:///subdir/file")
510510
=== modified file 'lib/lp/registry/tests/test_project_milestone.py'
--- lib/lp/registry/tests/test_project_milestone.py 2015-01-29 16:28:30 +0000
+++ lib/lp/registry/tests/test_project_milestone.py 2018-01-02 16:24:23 +0000
@@ -331,7 +331,7 @@
331 try:331 try:
332 milestone.createProductRelease(1, now)332 milestone.createProductRelease(1, now)
333 except MultipleProductReleases as e:333 except MultipleProductReleases as e:
334 self.assert_(334 self.assertTrue(
335 str(e), 'A milestone can only have one ProductRelease.')335 str(e), 'A milestone can only have one ProductRelease.')
336336
337 def test_inappropriate_deactivation_does_not_cause_an_OOPS(self):337 def test_inappropriate_deactivation_does_not_cause_an_OOPS(self):
338338
=== modified file 'lib/lp/registry/tests/test_teammembership.py'
--- lib/lp/registry/tests/test_teammembership.py 2018-01-02 10:54:31 +0000
+++ lib/lp/registry/tests/test_teammembership.py 2018-01-02 16:24:23 +0000
@@ -277,7 +277,7 @@
277 def assertParticipantsEquals(self, participant_names, team):277 def assertParticipantsEquals(self, participant_names, team):
278 """Assert that the participants names in team are the expected ones.278 """Assert that the participants names in team are the expected ones.
279 """279 """
280 self.assertEquals(280 self.assertEqual(
281 sorted(participant_names),281 sorted(participant_names),
282 sorted([participant.name for participant in team.allmembers]))282 sorted([participant.name for participant in team.allmembers]))
283283
284284
=== modified file 'lib/lp/scripts/tests/test_runlaunchpad.py'
--- lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 10:54:31 +0000
+++ lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 16:24:23 +0000
@@ -113,11 +113,11 @@
113 instance_config_dir = os.path.join(self.config_root, 'test')113 instance_config_dir = os.path.join(self.config_root, 'test')
114 os.mkdir(instance_config_dir)114 os.mkdir(instance_config_dir)
115 open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close()115 open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close()
116 self.assertEquals(116 self.assertEqual(
117 ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir],117 ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir],
118 process_config_arguments(118 process_config_arguments(
119 ['-i', 'test', '-o', 'foo']))119 ['-i', 'test', '-o', 'foo']))
120 self.assertEquals('test', config.instance_name)120 self.assertEqual('test', config.instance_name)
121121
122122
123class ServersToStart(testtools.TestCase):123class ServersToStart(testtools.TestCase):
124124
=== modified file 'lib/lp/scripts/utilities/js/tests/test_combo.py'
--- lib/lp/scripts/utilities/js/tests/test_combo.py 2016-01-26 15:47:37 +0000
+++ lib/lp/scripts/utilities/js/tests/test_combo.py 2018-01-02 16:24:23 +0000
@@ -90,7 +90,7 @@
9090
91 def test_parse_url_keeps_order(self):91 def test_parse_url_keeps_order(self):
92 """Parsing a combo loader URL returns an ordered list of filenames."""92 """Parsing a combo loader URL returns an ordered list of filenames."""
93 self.assertEquals(93 self.assertEqual(
94 parse_url(("http://yui.yahooapis.com/combo?"94 parse_url(("http://yui.yahooapis.com/combo?"
95 "3.0.0/build/yui/yui-min.js&"95 "3.0.0/build/yui/yui-min.js&"
96 "3.0.0/build/oop/oop-min.js&"96 "3.0.0/build/oop/oop-min.js&"
@@ -124,7 +124,7 @@
124 "** oop-min **",124 "** oop-min **",
125 "// event-custom/event-custom-min.js",125 "// event-custom/event-custom-min.js",
126 "** event-custom-min **"))126 "** event-custom-min **"))
127 self.assertEquals(127 self.assertEqual(
128 "".join(combine_files(["yui/yui-min.js",128 "".join(combine_files(["yui/yui-min.js",
129 "oop/oop-min.js",129 "oop/oop-min.js",
130 "event-custom/event-custom-min.js"],130 "event-custom/event-custom-min.js"],
@@ -163,7 +163,7 @@
163 "/* editor/assets/skins/sam/editor.css */",163 "/* editor/assets/skins/sam/editor.css */",
164 ".yui-editor{background:url(editor/assets/skins/sam/img/bg.png)}",164 ".yui-editor{background:url(editor/assets/skins/sam/img/bg.png)}",
165 ))165 ))
166 self.assertEquals(166 self.assertEqual(
167 "".join(combine_files(["widget/assets/skins/sam/widget.css",167 "".join(combine_files(["widget/assets/skins/sam/widget.css",
168 "editor/assets/skins/sam/editor.css"],168 "editor/assets/skins/sam/editor.css"],
169 root=test_dir)).strip(),169 root=test_dir)).strip(),
@@ -225,7 +225,7 @@
225 "/* editor/assets/skins/sam/editor.css */",225 "/* editor/assets/skins/sam/editor.css */",
226 ".yui-editor{background:url(http://foo/static/img/bg.png)}",226 ".yui-editor{background:url(http://foo/static/img/bg.png)}",
227 ))227 ))
228 self.assertEquals(228 self.assertEqual(
229 "".join(combine_files(["widget/assets/skins/sam/widget.css",229 "".join(combine_files(["widget/assets/skins/sam/widget.css",
230 "editor/assets/skins/sam/editor.css"],230 "editor/assets/skins/sam/editor.css"],
231 root=test_dir)).strip(),231 root=test_dir)).strip(),
@@ -263,7 +263,7 @@
263 '/* editor/assets/skins/sam/editor.css */',263 '/* editor/assets/skins/sam/editor.css */',
264 '.yui-editor{background:url("data:image/gif;base64,base64-data")}',264 '.yui-editor{background:url("data:image/gif;base64,base64-data")}',
265 ))265 ))
266 self.assertEquals(266 self.assertEqual(
267 "".join(combine_files(["widget/assets/skins/sam/widget.css",267 "".join(combine_files(["widget/assets/skins/sam/widget.css",
268 "editor/assets/skins/sam/editor.css"],268 "editor/assets/skins/sam/editor.css"],
269 root=test_dir)).strip(),269 root=test_dir)).strip(),
@@ -306,7 +306,7 @@
306 " background: url(editor/assets/skins/sam/img/bg.png);",306 " background: url(editor/assets/skins/sam/img/bg.png);",
307 "}",307 "}",
308 ))308 ))
309 self.assertEquals(309 self.assertEqual(
310 "".join(combine_files(["widget/assets/skins/sam/widget.css",310 "".join(combine_files(["widget/assets/skins/sam/widget.css",
311 "editor/assets/skins/sam/editor.css"],311 "editor/assets/skins/sam/editor.css"],
312 root=test_dir, minify_css=False)).strip(),312 root=test_dir, minify_css=False)).strip(),
@@ -344,7 +344,7 @@
344 "/* editor/assets/skins/sam/editor.css */",344 "/* editor/assets/skins/sam/editor.css */",
345 ".yui-editor{background:url(img/bg.png)}",345 ".yui-editor{background:url(img/bg.png)}",
346 ))346 ))
347 self.assertEquals(347 self.assertEqual(
348 "".join(combine_files(["widget/assets/skins/sam/widget.css",348 "".join(combine_files(["widget/assets/skins/sam/widget.css",
349 "editor/assets/skins/sam/editor.css"],349 "editor/assets/skins/sam/editor.css"],
350 root=test_dir, rewrite_urls=False)).strip(),350 root=test_dir, rewrite_urls=False)).strip(),
@@ -388,7 +388,7 @@
388 ' background: url("img/bg.png");',388 ' background: url("img/bg.png");',
389 '}',389 '}',
390 ))390 ))
391 self.assertEquals(391 self.assertEqual(
392 "".join(combine_files(["widget/assets/skins/sam/widget.css",392 "".join(combine_files(["widget/assets/skins/sam/widget.css",
393 "editor/assets/skins/sam/editor.css"],393 "editor/assets/skins/sam/editor.css"],
394 root=test_dir,394 root=test_dir,
@@ -431,7 +431,7 @@
431 ".yui-editor{background:url(" +431 ".yui-editor{background:url(" +
432 "/static/editor/assets/skins/sam/img/bg.png)}",432 "/static/editor/assets/skins/sam/img/bg.png)}",
433 ))433 ))
434 self.assertEquals(434 self.assertEqual(
435 "".join(combine_files(["widget/assets/skins/sam/widget.css",435 "".join(combine_files(["widget/assets/skins/sam/widget.css",
436 "editor/assets/skins/sam/editor.css"],436 "editor/assets/skins/sam/editor.css"],
437 root=test_dir,437 root=test_dir,
@@ -459,7 +459,7 @@
459 "// [missing]",459 "// [missing]",
460 "// event-custom/event-custom-min.js",460 "// event-custom/event-custom-min.js",
461 "** event-custom-min **"))461 "** event-custom-min **"))
462 self.assertEquals(462 self.assertEqual(
463 "".join(combine_files(["yui/yui-min.js",463 "".join(combine_files(["yui/yui-min.js",
464 "oop/oop-min.js",464 "oop/oop-min.js",
465 "event-custom/event-custom-min.js"],465 "event-custom/event-custom-min.js"],
@@ -482,7 +482,7 @@
482482
483 expected = "\n".join(("// ../../oop/oop-min.js",483 expected = "\n".join(("// ../../oop/oop-min.js",
484 "// [missing]"))484 "// [missing]"))
485 self.assertEquals(485 self.assertEqual(
486 "".join(combine_files([hack], root=root)).strip(),486 "".join(combine_files([hack], root=root)).strip(),
487 expected)487 expected)
488488
@@ -498,7 +498,7 @@
498498
499 expected = "\n".join(("/* yui/base/base.css */",499 expected = "\n".join(("/* yui/base/base.css */",
500 ".foo{background-image:url(img.png)}"))500 ".foo{background-image:url(img.png)}"))
501 self.assertEquals(501 self.assertEqual(
502 "".join(combine_files(files, root=test_dir)).strip(),502 "".join(combine_files(files, root=test_dir)).strip(),
503 expected)503 expected)
504504
@@ -510,7 +510,7 @@
510 self.assertTrue(os.path.exists("/etc/passwd"))510 self.assertTrue(os.path.exists("/etc/passwd"))
511511
512 expected = ""512 expected = ""
513 self.assertEquals(513 self.assertEqual(
514 "".join(combine_files([hack], root=test_dir)).strip(),514 "".join(combine_files([hack], root=test_dir)).strip(),
515 expected)515 expected)
516516
@@ -548,8 +548,8 @@
548 ["yui/yui-min.js",548 ["yui/yui-min.js",
549 "oop/oop-min.js",549 "oop/oop-min.js",
550 "event-custom/event-custom-min.js"]), status=200)550 "event-custom/event-custom-min.js"]), status=200)
551 self.assertEquals(res.headers, [("Content-Type", "text/javascript")])551 self.assertEqual(res.headers, [("Content-Type", "text/javascript")])
552 self.assertEquals(res.body.strip(), expected)552 self.assertEqual(res.body.strip(), expected)
553553
554 def test_combo_app_sets_content_type_for_css(self):554 def test_combo_app_sets_content_type_for_css(self):
555 """The WSGI App should set a proper Content-Type for CSS."""555 """The WSGI App should set a proper Content-Type for CSS."""
@@ -562,11 +562,11 @@
562562
563 res = self.app.get("/?" + "&".join(563 res = self.app.get("/?" + "&".join(
564 ["widget/skin/sam/widget.css"]), status=200)564 ["widget/skin/sam/widget.css"]), status=200)
565 self.assertEquals(res.headers, [("Content-Type", "text/css")])565 self.assertEqual(res.headers, [("Content-Type", "text/css")])
566 self.assertEquals(res.body.strip(), expected)566 self.assertEqual(res.body.strip(), expected)
567567
568 def test_no_filename_gives_404(self):568 def test_no_filename_gives_404(self):
569 """If no filename is included, a 404 should be returned."""569 """If no filename is included, a 404 should be returned."""
570 res = self.app.get("/", status=404)570 res = self.app.get("/", status=404)
571 self.assertEquals(res.headers, [("Content-Type", "text/plain")])571 self.assertEqual(res.headers, [("Content-Type", "text/plain")])
572 self.assertEquals(res.body, "Not Found")572 self.assertEqual(res.body, "Not Found")
573573
=== modified file 'lib/lp/services/config/tests/test_config_lookup.py'
--- lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 15:23:24 +0000
+++ lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 16:24:23 +0000
@@ -113,7 +113,7 @@
113113
114 def test_find_config_dir(self):114 def test_find_config_dir(self):
115 instance_config_dir = self.setUpInstanceConfig('an_instance')115 instance_config_dir = self.setUpInstanceConfig('an_instance')
116 self.assertEquals(116 self.assertEqual(
117 instance_config_dir, config.find_config_dir('an_instance'))117 instance_config_dir, config.find_config_dir('an_instance'))
118118
119 def test_Config_uses_find_config_dir(self):119 def test_Config_uses_find_config_dir(self):
@@ -127,7 +127,7 @@
127127
128 # We don't care about ZConfig...128 # We don't care about ZConfig...
129 cfg._setZConfig = lambda: None129 cfg._setZConfig = lambda: None
130 self.assertEquals(2323, cfg.launchpad.default_batch_size)130 self.assertEqual(2323, cfg.launchpad.default_batch_size)
131131
132132
133class TestGenerateOverrides(ConfigTestCase):133class TestGenerateOverrides(ConfigTestCase):
134134
=== modified file 'lib/lp/services/database/tests/test_storm.py'
--- lib/lp/services/database/tests/test_storm.py 2014-01-30 15:04:06 +0000
+++ lib/lp/services/database/tests/test_storm.py 2018-01-02 16:24:23 +0000
@@ -13,6 +13,6 @@
13class TestStorm(TestCase):13class TestStorm(TestCase):
14 def test_has_cextensions(self):14 def test_has_cextensions(self):
15 """Ensure Storm C extensions are being used."""15 """Ensure Storm C extensions are being used."""
16 self.assert_(16 self.assertTrue(
17 storm.has_cextensions,17 storm.has_cextensions,
18 'Storm not running with C extensions')18 'Storm not running with C extensions')
1919
=== modified file 'lib/lp/services/features/tests/test_flags.py'
--- lib/lp/services/features/tests/test_flags.py 2014-02-26 00:25:03 +0000
+++ lib/lp/services/features/tests/test_flags.py 2018-01-02 16:24:23 +0000
@@ -188,7 +188,7 @@
188 # no scopes need to be checked because it's just not in the database188 # no scopes need to be checked because it's just not in the database
189 # and there's no point checking189 # and there's no point checking
190 self.assertEqual({}, f._known_scopes._known)190 self.assertEqual({}, f._known_scopes._known)
191 self.assertEquals([], call_log)191 self.assertEqual([], call_log)
192 # however, this we have now negative-cached the flag192 # however, this we have now negative-cached the flag
193 self.assertEqual(dict(unknown=None), f.usedFlags())193 self.assertEqual(dict(unknown=None), f.usedFlags())
194 self.assertEqual(dict(), f.usedScopes())194 self.assertEqual(dict(), f.usedScopes())
@@ -215,14 +215,14 @@
215 def test_getAllRulesAsTuples(self):215 def test_getAllRulesAsTuples(self):
216 source = self.makeSource()216 source = self.makeSource()
217 source.setAllRules(test_rules_list)217 source.setAllRules(test_rules_list)
218 self.assertEquals(218 self.assertEqual(
219 test_rules_list,219 test_rules_list,
220 list(source.getAllRulesAsTuples()))220 list(source.getAllRulesAsTuples()))
221221
222 def test_getAllRulesAsText(self):222 def test_getAllRulesAsText(self):
223 source = self.makeSource()223 source = self.makeSource()
224 source.setAllRules(test_rules_list)224 source.setAllRules(test_rules_list)
225 self.assertEquals(225 self.assertEqual(
226 """\226 """\
227%s\tbeta_user\t100\t%s227%s\tbeta_user\t100\t%s
228ui.icing\tnormal_user\t500\t5.0228ui.icing\tnormal_user\t500\t5.0
@@ -241,7 +241,7 @@
241flag1 default 100 gamma with spaces241flag1 default 100 gamma with spaces
242flag2 default 0\ton242flag2 default 0\ton
243""")243""")
244 self.assertEquals({244 self.assertEqual({
245 'flag1': [245 'flag1': [
246 ('beta_user', 200, 'alpha'),246 ('beta_user', 200, 'alpha'),
247 ('default', 100, 'gamma with spaces'),247 ('default', 100, 'gamma with spaces'),
248248
=== modified file 'lib/lp/services/features/tests/test_scopes.py'
--- lib/lp/services/features/tests/test_scopes.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/features/tests/test_scopes.py 2018-01-02 16:24:23 +0000
@@ -100,7 +100,7 @@
100 name = 'userslice:%d,%d' % (i, checks)100 name = 'userslice:%d,%d' % (i, checks)
101 if scope.lookup(name):101 if scope.lookup(name):
102 matches.append(name)102 matches.append(name)
103 self.assertEquals(len(matches), 1, matches)103 self.assertEqual(len(matches), 1, matches)
104104
105105
106class TestUserSliceScopeIntegration(TestCaseWithFactory):106class TestUserSliceScopeIntegration(TestCaseWithFactory):
@@ -123,5 +123,5 @@
123 value=u'not_value'),123 value=u'not_value'),
124 ]):124 ]):
125 with person_logged_in(person):125 with person_logged_in(person):
126 self.assertEquals(getFeatureFlag('test_feature'), 'on')126 self.assertEqual(getFeatureFlag('test_feature'), 'on')
127 self.assertEquals(getFeatureFlag('test_not'), None)127 self.assertEqual(getFeatureFlag('test_not'), None)
128128
=== modified file 'lib/lp/services/features/tests/test_webapp.py'
--- lib/lp/services/features/tests/test_webapp.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/features/tests/test_webapp.py 2018-01-02 16:24:23 +0000
@@ -114,7 +114,7 @@
114 with CaptureOops() as capture:114 with CaptureOops() as capture:
115 request = LaunchpadTestRequest()115 request = LaunchpadTestRequest()
116116
117 self.assertEquals(getFeatureFlag('feature_name'), 'value')117 self.assertEqual(getFeatureFlag('feature_name'), 'value')
118118
119 # Simulate an oops here.119 # Simulate an oops here.
120 globalErrorUtility.raising(None, request=request)120 globalErrorUtility.raising(None, request=request)
@@ -122,5 +122,5 @@
122 oops = capture.oopses[0]122 oops = capture.oopses[0]
123 self.assertTrue('features.usedScopes' in oops)123 self.assertTrue('features.usedScopes' in oops)
124 self.assertTrue('features.usedFlags' in oops)124 self.assertTrue('features.usedFlags' in oops)
125 self.assertEquals(oops['features.usedFlags'],125 self.assertEqual(
126 u"{'feature_name': u'value'}")126 oops['features.usedFlags'], u"{'feature_name': u'value'}")
127127
=== modified file 'lib/lp/services/librarian/tests/test_libraryfilealias.py'
--- lib/lp/services/librarian/tests/test_libraryfilealias.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/librarian/tests/test_libraryfilealias.py 2018-01-02 16:24:23 +0000
@@ -38,10 +38,10 @@
38 def test_file_is_closed_at_the_end_of_transaction(self):38 def test_file_is_closed_at_the_end_of_transaction(self):
39 """Non-DB instance state should be reset on transaction boundaries."""39 """Non-DB instance state should be reset on transaction boundaries."""
40 self.file_alias.open()40 self.file_alias.open()
41 self.assertEquals(self.text_content[0:4], self.file_alias.read(4))41 self.assertEqual(self.text_content[0:4], self.file_alias.read(4))
42 # This should reset the file pointer.42 # This should reset the file pointer.
43 transaction.commit()43 transaction.commit()
44 # If the file pointer isn't reset, the next call to read() will return44 # If the file pointer isn't reset, the next call to read() will return
45 # the remaining content. If it's reset, the file will be auto-opened45 # the remaining content. If it's reset, the file will be auto-opened
46 # and its whole content will be returned.46 # and its whole content will be returned.
47 self.assertEquals(self.text_content, self.file_alias.read())47 self.assertEqual(self.text_content, self.file_alias.read())
4848
=== modified file 'lib/lp/services/librarian/tests/test_smoketest.py'
--- lib/lp/services/librarian/tests/test_smoketest.py 2015-10-14 15:22:01 +0000
+++ lib/lp/services/librarian/tests/test_smoketest.py 2018-01-02 16:24:23 +0000
@@ -78,7 +78,7 @@
78 # the main function will return 0 (which will be used as the processes78 # the main function will return 0 (which will be used as the processes
79 # exit code to signal success).79 # exit code to signal success).
80 with fake_urllib(GoodUrllib()):80 with fake_urllib(GoodUrllib()):
81 self.assertEquals(81 self.assertEqual(
82 do_smoketest(self.fake_librarian, self.fake_librarian,82 do_smoketest(self.fake_librarian, self.fake_librarian,
83 output=StringIO()),83 output=StringIO()),
84 0)84 0)
@@ -87,7 +87,7 @@
87 # If incorrect data is retrieved, the main function will return 187 # If incorrect data is retrieved, the main function will return 1
88 # (which will be used as the processes exit code to signal an error).88 # (which will be used as the processes exit code to signal an error).
89 with fake_urllib(BadUrllib()):89 with fake_urllib(BadUrllib()):
90 self.assertEquals(90 self.assertEqual(
91 do_smoketest(self.fake_librarian, self.fake_librarian,91 do_smoketest(self.fake_librarian, self.fake_librarian,
92 output=StringIO()),92 output=StringIO()),
93 1)93 1)
@@ -97,7 +97,7 @@
97 # function will return 1 (which will be used as the processes exit97 # function will return 1 (which will be used as the processes exit
98 # code to signal an error).98 # code to signal an error).
99 with fake_urllib(ErrorUrllib()):99 with fake_urllib(ErrorUrllib()):
100 self.assertEquals(100 self.assertEqual(
101 do_smoketest(self.fake_librarian, self.fake_librarian,101 do_smoketest(self.fake_librarian, self.fake_librarian,
102 output=StringIO()),102 output=StringIO()),
103 1)103 1)
104104
=== modified file 'lib/lp/services/librarianserver/tests/test_gc.py'
--- lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 10:54:31 +0000
+++ lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 16:24:23 +0000
@@ -299,10 +299,10 @@
299 self.ztm.begin()299 self.ztm.begin()
300 # Make sure the well expired f1 is still there, but has no content.300 # Make sure the well expired f1 is still there, but has no content.
301 f1 = LibraryFileAlias.get(self.f1_id)301 f1 = LibraryFileAlias.get(self.f1_id)
302 self.assert_(f1.content is None)302 self.assertIsNone(f1.content)
303 # f2 should still have content, as it isn't flagged for expiry.303 # f2 should still have content, as it isn't flagged for expiry.
304 f2 = LibraryFileAlias.get(self.f2_id)304 f2 = LibraryFileAlias.get(self.f2_id)
305 self.assert_(f2.content is not None)305 self.assertIsNotNone(f2.content)
306306
307 def test_ignoreRecentlyExpiredAliases(self):307 def test_ignoreRecentlyExpiredAliases(self):
308 # LibraryFileAlias records that have expired recently are not308 # LibraryFileAlias records that have expired recently are not
@@ -323,10 +323,10 @@
323 # Make sure f1 is still there and has content. This ensures that323 # Make sure f1 is still there and has content. This ensures that
324 # our stay of execution is still working.324 # our stay of execution is still working.
325 f1 = LibraryFileAlias.get(self.f1_id)325 f1 = LibraryFileAlias.get(self.f1_id)
326 self.assert_(f1.content is not None)326 self.assertIsNotNone(f1.content)
327 # f2 should still have content, as it isn't flagged for expiry.327 # f2 should still have content, as it isn't flagged for expiry.
328 f2 = LibraryFileAlias.get(self.f2_id)328 f2 = LibraryFileAlias.get(self.f2_id)
329 self.assert_(f2.content is not None)329 self.assertIsNotNone(f2.content)
330330
331 def test_DeleteUnreferencedContent(self):331 def test_DeleteUnreferencedContent(self):
332 # Merge the duplicates. This creates an332 # Merge the duplicates. This creates an
@@ -677,13 +677,13 @@
677 librariangc.delete_unwanted_files(self.con)677 librariangc.delete_unwanted_files(self.con)
678678
679 # None of the rubbish we created has been touched.679 # None of the rubbish we created has been touched.
680 self.assert_(os.path.isdir(noisedir1_path))680 self.assertTrue(os.path.isdir(noisedir1_path))
681 self.assert_(os.path.isdir(noisedir2_path))681 self.assertTrue(os.path.isdir(noisedir2_path))
682 self.assert_(os.path.isdir(noisedir3_path))682 self.assertTrue(os.path.isdir(noisedir3_path))
683 self.assert_(os.path.exists(noisefile1_path))683 self.assertTrue(os.path.exists(noisefile1_path))
684 self.assert_(os.path.exists(noisefile2_path))684 self.assertTrue(os.path.exists(noisefile2_path))
685 self.assert_(os.path.exists(noisefile3_path))685 self.assertTrue(os.path.exists(noisefile3_path))
686 self.assert_(os.path.exists(migrated_path))686 self.assertTrue(os.path.exists(migrated_path))
687 finally:687 finally:
688 # We need to clean this up ourselves, as the standard librarian688 # We need to clean this up ourselves, as the standard librarian
689 # cleanup only removes files it knows where valid to avoid689 # cleanup only removes files it knows where valid to avoid
690690
=== modified file 'lib/lp/services/librarianserver/tests/test_swift.py'
--- lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 10:54:31 +0000
+++ lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 16:24:23 +0000
@@ -82,7 +82,7 @@
82 # Confirm that files exist on disk where we expect to find them.82 # Confirm that files exist on disk where we expect to find them.
83 for lfc in self.lfcs:83 for lfc in self.lfcs:
84 path = swift.filesystem_path(lfc.id)84 path = swift.filesystem_path(lfc.id)
85 self.assert_(os.path.exists(path))85 self.assertTrue(os.path.exists(path))
8686
87 # Copy all the files into Swift.87 # Copy all the files into Swift.
88 swift.to_swift(log, remove_func=None)88 swift.to_swift(log, remove_func=None)
@@ -90,7 +90,7 @@
90 # Confirm that files exist on disk where we expect to find them.90 # Confirm that files exist on disk where we expect to find them.
91 for lfc in self.lfcs:91 for lfc in self.lfcs:
92 path = swift.filesystem_path(lfc.id)92 path = swift.filesystem_path(lfc.id)
93 self.assert_(os.path.exists(path))93 self.assertTrue(os.path.exists(path))
9494
95 # Confirm all the files are also in Swift.95 # Confirm all the files are also in Swift.
96 swift_client = self.swift_fixture.connect()96 swift_client = self.swift_fixture.connect()
@@ -113,7 +113,7 @@
113 # Confirm that files exist on disk where we expect to find them.113 # Confirm that files exist on disk where we expect to find them.
114 for lfc in self.lfcs:114 for lfc in self.lfcs:
115 path = swift.filesystem_path(lfc.id)115 path = swift.filesystem_path(lfc.id)
116 self.assert_(os.path.exists(path))116 self.assertTrue(os.path.exists(path))
117117
118 # Copy all the files into Swift.118 # Copy all the files into Swift.
119 swift.to_swift(log, remove_func=swift.rename)119 swift.to_swift(log, remove_func=swift.rename)
@@ -121,7 +121,7 @@
121 # Confirm that files exist on disk where we expect to find them.121 # Confirm that files exist on disk where we expect to find them.
122 for lfc in self.lfcs:122 for lfc in self.lfcs:
123 path = swift.filesystem_path(lfc.id) + '.migrated'123 path = swift.filesystem_path(lfc.id) + '.migrated'
124 self.assert_(os.path.exists(path))124 self.assertTrue(os.path.exists(path))
125125
126 # Confirm all the files are also in Swift.126 # Confirm all the files are also in Swift.
127 swift_client = self.swift_fixture.connect()127 swift_client = self.swift_fixture.connect()
@@ -144,7 +144,7 @@
144 # Confirm that files exist on disk where we expect to find them.144 # Confirm that files exist on disk where we expect to find them.
145 for lfc in self.lfcs:145 for lfc in self.lfcs:
146 path = swift.filesystem_path(lfc.id)146 path = swift.filesystem_path(lfc.id)
147 self.assert_(os.path.exists(path))147 self.assertTrue(os.path.exists(path))
148148
149 # Migrate all the files into Swift.149 # Migrate all the files into Swift.
150 swift.to_swift(log, remove_func=os.unlink)150 swift.to_swift(log, remove_func=os.unlink)
@@ -200,7 +200,7 @@
200 # to be done in multiple chunks, but small enough that it is200 # to be done in multiple chunks, but small enough that it is
201 # stored in Swift as a single object.201 # stored in Swift as a single object.
202 size = LibrarianStorage.CHUNK_SIZE * 50202 size = LibrarianStorage.CHUNK_SIZE * 50
203 self.assert_(size > 1024 * 1024)203 self.assertTrue(size > 1024 * 1024)
204 expected_content = ''.join(chr(i % 256) for i in range(0, size))204 expected_content = ''.join(chr(i % 256) for i in range(0, size))
205 lfa_id = self.add_file('hello_bigboy.xls', expected_content)205 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
206 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content206 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content
@@ -222,7 +222,7 @@
222 # to be done in multiple chunks, but small enough that it is222 # to be done in multiple chunks, but small enough that it is
223 # stored in Swift as a single object.223 # stored in Swift as a single object.
224 size = LibrarianStorage.CHUNK_SIZE * 50 + 1224 size = LibrarianStorage.CHUNK_SIZE * 50 + 1
225 self.assert_(size > 1024 * 1024)225 self.assertTrue(size > 1024 * 1024)
226 expected_content = ''.join(chr(i % 256) for i in range(0, size))226 expected_content = ''.join(chr(i % 256) for i in range(0, size))
227 lfa_id = self.add_file('hello_bigboy.xls', expected_content)227 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
228 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content228 lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content
@@ -241,7 +241,7 @@
241 # Generate a blob large enough that Swift requires us to store241 # Generate a blob large enough that Swift requires us to store
242 # it as multiple objects plus a manifest.242 # it as multiple objects plus a manifest.
243 size = LibrarianStorage.CHUNK_SIZE * 50243 size = LibrarianStorage.CHUNK_SIZE * 50
244 self.assert_(size > 1024 * 1024)244 self.assertTrue(size > 1024 * 1024)
245 expected_content = ''.join(chr(i % 256) for i in range(0, size))245 expected_content = ''.join(chr(i % 256) for i in range(0, size))
246 lfa_id = self.add_file('hello_bigboy.xls', expected_content)246 lfa_id = self.add_file('hello_bigboy.xls', expected_content)
247 lfa = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id)247 lfa = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id)
248248
=== modified file 'lib/lp/services/mail/tests/test_sendmail.py'
--- lib/lp/services/mail/tests/test_sendmail.py 2015-07-08 16:05:11 +0000
+++ lib/lp/services/mail/tests/test_sendmail.py 2018-01-02 16:24:23 +0000
@@ -270,8 +270,8 @@
270 'from@example.com', to_addresses,270 'from@example.com', to_addresses,
271 subject, 'body', {'key': 'value'})271 subject, 'body', {'key': 'value'})
272 ctrl.send()272 ctrl.send()
273 self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com')273 self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com')
274 self.assertEquals(fake_mailer.to_addr, to_addresses)274 self.assertEqual(fake_mailer.to_addr, to_addresses)
275 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject)275 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject)
276276
277 def test_sendmail_with_email_header(self):277 def test_sendmail_with_email_header(self):
@@ -290,16 +290,16 @@
290 message.add_header('To', 'dest@example.com')290 message.add_header('To', 'dest@example.com')
291 with CaptureTimeline() as ctl:291 with CaptureTimeline() as ctl:
292 sendmail.sendmail(message)292 sendmail.sendmail(message)
293 self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com')293 self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com')
294 self.assertEquals(fake_mailer.to_addr, ['dest@example.com'])294 self.assertEqual(fake_mailer.to_addr, ['dest@example.com'])
295 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject_str)295 self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject_str)
296296
297 def checkTimelineHasOneMailAction(self, timeline, subject):297 def checkTimelineHasOneMailAction(self, timeline, subject):
298 actions = timeline.actions298 actions = timeline.actions
299 self.assertEquals(len(actions), 1)299 self.assertEqual(len(actions), 1)
300 a0 = actions[0]300 a0 = actions[0]
301 self.assertEquals(a0.category, 'sendmail')301 self.assertEqual(a0.category, 'sendmail')
302 self.assertEquals(a0.detail, subject)302 self.assertEqual(a0.detail, subject)
303 self.assertIsInstance(a0.detail, basestring)303 self.assertIsInstance(a0.detail, basestring)
304304
305305
306306
=== modified file 'lib/lp/services/oauth/tests/test_oauth.py'
--- lib/lp/services/oauth/tests/test_oauth.py 2016-01-26 15:14:01 +0000
+++ lib/lp/services/oauth/tests/test_oauth.py 2018-01-02 16:24:23 +0000
@@ -33,7 +33,7 @@
33 screen won't probably find the new request token on the slave store.33 screen won't probably find the new request token on the slave store.
34 """34 """
35 zstorm = getUtility(IZStorm)35 zstorm = getUtility(IZStorm)
36 self.assertEquals(36 self.assertEqual(
37 '%s-%s' % (MAIN_STORE, MASTER_FLAVOR),37 '%s-%s' % (MAIN_STORE, MASTER_FLAVOR),
38 zstorm.get_name(self.class_._getStore()))38 zstorm.get_name(self.class_._getStore()))
3939
4040
=== modified file 'lib/lp/services/oauth/tests/test_tokens.py'
--- lib/lp/services/oauth/tests/test_tokens.py 2016-01-26 15:14:01 +0000
+++ lib/lp/services/oauth/tests/test_tokens.py 2018-01-02 16:24:23 +0000
@@ -95,10 +95,10 @@
9595
96 def test_getByKey(self):96 def test_getByKey(self):
97 token, _ = self.consumer.newRequestToken()97 token, _ = self.consumer.newRequestToken()
98 self.assertEquals(token, self.tokens.getByKey(token.key))98 self.assertEqual(token, self.tokens.getByKey(token.key))
9999
100 def test_getByKey_returns_none_for_unused_key(self):100 def test_getByKey_returns_none_for_unused_key(self):
101 self.assertEquals(None, self.tokens.getByKey(u"no-such-token"))101 self.assertIsNone(self.tokens.getByKey(u"no-such-token"))
102102
103103
104class TestRequestTokens(TestOAuth):104class TestRequestTokens(TestOAuth):
@@ -142,12 +142,10 @@
142 def test_getRequestToken_for_wrong_consumer_returns_none(self):142 def test_getRequestToken_for_wrong_consumer_returns_none(self):
143 token_1, _ = self.consumer.newRequestToken()143 token_1, _ = self.consumer.newRequestToken()
144 consumer_2 = self.factory.makeOAuthConsumer()144 consumer_2 = self.factory.makeOAuthConsumer()
145 self.assertEquals(145 self.assertIsNone(consumer_2.getRequestToken(token_1.key))
146 None, consumer_2.getRequestToken(token_1.key))
147146
148 def test_getRequestToken_for_nonexistent_key_returns_none(self):147 def test_getRequestToken_for_nonexistent_key_returns_none(self):
149 self.assertEquals(148 self.assertIsNone(self.consumer.getRequestToken(u"no-such-token"))
150 None, self.consumer.getRequestToken(u"no-such-token"))
151149
152 def test_isSecretValid(self):150 def test_isSecretValid(self):
153 token, secret = self.consumer.newRequestToken()151 token, secret = self.consumer.newRequestToken()
@@ -161,16 +159,16 @@
161 now = datetime.now(pytz.timezone('UTC'))159 now = datetime.now(pytz.timezone('UTC'))
162160
163 self.assertTrue(request_token.is_reviewed)161 self.assertTrue(request_token.is_reviewed)
164 self.assertEquals(request_token.person, self.person)162 self.assertEqual(request_token.person, self.person)
165 self.assertEquals(request_token.permission,163 self.assertEqual(request_token.permission,
166 OAuthPermission.WRITE_PUBLIC)164 OAuthPermission.WRITE_PUBLIC)
167165
168 self.assertTrue(request_token.date_created <= now)166 self.assertTrue(request_token.date_created <= now)
169167
170 # By default, reviewing a token does not set a context or168 # By default, reviewing a token does not set a context or
171 # expiration date.169 # expiration date.
172 self.assertEquals(request_token.context, None)170 self.assertIsNone(request_token.context)
173 self.assertEquals(request_token.date_expires, None)171 self.assertIsNone(request_token.date_expires)
174172
175 def test_token_review_as_unauthorized(self):173 def test_token_review_as_unauthorized(self):
176 request_token, _ = self.consumer.newRequestToken()174 request_token, _ = self.consumer.newRequestToken()
@@ -179,8 +177,8 @@
179 # This token has been reviewed, but it may not be used for any177 # This token has been reviewed, but it may not be used for any
180 # purpose.178 # purpose.
181 self.assertTrue(request_token.is_reviewed)179 self.assertTrue(request_token.is_reviewed)
182 self.assertEquals(request_token.permission,180 self.assertEqual(request_token.permission,
183 OAuthPermission.UNAUTHORIZED)181 OAuthPermission.UNAUTHORIZED)
184182
185 def test_review_with_expiration_date(self):183 def test_review_with_expiration_date(self):
186 # A request token may be associated with an expiration date184 # A request token may be associated with an expiration date
@@ -189,7 +187,7 @@
189 request_token.review(187 request_token.review(
190 self.person, OAuthPermission.WRITE_PUBLIC,188 self.person, OAuthPermission.WRITE_PUBLIC,
191 date_expires=self.in_a_while)189 date_expires=self.in_a_while)
192 self.assertEquals(request_token.date_expires, self.in_a_while)190 self.assertEqual(request_token.date_expires, self.in_a_while)
193191
194 def test_review_with_expiration_date_in_the_past(self):192 def test_review_with_expiration_date_in_the_past(self):
195 # The expiration date, like the permission and context, is193 # The expiration date, like the permission and context, is
@@ -203,7 +201,7 @@
203 request_token.review(201 request_token.review(
204 self.person, OAuthPermission.WRITE_PUBLIC,202 self.person, OAuthPermission.WRITE_PUBLIC,
205 date_expires=self.a_long_time_ago)203 date_expires=self.a_long_time_ago)
206 self.assertEquals(request_token.date_expires, self.a_long_time_ago)204 self.assertEqual(request_token.date_expires, self.a_long_time_ago)
207 self.assertFalse(request_token.is_expired)205 self.assertFalse(request_token.is_expired)
208206
209 def _reviewed_token_for_context(self, context_factory):207 def _reviewed_token_for_context(self, context_factory):
@@ -220,21 +218,21 @@
220 # product.218 # product.
221 token, name = self._reviewed_token_for_context(219 token, name = self._reviewed_token_for_context(
222 self.factory.makeProduct)220 self.factory.makeProduct)
223 self.assertEquals(token.context.name, name)221 self.assertEqual(token.context.name, name)
224222
225 def test_review_with_project_group_context(self):223 def test_review_with_project_group_context(self):
226 # When reviewing a request token, the context may be set to a224 # When reviewing a request token, the context may be set to a
227 # project group.225 # project group.
228 token, name = self._reviewed_token_for_context(226 token, name = self._reviewed_token_for_context(
229 self.factory.makeProject)227 self.factory.makeProject)
230 self.assertEquals(token.context.name, name)228 self.assertEqual(token.context.name, name)
231229
232 def test_review_with_distrosourcepackage_context(self):230 def test_review_with_distrosourcepackage_context(self):
233 # When reviewing a request token, the context may be set to a231 # When reviewing a request token, the context may be set to a
234 # distribution source package.232 # distribution source package.
235 token, name = self._reviewed_token_for_context(233 token, name = self._reviewed_token_for_context(
236 self.factory.makeDistributionSourcePackage)234 self.factory.makeDistributionSourcePackage)
237 self.assertEquals(token.context.name, name)235 self.assertEqual(token.context.name, name)
238236
239 def test_expired_request_token_cant_be_reviewed(self):237 def test_expired_request_token_cant_be_reviewed(self):
240 """An expired request token can't be reviewed."""238 """An expired request token can't be reviewed."""
@@ -247,21 +245,21 @@
247 def test_get_request_tokens_for_person(self):245 def test_get_request_tokens_for_person(self):
248 """It's possible to get a person's request tokens."""246 """It's possible to get a person's request tokens."""
249 person = self.factory.makePerson()247 person = self.factory.makePerson()
250 self.assertEquals(person.oauth_request_tokens.count(), 0)248 self.assertEqual(person.oauth_request_tokens.count(), 0)
251 for i in range(0, 3):249 for i in range(0, 3):
252 self.factory.makeOAuthRequestToken(reviewed_by=person)250 self.factory.makeOAuthRequestToken(reviewed_by=person)
253 self.assertEquals(person.oauth_request_tokens.count(), 3)251 self.assertEqual(person.oauth_request_tokens.count(), 3)
254252
255 def test_expired_request_token_disappears_from_list(self):253 def test_expired_request_token_disappears_from_list(self):
256 person = self.factory.makePerson()254 person = self.factory.makePerson()
257 self.assertEquals(person.oauth_request_tokens.count(), 0)255 self.assertEqual(person.oauth_request_tokens.count(), 0)
258 request_token = self.factory.makeOAuthRequestToken(reviewed_by=person)256 request_token = self.factory.makeOAuthRequestToken(reviewed_by=person)
259 self.assertEquals(person.oauth_request_tokens.count(), 1)257 self.assertEqual(person.oauth_request_tokens.count(), 1)
260258
261 login_person(person)259 login_person(person)
262 request_token.date_expires = self.a_long_time_ago260 request_token.date_expires = self.a_long_time_ago
263261
264 self.assertEquals(person.oauth_request_tokens.count(), 0)262 self.assertEqual(person.oauth_request_tokens.count(), 0)
265263
266264
267class TestAccessTokens(TestOAuth):265class TestAccessTokens(TestOAuth):
@@ -292,18 +290,17 @@
292 request_token, access_token, _ = (290 request_token, access_token, _ = (
293 self._exchange_request_token_for_access_token())291 self._exchange_request_token_for_access_token())
294292
295 self.assertEquals(request_token.consumer, access_token.consumer)293 self.assertEqual(request_token.consumer, access_token.consumer)
296294
297 # An access token inherits its permission from the request295 # An access token inherits its permission from the request
298 # token that created it. But an access token's .permission is296 # token that created it. But an access token's .permission is
299 # an AccessLevel object, not an OAuthPermission. The only real297 # an AccessLevel object, not an OAuthPermission. The only real
300 # difference is that there's no AccessLevel corresponding to298 # difference is that there's no AccessLevel corresponding to
301 # OAuthPermission.UNAUTHORIZED.299 # OAuthPermission.UNAUTHORIZED.
302 self.assertEquals(300 self.assertEqual(access_token.permission, AccessLevel.WRITE_PRIVATE)
303 access_token.permission, AccessLevel.WRITE_PRIVATE)
304301
305 self.assertEquals(None, access_token.context)302 self.assertIsNone(access_token.context)
306 self.assertEquals(None, access_token.date_expires)303 self.assertIsNone(access_token.date_expires)
307304
308 def test_access_token_field_inheritance(self):305 def test_access_token_field_inheritance(self):
309 # Make sure that specific fields like context and expiration306 # Make sure that specific fields like context and expiration
@@ -314,15 +311,13 @@
314 self.person, OAuthPermission.WRITE_PRIVATE,311 self.person, OAuthPermission.WRITE_PRIVATE,
315 context=context, date_expires=self.in_a_while)312 context=context, date_expires=self.in_a_while)
316 access_token, _ = request_token.createAccessToken()313 access_token, _ = request_token.createAccessToken()
317 self.assertEquals(request_token.context, access_token.context)314 self.assertEqual(request_token.context, access_token.context)
318 self.assertEquals(315 self.assertEqual(request_token.date_expires, access_token.date_expires)
319 request_token.date_expires, access_token.date_expires)
320316
321 def test_request_token_disappears_when_exchanged(self):317 def test_request_token_disappears_when_exchanged(self):
322 request_token, access_token, _ = (318 request_token, access_token, _ = (
323 self._exchange_request_token_for_access_token())319 self._exchange_request_token_for_access_token())
324 self.assertEquals(320 self.assertIsNone(self.consumer.getRequestToken(request_token.key))
325 None, self.consumer.getRequestToken(request_token.key))
326321
327 def test_cant_exchange_unreviewed_request_token(self):322 def test_cant_exchange_unreviewed_request_token(self):
328 # An unreviewed request token cannot be exchanged for an access token.323 # An unreviewed request token cannot be exchanged for an access token.
@@ -367,21 +362,21 @@
367 def test_get_access_tokens_for_person(self):362 def test_get_access_tokens_for_person(self):
368 """It's possible to get a person's access tokens."""363 """It's possible to get a person's access tokens."""
369 person = self.factory.makePerson()364 person = self.factory.makePerson()
370 self.assertEquals(person.oauth_access_tokens.count(), 0)365 self.assertEqual(person.oauth_access_tokens.count(), 0)
371 for i in range(0, 3):366 for i in range(0, 3):
372 self.factory.makeOAuthAccessToken(self.consumer, person)367 self.factory.makeOAuthAccessToken(self.consumer, person)
373 self.assertEquals(person.oauth_access_tokens.count(), 3)368 self.assertEqual(person.oauth_access_tokens.count(), 3)
374369
375 def test_expired_access_token_disappears_from_list(self):370 def test_expired_access_token_disappears_from_list(self):
376 person = self.factory.makePerson()371 person = self.factory.makePerson()
377 self.assertEquals(person.oauth_access_tokens.count(), 0)372 self.assertEqual(person.oauth_access_tokens.count(), 0)
378 access_token, _ = self.factory.makeOAuthAccessToken(373 access_token, _ = self.factory.makeOAuthAccessToken(
379 self.consumer, person)374 self.consumer, person)
380 self.assertEquals(person.oauth_access_tokens.count(), 1)375 self.assertEqual(person.oauth_access_tokens.count(), 1)
381376
382 login_person(access_token.person)377 login_person(access_token.person)
383 access_token.date_expires = self.a_long_time_ago378 access_token.date_expires = self.a_long_time_ago
384 self.assertEquals(person.oauth_access_tokens.count(), 0)379 self.assertEqual(person.oauth_access_tokens.count(), 0)
385380
386381
387class TestHelperFunctions(TestOAuth):382class TestHelperFunctions(TestOAuth):
@@ -394,11 +389,11 @@
394 # If there's no token for user/consumer key/permission/context,389 # If there's no token for user/consumer key/permission/context,
395 # one is created.390 # one is created.
396 person = self.factory.makePerson()391 person = self.factory.makePerson()
397 self.assertEquals(person.oauth_access_tokens.count(), 0)392 self.assertEqual(person.oauth_access_tokens.count(), 0)
398 oauth_access_token_for(393 oauth_access_token_for(
399 self.consumer.key, person, OAuthPermission.WRITE_PUBLIC,394 self.consumer.key, person, OAuthPermission.WRITE_PUBLIC,
400 self.context)395 self.context)
401 self.assertEquals(person.oauth_access_tokens.count(), 1)396 self.assertEqual(person.oauth_access_tokens.count(), 1)
402397
403 def test_oauth_access_token_string_permission(self):398 def test_oauth_access_token_string_permission(self):
404 """You can pass in a string instead of an OAuthPermission."""399 """You can pass in a string instead of an OAuthPermission."""
405400
=== modified file 'lib/lp/services/openid/tests/test_baseopenidstore.py'
--- lib/lp/services/openid/tests/test_baseopenidstore.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/openid/tests/test_baseopenidstore.py 2018-01-02 16:24:23 +0000
@@ -29,12 +29,12 @@
29 'handle', 'secret', 42, 600, 'HMAC-SHA1'))29 'handle', 'secret', 42, 600, 'HMAC-SHA1'))
30 db_assoc = IMasterStore(self.store.Association).get(30 db_assoc = IMasterStore(self.store.Association).get(
31 self.store.Association, (u'server-url\xA9', u'handle'))31 self.store.Association, (u'server-url\xA9', u'handle'))
32 self.assertEquals(db_assoc.server_url, u'server-url\xA9')32 self.assertEqual(db_assoc.server_url, u'server-url\xA9')
33 self.assertEquals(db_assoc.handle, u'handle')33 self.assertEqual(db_assoc.handle, u'handle')
34 self.assertEquals(db_assoc.secret, 'secret')34 self.assertEqual(db_assoc.secret, 'secret')
35 self.assertEquals(db_assoc.issued, 42)35 self.assertEqual(db_assoc.issued, 42)
36 self.assertEquals(db_assoc.lifetime, 600)36 self.assertEqual(db_assoc.lifetime, 600)
37 self.assertEquals(db_assoc.assoc_type, u'HMAC-SHA1')37 self.assertEqual(db_assoc.assoc_type, u'HMAC-SHA1')
3838
39 def test_storeAssociation_update_existing(self):39 def test_storeAssociation_update_existing(self):
40 self.store.storeAssociation('server-url', Association(40 self.store.storeAssociation('server-url', Association(
@@ -58,15 +58,15 @@
5858
59 assoc = self.store.getAssociation('server-url', 'handle')59 assoc = self.store.getAssociation('server-url', 'handle')
60 self.assertIsInstance(assoc, Association)60 self.assertIsInstance(assoc, Association)
61 self.assertEquals(assoc.handle, 'handle')61 self.assertEqual(assoc.handle, 'handle')
62 self.assertEquals(assoc.secret, 'secret')62 self.assertEqual(assoc.secret, 'secret')
63 self.assertEquals(assoc.issued, timestamp)63 self.assertEqual(assoc.issued, timestamp)
64 self.assertEquals(assoc.lifetime, 600)64 self.assertEqual(assoc.lifetime, 600)
65 self.assertEquals(assoc.assoc_type, 'HMAC-SHA1')65 self.assertEqual(assoc.assoc_type, 'HMAC-SHA1')
6666
67 def test_getAssociation_unknown(self):67 def test_getAssociation_unknown(self):
68 assoc = self.store.getAssociation('server-url', 'unknown')68 assoc = self.store.getAssociation('server-url', 'unknown')
69 self.assertEquals(assoc, None)69 self.assertEqual(assoc, None)
7070
71 def test_getAssociation_expired(self):71 def test_getAssociation_expired(self):
72 lifetime = 60072 lifetime = 600
@@ -76,7 +76,7 @@
76 # The association is not returned because it is out of date.76 # The association is not returned because it is out of date.
77 # Further more, it is removed from the database.77 # Further more, it is removed from the database.
78 assoc = self.store.getAssociation('server-url', 'handle')78 assoc = self.store.getAssociation('server-url', 'handle')
79 self.assertEquals(assoc, None)79 self.assertEqual(assoc, None)
8080
81 store = IMasterStore(self.store.Association)81 store = IMasterStore(self.store.Association)
82 db_assoc = store.get(82 db_assoc = store.get(
@@ -99,13 +99,13 @@
99 timestamp = int(time.time())99 timestamp = int(time.time())
100 self.store.storeAssociation('server-url', Association(100 self.store.storeAssociation('server-url', Association(
101 'handle', 'secret', timestamp, 600, 'HMAC-SHA1'))101 'handle', 'secret', timestamp, 600, 'HMAC-SHA1'))
102 self.assertEquals(102 self.assertEqual(
103 self.store.removeAssociation('server-url', 'handle'), True)103 self.store.removeAssociation('server-url', 'handle'), True)
104 self.assertEquals(104 self.assertEqual(
105 self.store.getAssociation('server-url', 'handle'), None)105 self.store.getAssociation('server-url', 'handle'), None)
106106
107 def test_removeAssociation_unknown(self):107 def test_removeAssociation_unknown(self):
108 self.assertEquals(108 self.assertEqual(
109 self.store.removeAssociation('server-url', 'unknown'),109 self.store.removeAssociation('server-url', 'unknown'),
110 False)110 False)
111111
@@ -141,7 +141,7 @@
141 self.store.storeAssociation('server-url', Association(141 self.store.storeAssociation('server-url', Association(
142 'handle2', 'secret', timestamp, 200, 'HMAC-SHA1'))142 'handle2', 'secret', timestamp, 200, 'HMAC-SHA1'))
143143
144 self.assertEquals(self.store.cleanupAssociations(), 1)144 self.assertEqual(self.store.cleanupAssociations(), 1)
145145
146 # The second (non-expired) association is left behind.146 # The second (non-expired) association is left behind.
147 self.assertNotEqual(147 self.assertNotEqual(
148148
=== modified file 'lib/lp/services/profile/tests.py'
--- lib/lp/services/profile/tests.py 2013-04-10 09:12:32 +0000
+++ lib/lp/services/profile/tests.py 2018-01-02 16:24:23 +0000
@@ -209,7 +209,7 @@
209 self.pushProfilingConfig(profiling_allowed='True')209 self.pushProfilingConfig(profiling_allowed='True')
210 profile.start_request(self._get_start_event('/++profile++show/'))210 profile.start_request(self._get_start_event('/++profile++show/'))
211 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)211 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
212 self.assertEquals(set(profile._profilers.actions), set(('show', )))212 self.assertEqual(set(profile._profilers.actions), set(('show', )))
213213
214 def test_optional_profiling_with_callgrind_request_starts_profiling(self):214 def test_optional_profiling_with_callgrind_request_starts_profiling(self):
215 # If profiling is allowed and a request with the "callgrind" marker215 # If profiling is allowed and a request with the "callgrind" marker
@@ -217,7 +217,7 @@
217 self.pushProfilingConfig(profiling_allowed='True')217 self.pushProfilingConfig(profiling_allowed='True')
218 profile.start_request(self._get_start_event('/++profile++callgrind/'))218 profile.start_request(self._get_start_event('/++profile++callgrind/'))
219 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)219 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
220 self.assertEquals(220 self.assertEqual(
221 set(profile._profilers.actions), set(('callgrind', )))221 set(profile._profilers.actions), set(('callgrind', )))
222222
223 def test_optional_profiling_with_log_request_starts_profiling(self):223 def test_optional_profiling_with_log_request_starts_profiling(self):
@@ -226,7 +226,7 @@
226 self.pushProfilingConfig(profiling_allowed='True')226 self.pushProfilingConfig(profiling_allowed='True')
227 profile.start_request(self._get_start_event('/++profile++log/'))227 profile.start_request(self._get_start_event('/++profile++log/'))
228 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)228 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
229 self.assertEquals(229 self.assertEqual(
230 set(profile._profilers.actions), set(('callgrind', )))230 set(profile._profilers.actions), set(('callgrind', )))
231231
232 def test_optional_profiling_with_combined_request_starts_profiling(self):232 def test_optional_profiling_with_combined_request_starts_profiling(self):
@@ -236,7 +236,7 @@
236 profile.start_request(236 profile.start_request(
237 self._get_start_event('/++profile++callgrind&show/'))237 self._get_start_event('/++profile++callgrind&show/'))
238 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)238 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
239 self.assertEquals(239 self.assertEqual(
240 set(profile._profilers.actions), set(('callgrind', 'show')))240 set(profile._profilers.actions), set(('callgrind', 'show')))
241241
242 def test_optional_profiling_with_reversed_request_starts_profiling(self):242 def test_optional_profiling_with_reversed_request_starts_profiling(self):
@@ -249,7 +249,7 @@
249 profile.start_request(249 profile.start_request(
250 self._get_start_event('/++profile++show&callgrind'))250 self._get_start_event('/++profile++show&callgrind'))
251 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)251 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
252 self.assertEquals(252 self.assertEqual(
253 set(profile._profilers.actions), set(('callgrind', 'show')))253 set(profile._profilers.actions), set(('callgrind', 'show')))
254254
255 def test_optional_profiling_with_pstats_request_starts_profiling(self):255 def test_optional_profiling_with_pstats_request_starts_profiling(self):
@@ -260,7 +260,7 @@
260 self._get_start_event('/++profile++pstats/'))260 self._get_start_event('/++profile++pstats/'))
261 self.assertIsInstance(profile._profilers.profiler,261 self.assertIsInstance(profile._profilers.profiler,
262 profile.Profiler)262 profile.Profiler)
263 self.assertEquals(set(profile._profilers.actions), set(('pstats',)))263 self.assertEqual(set(profile._profilers.actions), set(('pstats',)))
264264
265 def test_optional_profiling_with_log_pstats(self):265 def test_optional_profiling_with_log_pstats(self):
266 # If profiling is allowed and a request with the "log" and "pstats"266 # If profiling is allowed and a request with the "log" and "pstats"
@@ -270,7 +270,7 @@
270 profile.start_request(270 profile.start_request(
271 self._get_start_event('/++profile++log&pstats/'))271 self._get_start_event('/++profile++log&pstats/'))
272 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)272 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
273 self.assertEquals(273 self.assertEqual(
274 set(profile._profilers.actions), set(('callgrind', 'pstats',)))274 set(profile._profilers.actions), set(('callgrind', 'pstats',)))
275275
276 def test_optional_profiling_with_callgrind_pstats(self):276 def test_optional_profiling_with_callgrind_pstats(self):
@@ -282,7 +282,7 @@
282 self._get_start_event('/++profile++pstats&callgrind/'))282 self._get_start_event('/++profile++pstats&callgrind/'))
283 self.assertIsInstance(profile._profilers.profiler,283 self.assertIsInstance(profile._profilers.profiler,
284 profile.Profiler)284 profile.Profiler)
285 self.assertEquals(285 self.assertEqual(
286 set(profile._profilers.actions), set(('pstats', 'callgrind')))286 set(profile._profilers.actions), set(('pstats', 'callgrind')))
287287
288 def test_forced_profiling_registers_action(self):288 def test_forced_profiling_registers_action(self):
@@ -291,7 +291,7 @@
291 profiling_allowed='True', profile_all_requests='True')291 profiling_allowed='True', profile_all_requests='True')
292 profile.start_request(self._get_start_event('/'))292 profile.start_request(self._get_start_event('/'))
293 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)293 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
294 self.assertEquals(294 self.assertEqual(
295 set(profile._profilers.actions), set(('callgrind', )))295 set(profile._profilers.actions), set(('callgrind', )))
296296
297 def test_optional_profiling_with_wrong_request_helps(self):297 def test_optional_profiling_with_wrong_request_helps(self):
@@ -300,7 +300,7 @@
300 self.pushProfilingConfig(profiling_allowed='True')300 self.pushProfilingConfig(profiling_allowed='True')
301 profile.start_request(self._get_start_event('/++profile++/'))301 profile.start_request(self._get_start_event('/++profile++/'))
302 self.assertIs(getattr(profile._profilers, 'profiler', None), None)302 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
303 self.assertEquals(set(profile._profilers.actions), set(('help', )))303 self.assertEqual(set(profile._profilers.actions), set(('help', )))
304304
305 def test_forced_profiling_with_wrong_request_helps(self):305 def test_forced_profiling_with_wrong_request_helps(self):
306 # If profiling is forced and a request with the marker URL segment306 # If profiling is forced and a request with the marker URL segment
@@ -309,7 +309,7 @@
309 profiling_allowed='True', profile_all_requests='True')309 profiling_allowed='True', profile_all_requests='True')
310 profile.start_request(self._get_start_event('/++profile++/'))310 profile.start_request(self._get_start_event('/++profile++/'))
311 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)311 self.assertIsInstance(profile._profilers.profiler, profile.Profiler)
312 self.assertEquals(312 self.assertEqual(
313 set(profile._profilers.actions), set(('help', 'callgrind')))313 set(profile._profilers.actions), set(('help', 'callgrind')))
314314
315 def test_memory_profile_start(self):315 def test_memory_profile_start(self):
@@ -336,14 +336,14 @@
336 self.pushProfilingConfig(profiling_allowed='True')336 self.pushProfilingConfig(profiling_allowed='True')
337 profile.start_request(self._get_start_event('/++profile++sqltrace/'))337 profile.start_request(self._get_start_event('/++profile++sqltrace/'))
338 self.assertIs(getattr(profile._profilers, 'profiler', None), None)338 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
339 self.assertEquals(profile._profilers.actions, dict(sql=True))339 self.assertEqual(profile._profilers.actions, dict(sql=True))
340 self.assertEqual([], da.stop_sql_logging())340 self.assertEqual([], da.stop_sql_logging())
341341
342 def test_sql_start(self):342 def test_sql_start(self):
343 self.pushProfilingConfig(profiling_allowed='True')343 self.pushProfilingConfig(profiling_allowed='True')
344 profile.start_request(self._get_start_event('/++profile++sql/'))344 profile.start_request(self._get_start_event('/++profile++sql/'))
345 self.assertIs(getattr(profile._profilers, 'profiler', None), None)345 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
346 self.assertEquals(profile._profilers.actions, dict(sql=False))346 self.assertEqual(profile._profilers.actions, dict(sql=False))
347 self.assertEqual([], da.stop_sql_logging())347 self.assertEqual([], da.stop_sql_logging())
348348
349 def test_sqltrace_filtered_start(self):349 def test_sqltrace_filtered_start(self):
@@ -351,7 +351,7 @@
351 profile.start_request(self._get_start_event(351 profile.start_request(self._get_start_event(
352 '/++profile++sqltrace:includes bugsubscription/'))352 '/++profile++sqltrace:includes bugsubscription/'))
353 self.assertIs(getattr(profile._profilers, 'profiler', None), None)353 self.assertIs(getattr(profile._profilers, 'profiler', None), None)
354 self.assertEquals(set(profile._profilers.actions), set(('sql', )))354 self.assertEqual(set(profile._profilers.actions), set(('sql', )))
355 data = profile._profilers.actions['sql']355 data = profile._profilers.actions['sql']
356 self.assertTrue(data['condition']('SELECT BUGSUBSCRIPTION FROM FOO'))356 self.assertTrue(data['condition']('SELECT BUGSUBSCRIPTION FROM FOO'))
357 self.assertEqual([], da.stop_sql_logging())357 self.assertEqual([], da.stop_sql_logging())
@@ -665,7 +665,7 @@
665 self.pushProfilingConfig(profiling_allowed='True')665 self.pushProfilingConfig(profiling_allowed='True')
666 request = self.endRequest('/++profile++show/no-such-file',666 request = self.endRequest('/++profile++show/no-such-file',
667 KeyError('foo'))667 KeyError('foo'))
668 self.assertEquals(request.oops['type'], 'KeyError')668 self.assertEqual(request.oops['type'], 'KeyError')
669 response = self.getAddedResponse(request)669 response = self.getAddedResponse(request)
670 self.assertIn('Exception-Type: KeyError', response)670 self.assertIn('Exception-Type: KeyError', response)
671 self.assertCleanProfilerState()671 self.assertCleanProfilerState()
@@ -696,7 +696,7 @@
696 self.assertTrue(profile._profilers.profiling)696 self.assertTrue(profile._profilers.profiling)
697 self.assertIsInstance(697 self.assertIsInstance(
698 profile._profilers.profiler, profile.Profiler)698 profile._profilers.profiler, profile.Profiler)
699 self.assertEquals(699 self.assertEqual(
700 set(('show', 'callgrind', 'memory_profile_start')),700 set(('show', 'callgrind', 'memory_profile_start')),
701 set(profile._profilers.actions))701 set(profile._profilers.actions))
702702
703703
=== modified file 'lib/lp/services/session/tests/test_session.py'
--- lib/lp/services/session/tests/test_session.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/session/tests/test_session.py 2018-01-02 16:24:23 +0000
@@ -26,7 +26,7 @@
26 for cls in [SessionData, SessionPkgData]:26 for cls in [SessionData, SessionPkgData]:
27 for obj in [cls, cls()]:27 for obj in [cls, cls()]:
28 store = adapter(obj)28 store = adapter(obj)
29 self.assert_(29 self.assertTrue(
30 'session' in store.get_database()._dsn,30 'session' in store.get_database()._dsn,
31 'Unknown store returned adapting %r to %r'31 'Unknown store returned adapting %r to %r'
32 % (obj, adapter))32 % (obj, adapter))
3333
=== modified file 'lib/lp/services/tests/test_utils.py'
--- lib/lp/services/tests/test_utils.py 2014-08-29 01:34:04 +0000
+++ lib/lp/services/tests/test_utils.py 2018-01-02 16:24:23 +0000
@@ -200,7 +200,7 @@
200 def function():200 def function():
201 pass201 pass
202 function()202 function()
203 self.assertEquals(['before', 'after'], calls)203 self.assertEqual(['before', 'after'], calls)
204204
205 def test_decorate_with_function(self):205 def test_decorate_with_function(self):
206 # The original function is actually called when we call the result of206 # The original function is actually called when we call the result of
@@ -211,7 +211,7 @@
211 def function():211 def function():
212 calls.append('foo')212 calls.append('foo')
213 function()213 function()
214 self.assertEquals(['foo'], calls)214 self.assertEqual(['foo'], calls)
215215
216 def test_decorate_with_call_twice(self):216 def test_decorate_with_call_twice(self):
217 # A function decorated with decorate_with can be called twice.217 # A function decorated with decorate_with can be called twice.
@@ -222,7 +222,7 @@
222 calls.append('foo')222 calls.append('foo')
223 function()223 function()
224 function()224 function()
225 self.assertEquals(['foo', 'foo'], calls)225 self.assertEqual(['foo', 'foo'], calls)
226226
227 def test_decorate_with_arguments(self):227 def test_decorate_with_arguments(self):
228 # decorate_with passes through arguments.228 # decorate_with passes through arguments.
@@ -232,7 +232,7 @@
232 def function(*args, **kwargs):232 def function(*args, **kwargs):
233 calls.append((args, kwargs))233 calls.append((args, kwargs))
234 function('foo', 'bar', qux=4)234 function('foo', 'bar', qux=4)
235 self.assertEquals([(('foo', 'bar'), {'qux': 4})], calls)235 self.assertEqual([(('foo', 'bar'), {'qux': 4})], calls)
236236
237 def test_decorate_with_name_and_docstring(self):237 def test_decorate_with_name_and_docstring(self):
238 # decorate_with preserves function names and docstrings.238 # decorate_with preserves function names and docstrings.
239239
=== modified file 'lib/lp/services/twistedsupport/tests/test_processmonitor.py'
--- lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 10:54:31 +0000
+++ lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 16:24:23 +0000
@@ -370,7 +370,7 @@
370 d = run_process_with_timeout(('true',))370 d = run_process_with_timeout(('true',))
371371
372 def check_success_result(result):372 def check_success_result(result):
373 self.assertEquals(result, None, "Success result is not None.")373 self.assertEqual(result, None, "Success result is not None.")
374374
375 d.addCallback(check_success_result)375 d.addCallback(check_success_result)
376 return d376 return d
377377
=== modified file 'lib/lp/services/verification/browser/tests/test_logintoken.py'
--- lib/lp/services/verification/browser/tests/test_logintoken.py 2016-11-03 15:07:36 +0000
+++ lib/lp/services/verification/browser/tests/test_logintoken.py 2018-01-02 16:24:23 +0000
@@ -70,9 +70,9 @@
70 harness.submit('cancel', {})70 harness.submit('cancel', {})
71 actions = harness.view.actions.byname71 actions = harness.view.actions.byname
72 self.assertIn('field.actions.cancel', actions)72 self.assertIn('field.actions.cancel', actions)
73 self.assertEquals(actions['field.actions.cancel'].submitted(), True)73 self.assertEqual(actions['field.actions.cancel'].submitted(), True)
74 self.assertEquals(harness.view.errors, [])74 self.assertEqual(harness.view.errors, [])
75 self.assertEquals(harness.view.next_url, self.expected_next_url)75 self.assertEqual(harness.view.next_url, self.expected_next_url)
7676
7777
78class TestClaimTeamView(TestCaseWithFactory):78class TestClaimTeamView(TestCaseWithFactory):
@@ -101,9 +101,9 @@
101 requester=self.claimer, requesteremail=None,101 requester=self.claimer, requesteremail=None,
102 email=self.claimee_email, tokentype=LoginTokenType.TEAMCLAIM)102 email=self.claimee_email, tokentype=LoginTokenType.TEAMCLAIM)
103 msgs = self._claimToken(token1)103 msgs = self._claimToken(token1)
104 self.assertEquals([u'Team claimed successfully'], msgs)104 self.assertEqual([u'Team claimed successfully'], msgs)
105 msgs = self._claimToken(token2)105 msgs = self._claimToken(token2)
106 self.assertEquals(106 self.assertEqual(
107 [u'claimee has already been converted to a team.'], msgs)107 [u'claimee has already been converted to a team.'], msgs)
108108
109109
110110
=== modified file 'lib/lp/services/verification/tests/test_token_creation.py'
--- lib/lp/services/verification/tests/test_token_creation.py 2014-09-01 10:20:01 +0000
+++ lib/lp/services/verification/tests/test_token_creation.py 2018-01-02 16:24:23 +0000
@@ -12,4 +12,4 @@
1212
13 def test_length(self):13 def test_length(self):
14 token = create_token(99)14 token = create_token(99)
15 self.assertEquals(len(token), 99)15 self.assertEqual(len(token), 99)
1616
=== modified file 'lib/lp/services/webapp/tests/test_authentication.py'
--- lib/lp/services/webapp/tests/test_authentication.py 2014-06-27 07:58:42 +0000
+++ lib/lp/services/webapp/tests/test_authentication.py 2018-01-02 16:24:23 +0000
@@ -38,15 +38,15 @@
38 # included in the OAuth calculations.38 # included in the OAuth calculations.
39 headers = OAuthRequest._split_header(39 headers = OAuthRequest._split_header(
40 'OAuth realm="foo", oauth_consumer_key="justtesting"')40 'OAuth realm="foo", oauth_consumer_key="justtesting"')
41 self.assertEquals(headers,41 self.assertEqual(headers,
42 {'oauth_consumer_key': 'justtesting'})42 {'oauth_consumer_key': 'justtesting'})
43 headers = OAuthRequest._split_header(43 headers = OAuthRequest._split_header(
44 'OAuth oauth_consumer_key="justtesting"')44 'OAuth oauth_consumer_key="justtesting"')
45 self.assertEquals(headers,45 self.assertEqual(headers,
46 {'oauth_consumer_key': 'justtesting'})46 {'oauth_consumer_key': 'justtesting'})
47 headers = OAuthRequest._split_header(47 headers = OAuthRequest._split_header(
48 'OAuth oauth_consumer_key="justtesting", realm="realm"')48 'OAuth oauth_consumer_key="justtesting", realm="realm"')
49 self.assertEquals(headers,49 self.assertEqual(headers,
50 {'oauth_consumer_key': 'justtesting'})50 {'oauth_consumer_key': 'justtesting'})
5151
5252
5353
=== modified file 'lib/lp/services/webapp/tests/test_authutility.py'
--- lib/lp/services/webapp/tests/test_authutility.py 2016-09-21 02:50:41 +0000
+++ lib/lp/services/webapp/tests/test_authutility.py 2018-01-02 16:24:23 +0000
@@ -91,8 +91,8 @@
9191
92 def test_unauthenticatedPrincipal(self):92 def test_unauthenticatedPrincipal(self):
93 authsvc, request = self._make(None, None)93 authsvc, request = self._make(None, None)
94 self.assert_(isinstance(authsvc.unauthenticatedPrincipal(),94 self.assertTrue(isinstance(authsvc.unauthenticatedPrincipal(),
95 UnauthenticatedPrincipal))95 UnauthenticatedPrincipal))
9696
97 def test_unauthorized(self):97 def test_unauthorized(self):
98 authsvc, request = self._make('bruce', 'test')98 authsvc, request = self._make('bruce', 'test')
@@ -127,7 +127,7 @@
127 exception = self.assertRaises(127 exception = self.assertRaises(
128 AssertionError, authsvc._authenticateUsingBasicAuth,128 AssertionError, authsvc._authenticateUsingBasicAuth,
129 credentials, request)129 credentials, request)
130 self.assertEquals(130 self.assertEqual(
131 "Attempted to use basic auth when it is disabled",131 "Attempted to use basic auth when it is disabled",
132 str(exception))132 str(exception))
133 finally:133 finally:
134134
=== modified file 'lib/lp/services/webapp/tests/test_batching.py'
--- lib/lp/services/webapp/tests/test_batching.py 2016-02-05 16:51:12 +0000
+++ lib/lp/services/webapp/tests/test_batching.py 2018-01-02 16:24:23 +0000
@@ -459,7 +459,7 @@
459 resultset = self.makeStormResultSet()459 resultset = self.makeStormResultSet()
460 range_factory = StormRangeFactory(resultset, self.logError)460 range_factory = StormRangeFactory(resultset, self.logError)
461 [where_clause] = range_factory.whereExpressions([Person.id], [1])461 [where_clause] = range_factory.whereExpressions([Person.id], [1])
462 self.assertEquals('(Person.id) > (1)', compile(where_clause))462 self.assertEqual('(Person.id) > (1)', compile(where_clause))
463463
464 def test_whereExpressions_desc(self):464 def test_whereExpressions_desc(self):
465 """For descending sort order, whereExpressions() returns the465 """For descending sort order, whereExpressions() returns the
@@ -469,7 +469,7 @@
469 range_factory = StormRangeFactory(resultset, self.logError)469 range_factory = StormRangeFactory(resultset, self.logError)
470 [where_clause] = range_factory.whereExpressions(470 [where_clause] = range_factory.whereExpressions(
471 [Desc(Person.id)], [1])471 [Desc(Person.id)], [1])
472 self.assertEquals('(Person.id) < (1)', compile(where_clause))472 self.assertEqual('(Person.id) < (1)', compile(where_clause))
473473
474 def test_whereExpressions__two_sort_columns_asc_asc(self):474 def test_whereExpressions__two_sort_columns_asc_asc(self):
475 """If the ascending sort columns c1, c2 and the memo values475 """If the ascending sort columns c1, c2 and the memo values
@@ -483,7 +483,7 @@
483 range_factory = StormRangeFactory(resultset, self.logError)483 range_factory = StormRangeFactory(resultset, self.logError)
484 [where_clause] = range_factory.whereExpressions(484 [where_clause] = range_factory.whereExpressions(
485 [Person.id, Person.name], [1, 'foo'])485 [Person.id, Person.name], [1, 'foo'])
486 self.assertEquals(486 self.assertEqual(
487 "(Person.id, Person.name) > (1, E'foo')", compile(where_clause))487 "(Person.id, Person.name) > (1, E'foo')", compile(where_clause))
488488
489 def test_whereExpressions__two_sort_columns_desc_desc(self):489 def test_whereExpressions__two_sort_columns_desc_desc(self):
@@ -498,7 +498,7 @@
498 range_factory = StormRangeFactory(resultset, self.logError)498 range_factory = StormRangeFactory(resultset, self.logError)
499 [where_clause] = range_factory.whereExpressions(499 [where_clause] = range_factory.whereExpressions(
500 [Desc(Person.id), Desc(Person.name)], [1, 'foo'])500 [Desc(Person.id), Desc(Person.name)], [1, 'foo'])
501 self.assertEquals(501 self.assertEqual(
502 "(Person.id, Person.name) < (1, E'foo')", compile(where_clause))502 "(Person.id, Person.name) < (1, E'foo')", compile(where_clause))
503503
504 def test_whereExpressions__two_sort_columns_asc_desc(self):504 def test_whereExpressions__two_sort_columns_asc_desc(self):
@@ -516,10 +516,10 @@
516 range_factory = StormRangeFactory(resultset, self.logError)516 range_factory = StormRangeFactory(resultset, self.logError)
517 [where_clause_1, where_clause_2] = range_factory.whereExpressions(517 [where_clause_1, where_clause_2] = range_factory.whereExpressions(
518 [Person.id, Desc(Person.name)], [1, 'foo'])518 [Person.id, Desc(Person.name)], [1, 'foo'])
519 self.assertEquals(519 self.assertEqual(
520 "Person.id = ? AND ((Person.name) < (E'foo'))",520 "Person.id = ? AND ((Person.name) < (E'foo'))",
521 compile(where_clause_1))521 compile(where_clause_1))
522 self.assertEquals('(Person.id) > (1)', compile(where_clause_2))522 self.assertEqual('(Person.id) > (1)', compile(where_clause_2))
523523
524 def test_getSlice__forward_without_memo(self):524 def test_getSlice__forward_without_memo(self):
525 resultset = self.makeStormResultSet()525 resultset = self.makeStormResultSet()
526526
=== modified file 'lib/lp/services/webapp/tests/test_breadcrumbs.py'
--- lib/lp/services/webapp/tests/test_breadcrumbs.py 2015-08-04 11:17:11 +0000
+++ lib/lp/services/webapp/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000
@@ -67,14 +67,14 @@
67 # Breadcrumb adapter will use 'mainsite' as the rootsite.67 # Breadcrumb adapter will use 'mainsite' as the rootsite.
68 cookbook = Cookbook()68 cookbook = Cookbook()
69 self.assertIs(cookbook.rootsite, None)69 self.assertIs(cookbook.rootsite, None)
70 self.assertEquals(Breadcrumb(cookbook).rootsite, 'mainsite')70 self.assertEqual(Breadcrumb(cookbook).rootsite, 'mainsite')
7171
72 def test_urldata_rootsite_is_honored(self):72 def test_urldata_rootsite_is_honored(self):
73 # When a class' ICanonicalUrlData defines a rootsite, our Breadcrumb73 # When a class' ICanonicalUrlData defines a rootsite, our Breadcrumb
74 # adapter will use it.74 # adapter will use it.
75 cookbook = Cookbook()75 cookbook = Cookbook()
76 cookbook.rootsite = 'cooking'76 cookbook.rootsite = 'cooking'
77 self.assertEquals(Breadcrumb(cookbook).rootsite, 'cooking')77 self.assertEqual(Breadcrumb(cookbook).rootsite, 'cooking')
7878
7979
80class TestExtraBreadcrumbForLeafPageOnHierarchyView(BaseBreadcrumbTestCase):80class TestExtraBreadcrumbForLeafPageOnHierarchyView(BaseBreadcrumbTestCase):
@@ -94,20 +94,20 @@
94 def test_non_default_page(self):94 def test_non_default_page(self):
95 crumbs = self.getBreadcrumbsForObject(self.product, '+download')95 crumbs = self.getBreadcrumbsForObject(self.product, '+download')
96 downloads_url = "%s/+download" % self.product_url96 downloads_url = "%s/+download" % self.product_url
97 self.assertEquals(97 self.assertEqual(
98 [self.product_url, downloads_url],98 [self.product_url, downloads_url],
99 [crumb.url for crumb in crumbs])99 [crumb.url for crumb in crumbs])
100 self.assertEquals(100 self.assertEqual(
101 '%s project files' % self.product.displayname,101 '%s project files' % self.product.displayname,
102 crumbs[-1].text)102 crumbs[-1].text)
103103
104 def test_facet_default_page(self):104 def test_facet_default_page(self):
105 crumbs = self.getBreadcrumbsForObject(self.product, '+bugs')105 crumbs = self.getBreadcrumbsForObject(self.product, '+bugs')
106 bugs_url = self.product_url.replace('launchpad', 'bugs.launchpad')106 bugs_url = self.product_url.replace('launchpad', 'bugs.launchpad')
107 self.assertEquals(107 self.assertEqual(
108 [self.product_url, bugs_url],108 [self.product_url, bugs_url],
109 [crumb.url for crumb in crumbs])109 [crumb.url for crumb in crumbs])
110 self.assertEquals('Bugs', crumbs[-1].text)110 self.assertEqual('Bugs', crumbs[-1].text)
111111
112 def test_zope_i18n_Messages_are_interpolated(self):112 def test_zope_i18n_Messages_are_interpolated(self):
113 # Views can use zope.i18nmessageid.Message as their title when they113 # Views can use zope.i18nmessageid.Message as their title when they
@@ -124,7 +124,7 @@
124 request.traversed_objects = [self.product, test_view]124 request.traversed_objects = [self.product, test_view]
125 hierarchy_view = Hierarchy(test_view, request)125 hierarchy_view = Hierarchy(test_view, request)
126 [breadcrumb] = hierarchy_view.makeBreadcrumbsForRequestedPage()126 [breadcrumb] = hierarchy_view.makeBreadcrumbsForRequestedPage()
127 self.assertEquals(breadcrumb.text, 'breadcrumb test')127 self.assertEqual(breadcrumb.text, 'breadcrumb test')
128128
129129
130class TestExtraFacetBreadcrumbsOnHierarchyView(BaseBreadcrumbTestCase):130class TestExtraFacetBreadcrumbsOnHierarchyView(BaseBreadcrumbTestCase):
@@ -151,14 +151,14 @@
151151
152 def test_root_on_mainsite(self):152 def test_root_on_mainsite(self):
153 crumbs = self.getBreadcrumbsForUrl('http://launchpad.dev/')153 crumbs = self.getBreadcrumbsForUrl('http://launchpad.dev/')
154 self.assertEquals(crumbs, [])154 self.assertEqual(crumbs, [])
155155
156 def test_product_on_mainsite(self):156 def test_product_on_mainsite(self):
157 self.assertBreadcrumbUrls([self.product_url], self.product)157 self.assertBreadcrumbUrls([self.product_url], self.product)
158158
159 def test_root_on_vhost(self):159 def test_root_on_vhost(self):
160 crumbs = self.getBreadcrumbsForUrl('http://bugs.launchpad.dev/')160 crumbs = self.getBreadcrumbsForUrl('http://bugs.launchpad.dev/')
161 self.assertEquals(crumbs, [])161 self.assertEqual(crumbs, [])
162162
163 def test_product_on_vhost(self):163 def test_product_on_vhost(self):
164 self.assertBreadcrumbUrls(164 self.assertBreadcrumbUrls(
165165
=== modified file 'lib/lp/services/webapp/tests/test_error.py'
--- lib/lp/services/webapp/tests/test_error.py 2017-01-13 13:35:31 +0000
+++ lib/lp/services/webapp/tests/test_error.py 2018-01-02 16:24:23 +0000
@@ -56,17 +56,16 @@
56 def test_without_oops_id(self):56 def test_without_oops_id(self):
57 request = LaunchpadTestRequest()57 request = LaunchpadTestRequest()
58 SystemErrorView(Exception(), request)58 SystemErrorView(Exception(), request)
59 self.assertEquals(500, request.response.getStatus())59 self.assertEqual(500, request.response.getStatus())
60 self.assertEquals(60 self.assertIsNone(
61 None,
62 request.response.getHeader('X-Lazr-OopsId', literal=True))61 request.response.getHeader('X-Lazr-OopsId', literal=True))
6362
64 def test_with_oops_id(self):63 def test_with_oops_id(self):
65 request = LaunchpadTestRequest()64 request = LaunchpadTestRequest()
66 request.oopsid = 'OOPS-1X1'65 request.oopsid = 'OOPS-1X1'
67 SystemErrorView(Exception(), request)66 SystemErrorView(Exception(), request)
68 self.assertEquals(500, request.response.getStatus())67 self.assertEqual(500, request.response.getStatus())
69 self.assertEquals(68 self.assertEqual(
70 'OOPS-1X1',69 'OOPS-1X1',
71 request.response.getHeader('X-Lazr-OopsId', literal=True))70 request.response.getHeader('X-Lazr-OopsId', literal=True))
7271
@@ -224,7 +223,7 @@
224 def test_disconnectionerror_view(self):223 def test_disconnectionerror_view(self):
225 request = LaunchpadTestRequest()224 request = LaunchpadTestRequest()
226 DisconnectionErrorView(DisconnectionError(), request)225 DisconnectionErrorView(DisconnectionError(), request)
227 self.assertEquals(503, request.response.getStatus())226 self.assertEqual(503, request.response.getStatus())
228227
229 def test_operationalerror_view_integration(self):228 def test_operationalerror_view_integration(self):
230 # Test setup.229 # Test setup.
@@ -246,4 +245,4 @@
246 def test_operationalerror_view(self):245 def test_operationalerror_view(self):
247 request = LaunchpadTestRequest()246 request = LaunchpadTestRequest()
248 OperationalErrorView(OperationalError(), request)247 OperationalErrorView(OperationalError(), request)
249 self.assertEquals(503, request.response.getStatus())248 self.assertEqual(503, request.response.getStatus())
250249
=== modified file 'lib/lp/services/webapp/tests/test_haproxy.py'
--- lib/lp/services/webapp/tests/test_haproxy.py 2012-09-28 06:01:02 +0000
+++ lib/lp/services/webapp/tests/test_haproxy.py 2018-01-02 16:24:23 +0000
@@ -32,7 +32,7 @@
3232
33 def test_HAProxyStatusView_all_good_returns_200(self):33 def test_HAProxyStatusView_all_good_returns_200(self):
34 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)34 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
35 self.assertEquals(200, result.getStatus())35 self.assertEqual(200, result.getStatus())
3636
37 def test_authenticated_HAProxyStatusView_works(self):37 def test_authenticated_HAProxyStatusView_works(self):
38 # We don't use authenticated requests, but this keeps us from38 # We don't use authenticated requests, but this keeps us from
@@ -41,12 +41,12 @@
41 u'GET /+haproxy HTTP/1.0\n'41 u'GET /+haproxy HTTP/1.0\n'
42 u'Authorization: Basic Zm9vLmJhckBjYW5vbmljYWwuY29tOnRlc3Q=\n',42 u'Authorization: Basic Zm9vLmJhckBjYW5vbmljYWwuY29tOnRlc3Q=\n',
43 handle_errors=False)43 handle_errors=False)
44 self.assertEquals(200, result.getStatus())44 self.assertEqual(200, result.getStatus())
4545
46 def test_HAProxyStatusView_going_down_returns_500(self):46 def test_HAProxyStatusView_going_down_returns_500(self):
47 haproxy.set_going_down_flag(True)47 haproxy.set_going_down_flag(True)
48 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)48 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
49 self.assertEquals(500, result.getStatus())49 self.assertEqual(500, result.getStatus())
5050
51 def test_haproxy_url_uses_DatabaseBlocked_policy(self):51 def test_haproxy_url_uses_DatabaseBlocked_policy(self):
52 request = LaunchpadTestRequest(environ={'PATH_INFO': '/+haproxy'})52 request = LaunchpadTestRequest(environ={'PATH_INFO': '/+haproxy'})
@@ -56,9 +56,9 @@
56 def test_switch_going_down_flag(self):56 def test_switch_going_down_flag(self):
57 haproxy.set_going_down_flag(True)57 haproxy.set_going_down_flag(True)
58 haproxy.switch_going_down_flag()58 haproxy.switch_going_down_flag()
59 self.assertEquals(False, haproxy.going_down_flag)59 self.assertEqual(False, haproxy.going_down_flag)
60 haproxy.switch_going_down_flag()60 haproxy.switch_going_down_flag()
61 self.assertEquals(True, haproxy.going_down_flag)61 self.assertEqual(True, haproxy.going_down_flag)
6262
63 def test_HAProxyStatusView_status_code_is_configurable(self):63 def test_HAProxyStatusView_status_code_is_configurable(self):
64 config.push('change_haproxy_status_code', dedent('''64 config.push('change_haproxy_status_code', dedent('''
@@ -68,4 +68,4 @@
68 self.addCleanup(config.pop, 'change_haproxy_status_code')68 self.addCleanup(config.pop, 'change_haproxy_status_code')
69 haproxy.set_going_down_flag(True)69 haproxy.set_going_down_flag(True)
70 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)70 result = self.http(u'GET /+haproxy HTTP/1.0', handle_errors=False)
71 self.assertEquals(499, result.getStatus())71 self.assertEqual(499, result.getStatus())
7272
=== modified file 'lib/lp/services/webapp/tests/test_login.py'
--- lib/lp/services/webapp/tests/test_login.py 2016-05-27 09:57:43 +0000
+++ lib/lp/services/webapp/tests/test_login.py 2018-01-02 16:24:23 +0000
@@ -242,9 +242,9 @@
242 person.account, email=test_email)242 person.account, email=test_email)
243 self.assertTrue(view.login_called)243 self.assertTrue(view.login_called)
244 response = view.request.response244 response = view.request.response
245 self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())245 self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
246 self.assertEquals(view.request.form['starting_url'],246 self.assertEqual(view.request.form['starting_url'],
247 response.getHeader('Location'))247 response.getHeader('Location'))
248 # The 'last_write' flag was not updated (unlike in the other test248 # The 'last_write' flag was not updated (unlike in the other test
249 # methods) because in this case we didn't have to create a249 # methods) because in this case we didn't have to create a
250 # Person/Account entry, so it's ok for further requests to hit the250 # Person/Account entry, so it's ok for further requests to hit the
@@ -267,7 +267,7 @@
267 'starting_url': 'http://launchpad.dev/after-login',267 'starting_url': 'http://launchpad.dev/after-login',
268 'foo': 'bar',268 'foo': 'bar',
269 }269 }
270 self.assertEquals(params, expected_params)270 self.assertEqual(params, expected_params)
271271
272 def test_gather_params_with_unicode_data(self):272 def test_gather_params_with_unicode_data(self):
273 # If the currently requested URL includes a query string, the273 # If the currently requested URL includes a query string, the
@@ -281,7 +281,7 @@
281 environ={'PATH_INFO': '/'})281 environ={'PATH_INFO': '/'})
282 view = OpenIDCallbackView(context=None, request=None)282 view = OpenIDCallbackView(context=None, request=None)
283 params = view._gather_params(request)283 params = view._gather_params(request)
284 self.assertEquals(params['foo'], u'\u16dd')284 self.assertEqual(params['foo'], u'\u16dd')
285285
286 def test_unexpected_multivalue_fields(self):286 def test_unexpected_multivalue_fields(self):
287 # The parameter gatering doesn't expect to find multi-valued form287 # The parameter gatering doesn't expect to find multi-valued form
@@ -303,7 +303,7 @@
303 form={'starting_url': 'http://launchpad.dev/after-login'})303 form={'starting_url': 'http://launchpad.dev/after-login'})
304 view = OpenIDCallbackView(context=None, request=None)304 view = OpenIDCallbackView(context=None, request=None)
305 url = view._get_requested_url(request)305 url = view._get_requested_url(request)
306 self.assertEquals(url, 'http://example.com?foo=bar')306 self.assertEqual(url, 'http://example.com?foo=bar')
307307
308 def test_open_id_callback_handles_query_string(self):308 def test_open_id_callback_handles_query_string(self):
309 # If the currently requested URL includes a query string, the309 # If the currently requested URL includes a query string, the
@@ -317,13 +317,13 @@
317 environ={'PATH_INFO': '/'})317 environ={'PATH_INFO': '/'})
318 view = FakeConsumerOpenIDCallbackView(object(), request)318 view = FakeConsumerOpenIDCallbackView(object(), request)
319 view.initialize()319 view.initialize()
320 self.assertEquals(320 self.assertEqual(
321 view.fake_consumer.params,321 view.fake_consumer.params,
322 {322 {
323 'starting_url': 'http://launchpad.dev/after-login',323 'starting_url': 'http://launchpad.dev/after-login',
324 'foo': 'bar',324 'foo': 'bar',
325 })325 })
326 self.assertEquals(326 self.assertEqual(
327 view.fake_consumer.requested_url, 'http://example.com?foo=bar')327 view.fake_consumer.requested_url, 'http://example.com?foo=bar')
328328
329 def test_unseen_identity(self):329 def test_unseen_identity(self):
@@ -343,12 +343,12 @@
343 self.assertTrue(view.login_called)343 self.assertTrue(view.login_called)
344 account = account_set.getByOpenIDIdentifier(identifier)344 account = account_set.getByOpenIDIdentifier(identifier)
345 self.assertIsNot(None, account)345 self.assertIsNot(None, account)
346 self.assertEquals(AccountStatus.ACTIVE, account.status)346 self.assertEqual(AccountStatus.ACTIVE, account.status)
347 person = IPerson(account, None)347 person = IPerson(account, None)
348 self.assertIsNot(None, person)348 self.assertIsNot(None, person)
349 self.assertEquals('Foo User', person.displayname)349 self.assertEqual('Foo User', person.displayname)
350 self.assertEquals('non-existent@example.com',350 self.assertEqual('non-existent@example.com',
351 removeSecurityProxy(person.preferredemail).email)351 removeSecurityProxy(person.preferredemail).email)
352352
353 # We also update the last_write flag in the session, to make sure353 # We also update the last_write flag in the session, to make sure
354 # further requests use the master DB and thus see the newly created354 # further requests use the master DB and thus see the newly created
@@ -382,12 +382,12 @@
382 identifiers = [i.identifier for i in account.openid_identifiers]382 identifiers = [i.identifier for i in account.openid_identifiers]
383 self.assertIn(identifier, identifiers)383 self.assertIn(identifier, identifiers)
384384
385 self.assertEquals(AccountStatus.ACTIVE, account.status)385 self.assertEqual(AccountStatus.ACTIVE, account.status)
386 self.assertEquals(386 self.assertEqual(
387 email, removeSecurityProxy(person.preferredemail).email)387 email, removeSecurityProxy(person.preferredemail).email)
388 person = IPerson(account, None)388 person = IPerson(account, None)
389 self.assertIsNot(None, person)389 self.assertIsNot(None, person)
390 self.assertEquals('Test account', person.displayname)390 self.assertEqual('Test account', person.displayname)
391391
392 # We also update the last_write flag in the session, to make sure392 # We also update the last_write flag in the session, to make sure
393 # further requests use the master DB and thus see the newly created393 # further requests use the master DB and thus see the newly created
@@ -411,11 +411,11 @@
411 view, html = self._createAndRenderView(openid_response)411 view, html = self._createAndRenderView(openid_response)
412 self.assertTrue(view.login_called)412 self.assertTrue(view.login_called)
413 response = view.request.response413 response = view.request.response
414 self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())414 self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
415 self.assertEquals(view.request.form['starting_url'],415 self.assertEqual(view.request.form['starting_url'],
416 response.getHeader('Location'))416 response.getHeader('Location'))
417 self.assertEquals(AccountStatus.ACTIVE, person.account.status)417 self.assertEqual(AccountStatus.ACTIVE, person.account.status)
418 self.assertEquals(email, person.preferredemail.email)418 self.assertEqual(email, person.preferredemail.email)
419 # We also update the last_write flag in the session, to make sure419 # We also update the last_write flag in the session, to make sure
420 # further requests use the master DB and thus see the newly created420 # further requests use the master DB and thus see the newly created
421 # stuff.421 # stuff.
@@ -440,8 +440,8 @@
440 with SRegResponse_fromSuccessResponse_stubbed():440 with SRegResponse_fromSuccessResponse_stubbed():
441 view, html = self._createAndRenderView(openid_response)441 view, html = self._createAndRenderView(openid_response)
442 self.assertTrue(view.login_called)442 self.assertTrue(view.login_called)
443 self.assertEquals(AccountStatus.ACTIVE, person.account.status)443 self.assertEqual(AccountStatus.ACTIVE, person.account.status)
444 self.assertEquals(email, person.preferredemail.email)444 self.assertEqual(email, person.preferredemail.email)
445 # We also update the last_write flag in the session, to make sure445 # We also update the last_write flag in the session, to make sure
446 # further requests use the master DB and thus see the newly created446 # further requests use the master DB and thus see the newly created
447 # stuff.447 # stuff.
@@ -579,9 +579,9 @@
579 view_class=StubbedOpenIDCallbackViewLoggedIn)579 view_class=StubbedOpenIDCallbackViewLoggedIn)
580 self.assertFalse(view.login_called)580 self.assertFalse(view.login_called)
581 response = view.request.response581 response = view.request.response
582 self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus())582 self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus())
583 self.assertEquals(view.request.form['starting_url'],583 self.assertEqual(view.request.form['starting_url'],
584 response.getHeader('Location'))584 response.getHeader('Location'))
585 notification_msg = view.request.response.notifications[0].message585 notification_msg = view.request.response.notifications[0].message
586 expected_msg = ('Your authentication failed but you were already '586 expected_msg = ('Your authentication failed but you were already '
587 'logged into Launchpad')587 'logged into Launchpad')
@@ -626,9 +626,9 @@
626 form={'starting_url': self.STARTING_URL})626 form={'starting_url': self.STARTING_URL})
627 view.initialize()627 view.initialize()
628 view._redirect()628 view._redirect()
629 self.assertEquals(629 self.assertEqual(
630 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())630 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
631 self.assertEquals(631 self.assertEqual(
632 view.request.response.getHeader('Location'), self.STARTING_URL)632 view.request.response.getHeader('Location'), self.STARTING_URL)
633633
634 def test_open_id_callback_redirect_from_post(self):634 def test_open_id_callback_redirect_from_post(self):
@@ -640,9 +640,9 @@
640 QUERY_STRING='starting_url=' + self.STARTING_URL)640 QUERY_STRING='starting_url=' + self.STARTING_URL)
641 view.initialize()641 view.initialize()
642 view._redirect()642 view._redirect()
643 self.assertEquals(643 self.assertEqual(
644 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())644 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
645 self.assertEquals(645 self.assertEqual(
646 view.request.response.getHeader('Location'), self.STARTING_URL)646 view.request.response.getHeader('Location'), self.STARTING_URL)
647647
648 def test_openid_callback_redirect_fallback(self):648 def test_openid_callback_redirect_fallback(self):
@@ -652,9 +652,9 @@
652 view.request = LaunchpadTestRequest(SERVER_URL=self.APPLICATION_URL)652 view.request = LaunchpadTestRequest(SERVER_URL=self.APPLICATION_URL)
653 view.initialize()653 view.initialize()
654 view._redirect()654 view._redirect()
655 self.assertEquals(655 self.assertEqual(
656 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())656 httplib.TEMPORARY_REDIRECT, view.request.response.getStatus())
657 self.assertEquals(657 self.assertEqual(
658 view.request.response.getHeader('Location'), self.APPLICATION_URL)658 view.request.response.getHeader('Location'), self.APPLICATION_URL)
659659
660660
@@ -694,7 +694,7 @@
694 self.assertIn('body onload', browser.contents)694 self.assertIn('body onload', browser.contents)
695 browser.getControl('Continue').click()695 browser.getControl('Continue').click()
696696
697 self.assertEquals('Login', browser.title)697 self.assertEqual('Login', browser.title)
698 fill_login_form_and_submit(browser, 'test@canonical.com')698 fill_login_form_and_submit(browser, 'test@canonical.com')
699 login_status = extract_text(699 login_status = extract_text(
700 find_tag_by_id(browser.contents, 'logincontrol'))700 find_tag_by_id(browser.contents, 'logincontrol'))
@@ -710,10 +710,10 @@
710 replay_browser.open(callback_url)710 replay_browser.open(callback_url)
711 login_status = extract_text(711 login_status = extract_text(
712 find_tag_by_id(replay_browser.contents, 'logincontrol'))712 find_tag_by_id(replay_browser.contents, 'logincontrol'))
713 self.assertEquals('Log in / Register', login_status)713 self.assertEqual('Log in / Register', login_status)
714 error_msg = find_tags_by_class(replay_browser.contents, 'error')[0]714 error_msg = find_tags_by_class(replay_browser.contents, 'error')[0]
715 self.assertEquals('Nonce already used or out of range',715 self.assertEqual('Nonce already used or out of range',
716 extract_text(error_msg))716 extract_text(error_msg))
717717
718718
719class FakeHTTPResponse:719class FakeHTTPResponse:
@@ -743,8 +743,8 @@
743 browser = TestBrowser()743 browser = TestBrowser()
744 self.assertRaises(urllib2.HTTPError,744 self.assertRaises(urllib2.HTTPError,
745 browser.open, 'http://launchpad.dev/+login')745 browser.open, 'http://launchpad.dev/+login')
746 self.assertEquals('503 Service Unavailable',746 self.assertEqual('503 Service Unavailable',
747 browser.headers.get('status'))747 browser.headers.get('status'))
748 self.assertTrue(748 self.assertTrue(
749 'OpenID Provider Is Unavailable at This Time' in browser.contents)749 'OpenID Provider Is Unavailable at This Time' in browser.contents)
750750
@@ -845,10 +845,10 @@
845 self.assertIsNot(None, extensions)845 self.assertIsNot(None, extensions)
846 sreg_extension = extensions[0]846 sreg_extension = extensions[0]
847 self.assertIsInstance(sreg_extension, sreg.SRegRequest)847 self.assertIsInstance(sreg_extension, sreg.SRegRequest)
848 self.assertEquals(['email', 'fullname'],848 self.assertEqual(['email', 'fullname'],
849 sorted(sreg_extension.allRequestedFields()))849 sorted(sreg_extension.allRequestedFields()))
850 self.assertEquals(sorted(sreg_extension.required),850 self.assertEqual(sorted(sreg_extension.required),
851 sorted(sreg_extension.allRequestedFields()))851 sorted(sreg_extension.allRequestedFields()))
852852
853 def test_pape_extension_added_with_reauth_query(self):853 def test_pape_extension_added_with_reauth_query(self):
854 # We can signal that a request should be reauthenticated via854 # We can signal that a request should be reauthenticated via
@@ -928,8 +928,8 @@
928 # At this point browser.contents contains a hidden form which would've928 # At this point browser.contents contains a hidden form which would've
929 # been auto-submitted if we had in-browser JS support, but since we929 # been auto-submitted if we had in-browser JS support, but since we
930 # don't we can easily inspect what's in the form.930 # don't we can easily inspect what's in the form.
931 self.assertEquals('%s/' % browser.rooturl,931 self.assertEqual('%s/' % browser.rooturl,
932 browser.getControl(name='openid.realm').value)932 browser.getControl(name='openid.realm').value)
933933
934 def test_realm_for_vhosts(self):934 def test_realm_for_vhosts(self):
935 browser = Browser()935 browser = Browser()
@@ -937,9 +937,9 @@
937 # At this point browser.contents contains a hidden form which would've937 # At this point browser.contents contains a hidden form which would've
938 # been auto-submitted if we had in-browser JS support, but since we938 # been auto-submitted if we had in-browser JS support, but since we
939 # don't we can easily inspect what's in the form.939 # don't we can easily inspect what's in the form.
940 self.assertEquals('%s'940 self.assertEqual('%s'
941 % self.layer.appserver_root_url(ensureSlash=True),941 % self.layer.appserver_root_url(ensureSlash=True),
942 browser.getControl(name='openid.realm').value)942 browser.getControl(name='openid.realm').value)
943943
944944
945def test_suite():945def test_suite():
946946
=== modified file 'lib/lp/services/webapp/tests/test_login_account.py'
--- lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 10:54:31 +0000
+++ lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 16:24:23 +0000
@@ -119,23 +119,22 @@
119119
120 # The view should have redirected us, with no actual response body.120 # The view should have redirected us, with no actual response body.
121121
122 self.assertEquals(self.request.response.getStatus(), 302)122 self.assertEqual(self.request.response.getStatus(), 302)
123 self.assertEquals(result, '')123 self.assertEqual(result, '')
124124
125 # We are redirecting to Loggerhead, to ask it to logout.125 # We are redirecting to Loggerhead, to ask it to logout.
126126
127 location = lazr.uri.URI(self.request.response.getHeader('location'))127 location = lazr.uri.URI(self.request.response.getHeader('location'))
128 self.assertEquals(location.host, 'bazaar.launchpad.dev')128 self.assertEqual(location.host, 'bazaar.launchpad.dev')
129 self.assertEquals(location.scheme, 'https')129 self.assertEqual(location.scheme, 'https')
130 self.assertEquals(location.path, '/+logout')130 self.assertEqual(location.path, '/+logout')
131131
132 # That page should then redirect to our OpenId provider to logout,132 # That page should then redirect to our OpenId provider to logout,
133 # which we provide in our query string. See133 # which we provide in our query string. See
134 # launchpad_loggerhead.tests.TestLogout for the pertinent tests.134 # launchpad_loggerhead.tests.TestLogout for the pertinent tests.
135135
136 query = cgi.parse_qs(location.query)136 query = cgi.parse_qs(location.query)
137 self.assertEquals(137 self.assertEqual(query['next_to'][0], 'http://testopenid.dev/+logout')
138 query['next_to'][0], 'http://testopenid.dev/+logout')
139138
140 def test_logging_in_and_logging_out_the_old_way(self):139 def test_logging_in_and_logging_out_the_old_way(self):
141 # A test showing that we can authenticate a request that had the140 # A test showing that we can authenticate a request that had the
142141
=== modified file 'lib/lp/services/webapp/tests/test_menu.py'
--- lib/lp/services/webapp/tests/test_menu.py 2013-02-06 04:22:43 +0000
+++ lib/lp/services/webapp/tests/test_menu.py 2018-01-02 16:24:23 +0000
@@ -51,17 +51,17 @@
51 newInteraction()51 newInteraction()
52 menu = TestMenu(object())52 menu = TestMenu(object())
53 menu._get_link('test_link')53 menu._get_link('test_link')
54 self.assertEquals(menu.times_called, 1)54 self.assertEqual(menu.times_called, 1)
55 menu._get_link('test_link')55 menu._get_link('test_link')
56 self.assertEquals(menu.times_called, 2)56 self.assertEqual(menu.times_called, 2)
5757
58 def test_cache_when_there_is_a_request(self):58 def test_cache_when_there_is_a_request(self):
59 login(ANONYMOUS)59 login(ANONYMOUS)
60 menu = TestMenu(object())60 menu = TestMenu(object())
61 menu._get_link('test_link')61 menu._get_link('test_link')
62 self.assertEquals(menu.times_called, 1)62 self.assertEqual(menu.times_called, 1)
63 menu._get_link('test_link')63 menu._get_link('test_link')
64 self.assertEquals(menu.times_called, 1)64 self.assertEqual(menu.times_called, 1)
6565
66 def test_correct_value_is_cached(self):66 def test_correct_value_is_cached(self):
67 login(ANONYMOUS)67 login(ANONYMOUS)
@@ -69,7 +69,7 @@
69 link = menu._get_link('test_link')69 link = menu._get_link('test_link')
70 request = get_current_browser_request()70 request = get_current_browser_request()
71 cache = request.annotations.get(MENU_ANNOTATION_KEY)71 cache = request.annotations.get(MENU_ANNOTATION_KEY)
72 self.assertEquals([link], cache.values())72 self.assertEqual([link], cache.values())
7373
74 def test_cache_key_is_unique(self):74 def test_cache_key_is_unique(self):
The diff has been truncated for viewing.