Merge lp:~cjwatson/launchpad/deprecated-assert-methods-2 into lp:launchpad
- deprecated-assert-methods-2
- Merge into devel
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 |
Related bugs: |
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.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py' | |||
2 | --- lib/lp/answers/browser/tests/test_breadcrumbs.py 2017-10-25 10:02:12 +0000 | |||
3 | +++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000 | |||
4 | @@ -37,21 +37,21 @@ | |||
5 | 37 | crumbs = self.getBreadcrumbsForObject( | 37 | crumbs = self.getBreadcrumbsForObject( |
6 | 38 | self.product, rootsite='answers') | 38 | self.product, rootsite='answers') |
7 | 39 | last_crumb = crumbs[-1] | 39 | last_crumb = crumbs[-1] |
10 | 40 | self.assertEquals(last_crumb.url, self.product_questions_url) | 40 | self.assertEqual(last_crumb.url, self.product_questions_url) |
11 | 41 | self.assertEquals(last_crumb.text, 'Questions') | 41 | self.assertEqual(last_crumb.text, 'Questions') |
12 | 42 | 42 | ||
13 | 43 | def test_project(self): | 43 | def test_project(self): |
14 | 44 | crumbs = self.getBreadcrumbsForObject( | 44 | crumbs = self.getBreadcrumbsForObject( |
15 | 45 | self.project, rootsite='answers') | 45 | self.project, rootsite='answers') |
16 | 46 | last_crumb = crumbs[-1] | 46 | last_crumb = crumbs[-1] |
19 | 47 | self.assertEquals(last_crumb.url, self.project_questions_url) | 47 | self.assertEqual(last_crumb.url, self.project_questions_url) |
20 | 48 | self.assertEquals(last_crumb.text, 'Questions') | 48 | self.assertEqual(last_crumb.text, 'Questions') |
21 | 49 | 49 | ||
22 | 50 | def test_person(self): | 50 | def test_person(self): |
23 | 51 | crumbs = self.getBreadcrumbsForObject(self.person, rootsite='answers') | 51 | crumbs = self.getBreadcrumbsForObject(self.person, rootsite='answers') |
24 | 52 | last_crumb = crumbs[-1] | 52 | last_crumb = crumbs[-1] |
27 | 53 | self.assertEquals(last_crumb.url, self.person_questions_url) | 53 | self.assertEqual(last_crumb.url, self.person_questions_url) |
28 | 54 | self.assertEquals(last_crumb.text, 'Questions') | 54 | self.assertEqual(last_crumb.text, 'Questions') |
29 | 55 | 55 | ||
30 | 56 | 56 | ||
31 | 57 | class TestAnswersBreadcrumb(BaseBreadcrumbTestCase): | 57 | class TestAnswersBreadcrumb(BaseBreadcrumbTestCase): |
32 | @@ -68,11 +68,11 @@ | |||
33 | 68 | self.question_url = canonical_url(self.question, rootsite='answers') | 68 | self.question_url = canonical_url(self.question, rootsite='answers') |
34 | 69 | crumbs = self.getBreadcrumbsForObject(self.question) | 69 | crumbs = self.getBreadcrumbsForObject(self.question) |
35 | 70 | last_crumb = crumbs[-1] | 70 | last_crumb = crumbs[-1] |
37 | 71 | self.assertEquals(last_crumb.text, 'Question #%d' % self.question.id) | 71 | self.assertEqual(last_crumb.text, 'Question #%d' % self.question.id) |
38 | 72 | 72 | ||
39 | 73 | def test_faq(self): | 73 | def test_faq(self): |
40 | 74 | self.faq = self.factory.makeFAQ(target=self.product, title='Seedless') | 74 | self.faq = self.factory.makeFAQ(target=self.product, title='Seedless') |
41 | 75 | self.faq_url = canonical_url(self.faq, rootsite='answers') | 75 | self.faq_url = canonical_url(self.faq, rootsite='answers') |
42 | 76 | crumbs = self.getBreadcrumbsForObject(self.faq) | 76 | crumbs = self.getBreadcrumbsForObject(self.faq) |
43 | 77 | last_crumb = crumbs[-1] | 77 | last_crumb = crumbs[-1] |
45 | 78 | self.assertEquals(last_crumb.text, 'FAQ #%d' % self.faq.id) | 78 | self.assertEqual(last_crumb.text, 'FAQ #%d' % self.faq.id) |
46 | 79 | 79 | ||
47 | === modified file 'lib/lp/answers/tests/test_publisher.py' | |||
48 | --- lib/lp/answers/tests/test_publisher.py 2017-10-25 10:02:12 +0000 | |||
49 | +++ lib/lp/answers/tests/test_publisher.py 2018-01-02 16:24:23 +0000 | |||
50 | @@ -47,6 +47,6 @@ | |||
51 | 47 | # Responses to requests to answers pages have the 'Vary' header set to | 47 | # Responses to requests to answers pages have the 'Vary' header set to |
52 | 48 | # include Accept-Language. | 48 | # include Accept-Language. |
53 | 49 | request = AnswersBrowserRequest(io.StringIO(''), {}) | 49 | request = AnswersBrowserRequest(io.StringIO(''), {}) |
55 | 50 | self.assertEquals( | 50 | self.assertEqual( |
56 | 51 | request.response.getHeader('Vary'), | 51 | request.response.getHeader('Vary'), |
57 | 52 | 'Cookie, Authorization, Accept-Language') | 52 | 'Cookie, Authorization, Accept-Language') |
58 | 53 | 53 | ||
59 | === modified file 'lib/lp/answers/tests/test_question_notifications.py' | |||
60 | --- lib/lp/answers/tests/test_question_notifications.py 2017-10-25 10:02:12 +0000 | |||
61 | +++ lib/lp/answers/tests/test_question_notifications.py 2018-01-02 16:24:23 +0000 | |||
62 | @@ -102,7 +102,7 @@ | |||
63 | 102 | 102 | ||
64 | 103 | def test_getSubject(self): | 103 | def test_getSubject(self): |
65 | 104 | """getSubject() when there is no message added to the question.""" | 104 | """getSubject() when there is no message added to the question.""" |
67 | 105 | self.assertEquals( | 105 | self.assertEqual( |
68 | 106 | 'Re: [Question #1]: Question title', | 106 | 'Re: [Question #1]: Question title', |
69 | 107 | self.notification.getSubject()) | 107 | self.notification.getSubject()) |
70 | 108 | 108 | ||
71 | 109 | 109 | ||
72 | === modified file 'lib/lp/answers/tests/test_question_workflow.py' | |||
73 | --- lib/lp/answers/tests/test_question_workflow.py 2018-01-02 10:54:31 +0000 | |||
74 | +++ lib/lp/answers/tests/test_question_workflow.py 2018-01-02 16:24:23 +0000 | |||
75 | @@ -242,19 +242,18 @@ | |||
76 | 242 | """ | 242 | """ |
77 | 243 | self.assertTrue(verifyObject(IQuestionMessage, message)) | 243 | self.assertTrue(verifyObject(IQuestionMessage, message)) |
78 | 244 | 244 | ||
83 | 245 | self.assertEquals("Re: Help!", message.subject) | 245 | self.assertEqual("Re: Help!", message.subject) |
84 | 246 | self.assertEquals(expected_owner, message.owner) | 246 | self.assertEqual(expected_owner, message.owner) |
85 | 247 | self.assertEquals(expected_action, message.action) | 247 | self.assertEqual(expected_action, message.action) |
86 | 248 | self.assertEquals(expected_status, message.new_status) | 248 | self.assertEqual(expected_status, message.new_status) |
87 | 249 | 249 | ||
90 | 250 | self.assertEquals(message, self.question.messages[-1]) | 250 | self.assertEqual(message, self.question.messages[-1]) |
91 | 251 | self.assertEquals(expected_status, self.question.status) | 251 | self.assertEqual(expected_status, self.question.status) |
92 | 252 | 252 | ||
93 | 253 | if expected_owner == self.question.owner: | 253 | if expected_owner == self.question.owner: |
96 | 254 | self.assertEquals(message.datecreated, | 254 | self.assertEqual(message.datecreated, self.question.datelastquery) |
95 | 255 | self.question.datelastquery) | ||
97 | 256 | else: | 255 | else: |
99 | 257 | self.assertEquals( | 256 | self.assertEqual( |
100 | 258 | message.datecreated, self.question.datelastresponse) | 257 | message.datecreated, self.question.datelastresponse) |
101 | 259 | 258 | ||
102 | 260 | def checkTransitionEvents(self, message, edited_fields, status_name): | 259 | def checkTransitionEvents(self, message, edited_fields, status_name): |
103 | @@ -487,9 +486,9 @@ | |||
104 | 487 | """Check additional attributes set when the owner gives the | 486 | """Check additional attributes set when the owner gives the |
105 | 488 | answers. | 487 | answers. |
106 | 489 | """ | 488 | """ |
110 | 490 | self.assertEquals(None, self.question.answer) | 489 | self.assertIsNone(self.question.answer) |
111 | 491 | self.assertEquals(self.owner, self.question.answerer) | 490 | self.assertEqual(self.owner, self.question.answerer) |
112 | 492 | self.assertEquals(message.datecreated, self.question.date_solved) | 491 | self.assertEqual(message.datecreated, self.question.date_solved) |
113 | 493 | 492 | ||
114 | 494 | self._testValidTransition( | 493 | self._testValidTransition( |
115 | 495 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, | 494 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, |
116 | @@ -538,7 +537,7 @@ | |||
117 | 538 | # changes based on departure state. | 537 | # changes based on departure state. |
118 | 539 | def checkFAQ(message): | 538 | def checkFAQ(message): |
119 | 540 | """Check that the FAQ attribute was set correctly.""" | 539 | """Check that the FAQ attribute was set correctly.""" |
121 | 541 | self.assertEquals(self.question.faq, self.faq) | 540 | self.assertEqual(self.question.faq, self.faq) |
122 | 542 | 541 | ||
123 | 543 | self._testValidTransition( | 542 | self._testValidTransition( |
124 | 544 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, | 543 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, |
125 | @@ -559,8 +558,8 @@ | |||
126 | 559 | answers. | 558 | answers. |
127 | 560 | """ | 559 | """ |
128 | 561 | checkFAQ(message) | 560 | checkFAQ(message) |
131 | 562 | self.assertEquals(self.owner, self.question.answerer) | 561 | self.assertEqual(self.owner, self.question.answerer) |
132 | 563 | self.assertEquals(message.datecreated, self.question.date_solved) | 562 | self.assertEqual(message.datecreated, self.question.date_solved) |
133 | 564 | 563 | ||
134 | 565 | self._testValidTransition( | 564 | self._testValidTransition( |
135 | 566 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, | 565 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, |
136 | @@ -642,9 +641,9 @@ | |||
137 | 642 | 641 | ||
138 | 643 | def checkAnswerMessage(message): | 642 | def checkAnswerMessage(message): |
139 | 644 | # Check the attributes that are set when an answer is confirmed. | 643 | # Check the attributes that are set when an answer is confirmed. |
143 | 645 | self.assertEquals(answer_message, self.question.answer) | 644 | self.assertEqual(answer_message, self.question.answer) |
144 | 646 | self.assertEquals(self.answerer, self.question.answerer) | 645 | self.assertEqual(self.answerer, self.question.answerer) |
145 | 647 | self.assertEquals(message.datecreated, self.question.date_solved) | 646 | self.assertEqual(message.datecreated, self.question.date_solved) |
146 | 648 | 647 | ||
147 | 649 | self._testValidTransition( | 648 | self._testValidTransition( |
148 | 650 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, | 649 | [QuestionStatus.OPEN, QuestionStatus.NEEDSINFO, |
149 | @@ -672,13 +671,13 @@ | |||
150 | 672 | self.question.giveAnswer( | 671 | self.question.giveAnswer( |
151 | 673 | self.owner, 'I solved my own problem.', | 672 | self.owner, 'I solved my own problem.', |
152 | 674 | datecreated=self.nowPlus(2)) | 673 | datecreated=self.nowPlus(2)) |
154 | 675 | self.assertEquals(self.question.status, QuestionStatus.SOLVED) | 674 | self.assertEqual(self.question.status, QuestionStatus.SOLVED) |
155 | 676 | 675 | ||
156 | 677 | def checkAnswerMessage(message): | 676 | def checkAnswerMessage(message): |
157 | 678 | # Check the attributes that are set when an answer is confirmed. | 677 | # Check the attributes that are set when an answer is confirmed. |
161 | 679 | self.assertEquals(answer_message, self.question.answer) | 678 | self.assertEqual(answer_message, self.question.answer) |
162 | 680 | self.assertEquals(self.answerer, self.question.answerer) | 679 | self.assertEqual(self.answerer, self.question.answerer) |
163 | 681 | self.assertEquals(message.datecreated, self.question.date_solved) | 680 | self.assertEqual(message.datecreated, self.question.date_solved) |
164 | 682 | 681 | ||
165 | 683 | self._testValidTransition( | 682 | self._testValidTransition( |
166 | 684 | [QuestionStatus.SOLVED], | 683 | [QuestionStatus.SOLVED], |
167 | @@ -765,7 +764,7 @@ | |||
168 | 765 | self.question.giveAnswer( | 764 | self.question.giveAnswer( |
169 | 766 | self.owner, 'I solved my own problem.', | 765 | self.owner, 'I solved my own problem.', |
170 | 767 | datecreated=self.nowPlus(0)) | 766 | datecreated=self.nowPlus(0)) |
172 | 768 | self.assertEquals(self.question.status, QuestionStatus.SOLVED) | 767 | self.assertEqual(self.question.status, QuestionStatus.SOLVED) |
173 | 769 | 768 | ||
174 | 770 | # Clear previous events. | 769 | # Clear previous events. |
175 | 771 | self.collected_events = [] | 770 | self.collected_events = [] |
176 | @@ -793,7 +792,7 @@ | |||
177 | 793 | self.answerer, 'Press the any key.', datecreated=self.nowPlus(0)) | 792 | self.answerer, 'Press the any key.', datecreated=self.nowPlus(0)) |
178 | 794 | self.question.confirmAnswer("That answer worked!.", | 793 | self.question.confirmAnswer("That answer worked!.", |
179 | 795 | answer=answer_message, datecreated=self.nowPlus(1)) | 794 | answer=answer_message, datecreated=self.nowPlus(1)) |
181 | 796 | self.assertEquals(self.question.status, QuestionStatus.SOLVED) | 795 | self.assertEqual(self.question.status, QuestionStatus.SOLVED) |
182 | 797 | 796 | ||
183 | 798 | # Clear previous events. | 797 | # Clear previous events. |
184 | 799 | self.collected_events = [] | 798 | self.collected_events = [] |
185 | @@ -890,9 +889,9 @@ | |||
186 | 890 | def checkRejectMessageIsAnAnswer(message): | 889 | def checkRejectMessageIsAnAnswer(message): |
187 | 891 | # Check that the rejection message was considered answering | 890 | # Check that the rejection message was considered answering |
188 | 892 | # the question. | 891 | # the question. |
192 | 893 | self.assertEquals(message, self.question.answer) | 892 | self.assertEqual(message, self.question.answer) |
193 | 894 | self.assertEquals(self.answerer, self.question.answerer) | 893 | self.assertEqual(self.answerer, self.question.answerer) |
194 | 895 | self.assertEquals(message.datecreated, self.question.date_solved) | 894 | self.assertEqual(message.datecreated, self.question.date_solved) |
195 | 896 | 895 | ||
196 | 897 | self._testValidTransition( | 896 | self._testValidTransition( |
197 | 898 | valid_statuses, | 897 | valid_statuses, |
198 | 899 | 898 | ||
199 | === modified file 'lib/lp/app/browser/tests/test_inlineeditpickerwidget.py' | |||
200 | --- lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2015-07-08 16:05:11 +0000 | |||
201 | +++ lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2018-01-02 16:24:23 +0000 | |||
202 | @@ -42,7 +42,7 @@ | |||
203 | 42 | # Make sure that when given a vocabulary which supports vocab filters, | 42 | # Make sure that when given a vocabulary which supports vocab filters, |
204 | 43 | # the vocab filters are include in the widget config. | 43 | # the vocab filters are include in the widget config. |
205 | 44 | widget = self.getWidget(vocabulary='ValidPersonOrTeam') | 44 | widget = self.getWidget(vocabulary='ValidPersonOrTeam') |
207 | 45 | self.assertEquals([ | 45 | self.assertEqual([ |
208 | 46 | {'name': 'ALL', | 46 | {'name': 'ALL', |
209 | 47 | 'title': 'All', | 47 | 'title': 'All', |
210 | 48 | 'description': 'Display all search results'}, | 48 | 'description': 'Display all search results'}, |
211 | @@ -87,13 +87,13 @@ | |||
212 | 87 | # The widget has the correct meta value for a person value. | 87 | # The widget has the correct meta value for a person value. |
213 | 88 | widget_value = self.factory.makePerson() | 88 | widget_value = self.factory.makePerson() |
214 | 89 | widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam') | 89 | widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam') |
216 | 90 | self.assertEquals('person', widget.config['selected_value_metadata']) | 90 | self.assertEqual('person', widget.config['selected_value_metadata']) |
217 | 91 | 91 | ||
218 | 92 | def test_team_selected_value_meta(self): | 92 | def test_team_selected_value_meta(self): |
219 | 93 | # The widget has the correct meta value for a team value. | 93 | # The widget has the correct meta value for a team value. |
220 | 94 | widget_value = self.factory.makeTeam() | 94 | widget_value = self.factory.makeTeam() |
221 | 95 | widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam') | 95 | widget = self.getWidget(widget_value, vocabulary='ValidPersonOrTeam') |
223 | 96 | self.assertEquals('team', widget.config['selected_value_metadata']) | 96 | self.assertEqual('team', widget.config['selected_value_metadata']) |
224 | 97 | 97 | ||
225 | 98 | def test_required_fields_dont_have_a_remove_link(self): | 98 | def test_required_fields_dont_have_a_remove_link(self): |
226 | 99 | widget = self.getWidget( | 99 | widget = self.getWidget( |
227 | 100 | 100 | ||
228 | === modified file 'lib/lp/app/browser/tests/test_launchpad.py' | |||
229 | --- lib/lp/app/browser/tests/test_launchpad.py 2016-06-20 22:29:24 +0000 | |||
230 | +++ lib/lp/app/browser/tests/test_launchpad.py 2018-01-02 16:24:23 +0000 | |||
231 | @@ -77,10 +77,10 @@ | |||
232 | 77 | 77 | ||
233 | 78 | notifications = request.notifications | 78 | notifications = request.notifications |
234 | 79 | if notification is None: | 79 | if notification is None: |
236 | 80 | self.assertEquals(len(notifications), 0) | 80 | self.assertEqual(len(notifications), 0) |
237 | 81 | return | 81 | return |
238 | 82 | self.assertEqual(len(notifications), 1) | 82 | self.assertEqual(len(notifications), 1) |
240 | 83 | self.assertEquals(notifications[0].level, level) | 83 | self.assertEqual(notifications[0].level, level) |
241 | 84 | self.assertEqual(notification, notifications[0].message) | 84 | self.assertEqual(notification, notifications[0].message) |
242 | 85 | 85 | ||
243 | 86 | def assertDisplaysNotification( | 86 | def assertDisplaysNotification( |
244 | 87 | 87 | ||
245 | === modified file 'lib/lp/app/browser/tests/test_launchpadroot.py' | |||
246 | --- lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 10:54:31 +0000 | |||
247 | +++ lib/lp/app/browser/tests/test_launchpadroot.py 2018-01-02 16:24:23 +0000 | |||
248 | @@ -84,7 +84,7 @@ | |||
249 | 84 | def test_featured_projects_view_requires_edit(self): | 84 | def test_featured_projects_view_requires_edit(self): |
250 | 85 | view = create_view(self.root, '+featuredprojects') | 85 | view = create_view(self.root, '+featuredprojects') |
251 | 86 | checker = selectChecker(view) | 86 | checker = selectChecker(view) |
253 | 87 | self.assertEquals('launchpad.Edit', checker.permission_id('__call__')) | 87 | self.assertEqual('launchpad.Edit', checker.permission_id('__call__')) |
254 | 88 | 88 | ||
255 | 89 | def test_featured_projects_manage_link_requires_edit(self): | 89 | def test_featured_projects_manage_link_requires_edit(self): |
256 | 90 | self.setUpRegistryExpert() | 90 | self.setUpRegistryExpert() |
257 | 91 | 91 | ||
258 | === modified file 'lib/lp/app/tests/test_tales.py' | |||
259 | --- lib/lp/app/tests/test_tales.py 2018-01-02 10:54:31 +0000 | |||
260 | +++ lib/lp/app/tests/test_tales.py 2018-01-02 16:24:23 +0000 | |||
261 | @@ -395,7 +395,7 @@ | |||
262 | 395 | ircID = ircset.new(person, "<b>irc.canonical.com</b>", "fred") | 395 | ircID = ircset.new(person, "<b>irc.canonical.com</b>", "fred") |
263 | 396 | expected_html = test_tales( | 396 | expected_html = test_tales( |
264 | 397 | 'nick/fmt:formatted_displayname', nick=ircID) | 397 | 'nick/fmt:formatted_displayname', nick=ircID) |
266 | 398 | self.assertEquals( | 398 | self.assertEqual( |
267 | 399 | u'<strong>fred</strong>\n' | 399 | u'<strong>fred</strong>\n' |
268 | 400 | '<span class="lesser"> on </span>\n' | 400 | '<span class="lesser"> on </span>\n' |
269 | 401 | '<strong><b>irc.canonical.com</b></strong>\n', | 401 | '<strong><b>irc.canonical.com</b></strong>\n', |
270 | 402 | 402 | ||
271 | === modified file 'lib/lp/archivepublisher/tests/test_debversion.py' | |||
272 | --- lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 10:54:31 +0000 | |||
273 | +++ lib/lp/archivepublisher/tests/test_debversion.py 2018-01-02 16:24:23 +0000 | |||
274 | @@ -62,15 +62,15 @@ | |||
275 | 62 | 62 | ||
276 | 63 | def testReturnString(self): | 63 | def testReturnString(self): |
277 | 64 | """Version should convert to a string.""" | 64 | """Version should convert to a string.""" |
279 | 65 | self.assertEquals(str(Version("1.0")), "1.0") | 65 | self.assertEqual(str(Version("1.0")), "1.0") |
280 | 66 | 66 | ||
281 | 67 | def testAcceptsInteger(self): | 67 | def testAcceptsInteger(self): |
282 | 68 | """Version should accept an integer.""" | 68 | """Version should accept an integer.""" |
284 | 69 | self.assertEquals(str(Version(1)), "1") | 69 | self.assertEqual(str(Version(1)), "1") |
285 | 70 | 70 | ||
286 | 71 | def testAcceptsNumber(self): | 71 | def testAcceptsNumber(self): |
287 | 72 | """Version should accept a number.""" | 72 | """Version should accept a number.""" |
289 | 73 | self.assertEquals(str(Version(1.2)), "1.2") | 73 | self.assertEqual(str(Version(1.2)), "1.2") |
290 | 74 | 74 | ||
291 | 75 | def testNotEmpty(self): | 75 | def testNotEmpty(self): |
292 | 76 | """Version should fail with empty input.""" | 76 | """Version should fail with empty input.""" |
293 | @@ -107,8 +107,8 @@ | |||
294 | 107 | def testRevisionNotEmpty(self): | 107 | def testRevisionNotEmpty(self): |
295 | 108 | """Version should not allow an empty revision.""" | 108 | """Version should not allow an empty revision.""" |
296 | 109 | v = Version("1-") | 109 | v = Version("1-") |
299 | 110 | self.assertEquals("1-", v.upstream_version) | 110 | self.assertEqual("1-", v.upstream_version) |
300 | 111 | self.assertEquals(None, v.debian_version) | 111 | self.assertIsNone(v.debian_version) |
301 | 112 | 112 | ||
302 | 113 | def testRevisionInvalid(self): | 113 | def testRevisionInvalid(self): |
303 | 114 | """Version should fail when revision contains a bad character.""" | 114 | """Version should fail when revision contains a bad character.""" |
304 | @@ -118,7 +118,7 @@ | |||
305 | 118 | """Version should give same input as output.""" | 118 | """Version should give same input as output.""" |
306 | 119 | for value in self.VALUES: | 119 | for value in self.VALUES: |
307 | 120 | result = str(Version(value)) | 120 | result = str(Version(value)) |
309 | 121 | self.assertEquals(value, result) | 121 | self.assertEqual(value, result) |
310 | 122 | 122 | ||
311 | 123 | def testComparisons(self): | 123 | def testComparisons(self): |
312 | 124 | """Sample Version comparisons should pass.""" | 124 | """Sample Version comparisons should pass.""" |
313 | @@ -127,10 +127,10 @@ | |||
314 | 127 | 127 | ||
315 | 128 | def testNullEpochIsZero(self): | 128 | def testNullEpochIsZero(self): |
316 | 129 | """Version should treat an omitted epoch as a zero one.""" | 129 | """Version should treat an omitted epoch as a zero one.""" |
318 | 130 | self.assertEquals(Version("1.0"), Version("0:1.0")) | 130 | self.assertEqual(Version("1.0"), Version("0:1.0")) |
319 | 131 | 131 | ||
320 | 132 | def notestNullRevisionIsZero(self): | 132 | def notestNullRevisionIsZero(self): |
321 | 133 | """Version should treat an omitted revision as being equal to zero. | 133 | """Version should treat an omitted revision as being equal to zero. |
322 | 134 | """ | 134 | """ |
324 | 135 | self.assertEquals(Version("1.0"), Version("1.0-0")) | 135 | self.assertEqual(Version("1.0"), Version("1.0-0")) |
325 | 136 | self.assertTrue(Version("1.0") == Version("1.0-0")) | 136 | self.assertTrue(Version("1.0") == Version("1.0-0")) |
326 | 137 | 137 | ||
327 | === modified file 'lib/lp/archivepublisher/tests/test_htaccess.py' | |||
328 | --- lib/lp/archivepublisher/tests/test_htaccess.py 2017-10-09 11:33:11 +0000 | |||
329 | +++ lib/lp/archivepublisher/tests/test_htaccess.py 2018-01-02 16:24:23 +0000 | |||
330 | @@ -101,7 +101,7 @@ | |||
331 | 101 | # If there are no ArchiveAuthTokens for an archive just | 101 | # If there are no ArchiveAuthTokens for an archive just |
332 | 102 | # the buildd secret is returned. | 102 | # the buildd secret is returned. |
333 | 103 | self.ppa.buildd_secret = "sekr1t" | 103 | self.ppa.buildd_secret = "sekr1t" |
335 | 104 | self.assertEquals( | 104 | self.assertEqual( |
336 | 105 | [("buildd", "sekr1t", "bu")], | 105 | [("buildd", "sekr1t", "bu")], |
337 | 106 | list(htpasswd_credentials_for_archive(self.ppa))) | 106 | list(htpasswd_credentials_for_archive(self.ppa))) |
338 | 107 | 107 | ||
339 | 108 | 108 | ||
340 | === modified file 'lib/lp/archiveuploader/tests/test_changesfile.py' | |||
341 | --- lib/lp/archiveuploader/tests/test_changesfile.py 2017-09-17 10:35:57 +0000 | |||
342 | +++ lib/lp/archiveuploader/tests/test_changesfile.py 2018-01-02 16:24:23 +0000 | |||
343 | @@ -50,25 +50,25 @@ | |||
344 | 50 | 50 | ||
345 | 51 | def testSourceFile(self): | 51 | def testSourceFile(self): |
346 | 52 | # A non-DSC source file is a SourceUploadFile. | 52 | # A non-DSC source file is a SourceUploadFile. |
348 | 53 | self.assertEquals( | 53 | self.assertEqual( |
349 | 54 | ('foo', SourceUploadFile), | 54 | ('foo', SourceUploadFile), |
350 | 55 | determine_file_class_and_name('foo_1.0.diff.gz')) | 55 | determine_file_class_and_name('foo_1.0.diff.gz')) |
351 | 56 | 56 | ||
352 | 57 | def testDSCFile(self): | 57 | def testDSCFile(self): |
353 | 58 | # A DSC is a DSCFile, since they're special. | 58 | # A DSC is a DSCFile, since they're special. |
355 | 59 | self.assertEquals( | 59 | self.assertEqual( |
356 | 60 | ('foo', DSCFile), | 60 | ('foo', DSCFile), |
357 | 61 | determine_file_class_and_name('foo_1.0.dsc')) | 61 | determine_file_class_and_name('foo_1.0.dsc')) |
358 | 62 | 62 | ||
359 | 63 | def testDEBFile(self): | 63 | def testDEBFile(self): |
360 | 64 | # A binary file is the appropriate PackageUploadFile subclass. | 64 | # A binary file is the appropriate PackageUploadFile subclass. |
362 | 65 | self.assertEquals( | 65 | self.assertEqual( |
363 | 66 | ('foo', DebBinaryUploadFile), | 66 | ('foo', DebBinaryUploadFile), |
364 | 67 | determine_file_class_and_name('foo_1.0_all.deb')) | 67 | determine_file_class_and_name('foo_1.0_all.deb')) |
366 | 68 | self.assertEquals( | 68 | self.assertEqual( |
367 | 69 | ('foo', DdebBinaryUploadFile), | 69 | ('foo', DdebBinaryUploadFile), |
368 | 70 | determine_file_class_and_name('foo_1.0_all.ddeb')) | 70 | determine_file_class_and_name('foo_1.0_all.ddeb')) |
370 | 71 | self.assertEquals( | 71 | self.assertEqual( |
371 | 72 | ('foo', UdebBinaryUploadFile), | 72 | ('foo', UdebBinaryUploadFile), |
372 | 73 | determine_file_class_and_name('foo_1.0_all.udeb')) | 73 | determine_file_class_and_name('foo_1.0_all.udeb')) |
373 | 74 | 74 | ||
374 | @@ -219,43 +219,43 @@ | |||
375 | 219 | # checkFileName() yields an UploadError if the filename is invalid. | 219 | # checkFileName() yields an UploadError if the filename is invalid. |
376 | 220 | contents = self.getBaseChanges() | 220 | contents = self.getBaseChanges() |
377 | 221 | changes = self.createChangesFile("mypkg_0.1_i386.changes", contents) | 221 | changes = self.createChangesFile("mypkg_0.1_i386.changes", contents) |
379 | 222 | self.assertEquals([], list(changes.checkFileName())) | 222 | self.assertEqual([], list(changes.checkFileName())) |
380 | 223 | changes = self.createChangesFile("mypkg_0.1.changes", contents) | 223 | changes = self.createChangesFile("mypkg_0.1.changes", contents) |
381 | 224 | errors = list(changes.checkFileName()) | 224 | errors = list(changes.checkFileName()) |
382 | 225 | self.assertIsInstance(errors[0], UploadError) | 225 | self.assertIsInstance(errors[0], UploadError) |
384 | 226 | self.assertEquals(1, len(errors)) | 226 | self.assertEqual(1, len(errors)) |
385 | 227 | 227 | ||
386 | 228 | def test_filename(self): | 228 | def test_filename(self): |
387 | 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. |
388 | 230 | changes = self.createChangesFile( | 230 | changes = self.createChangesFile( |
389 | 231 | "mypkg_0.1_i386.changes", self.getBaseChanges()) | 231 | "mypkg_0.1_i386.changes", self.getBaseChanges()) |
391 | 232 | self.assertEquals("mypkg_0.1_i386.changes", changes.filename) | 232 | self.assertEqual("mypkg_0.1_i386.changes", changes.filename) |
392 | 233 | 233 | ||
393 | 234 | def test_suite_name(self): | 234 | def test_suite_name(self): |
394 | 235 | # The suite name gets extracted from the changes file. | 235 | # The suite name gets extracted from the changes file. |
395 | 236 | changes = self.createChangesFile( | 236 | changes = self.createChangesFile( |
396 | 237 | "mypkg_0.1_i386.changes", self.getBaseChanges()) | 237 | "mypkg_0.1_i386.changes", self.getBaseChanges()) |
398 | 238 | self.assertEquals("nifty", changes.suite_name) | 238 | self.assertEqual("nifty", changes.suite_name) |
399 | 239 | 239 | ||
400 | 240 | def test_version(self): | 240 | def test_version(self): |
401 | 241 | # The version gets extracted from the changes file. | 241 | # The version gets extracted from the changes file. |
402 | 242 | changes = self.createChangesFile( | 242 | changes = self.createChangesFile( |
403 | 243 | "mypkg_0.1_i386.changes", self.getBaseChanges()) | 243 | "mypkg_0.1_i386.changes", self.getBaseChanges()) |
405 | 244 | self.assertEquals("0.1", changes.version) | 244 | self.assertEqual("0.1", changes.version) |
406 | 245 | 245 | ||
407 | 246 | def test_architectures(self): | 246 | def test_architectures(self): |
408 | 247 | # The architectures get extracted from the changes file | 247 | # The architectures get extracted from the changes file |
409 | 248 | # and parsed correctly. | 248 | # and parsed correctly. |
410 | 249 | changes = self.createChangesFile( | 249 | changes = self.createChangesFile( |
411 | 250 | "mypkg_0.1_i386.changes", self.getBaseChanges()) | 250 | "mypkg_0.1_i386.changes", self.getBaseChanges()) |
414 | 251 | self.assertEquals("i386", changes.architecture_line) | 251 | self.assertEqual("i386", changes.architecture_line) |
415 | 252 | self.assertEquals(set(["i386"]), changes.architectures) | 252 | self.assertEqual(set(["i386"]), changes.architectures) |
416 | 253 | 253 | ||
417 | 254 | def test_source(self): | 254 | def test_source(self): |
418 | 255 | # The source package name gets extracted from the changes file. | 255 | # The source package name gets extracted from the changes file. |
419 | 256 | changes = self.createChangesFile( | 256 | changes = self.createChangesFile( |
420 | 257 | "mypkg_0.1_i386.changes", self.getBaseChanges()) | 257 | "mypkg_0.1_i386.changes", self.getBaseChanges()) |
422 | 258 | self.assertEquals("mypkg", changes.source) | 258 | self.assertEqual("mypkg", changes.source) |
423 | 259 | 259 | ||
424 | 260 | def test_processAddresses(self): | 260 | def test_processAddresses(self): |
425 | 261 | # processAddresses parses the changes file and sets the | 261 | # processAddresses parses the changes file and sets the |
426 | @@ -263,9 +263,9 @@ | |||
427 | 263 | contents = self.getBaseChanges() | 263 | contents = self.getBaseChanges() |
428 | 264 | changes = self.createChangesFile( | 264 | changes = self.createChangesFile( |
429 | 265 | "mypkg_0.1_i386.changes", contents) | 265 | "mypkg_0.1_i386.changes", contents) |
431 | 266 | self.assertEquals(None, changes.changed_by) | 266 | self.assertIsNone(changes.changed_by) |
432 | 267 | errors = list(changes.processAddresses()) | 267 | errors = list(changes.processAddresses()) |
434 | 268 | self.assertEquals(0, len(errors), "Errors: %r" % errors) | 268 | self.assertEqual(0, len(errors), "Errors: %r" % errors) |
435 | 269 | self.assertThat( | 269 | self.assertThat( |
436 | 270 | changes.changed_by, | 270 | changes.changed_by, |
437 | 271 | MatchesDict({ | 271 | MatchesDict({ |
438 | @@ -280,8 +280,8 @@ | |||
439 | 280 | contents = self.getBaseChanges() | 280 | contents = self.getBaseChanges() |
440 | 281 | changes = self.createChangesFile( | 281 | changes = self.createChangesFile( |
441 | 282 | "mypkg_0.1_i386.changes", contents) | 282 | "mypkg_0.1_i386.changes", contents) |
444 | 283 | self.assertEquals([], list(changes.processAddresses())) | 283 | self.assertEqual([], list(changes.processAddresses())) |
445 | 284 | self.assertEquals( | 284 | self.assertEqual( |
446 | 285 | "Something changed\n\n" | 285 | "Something changed\n\n" |
447 | 286 | " -- Somebody <somebody@ubuntu.com> " | 286 | " -- Somebody <somebody@ubuntu.com> " |
448 | 287 | "Fri, 25 Jun 2010 11:20:22 -0600", | 287 | "Fri, 25 Jun 2010 11:20:22 -0600", |
449 | 288 | 288 | ||
450 | === modified file 'lib/lp/archiveuploader/tests/test_dscfile.py' | |||
451 | --- lib/lp/archiveuploader/tests/test_dscfile.py 2016-06-01 01:59:32 +0000 | |||
452 | +++ lib/lp/archiveuploader/tests/test_dscfile.py 2018-01-02 16:24:23 +0000 | |||
453 | @@ -76,7 +76,7 @@ | |||
454 | 76 | file.write(copyright) | 76 | file.write(copyright) |
455 | 77 | file.close() | 77 | file.close() |
456 | 78 | 78 | ||
458 | 79 | self.assertEquals( | 79 | self.assertEqual( |
459 | 80 | copyright, find_copyright(self.tmpdir, DevNullLogger())) | 80 | copyright, find_copyright(self.tmpdir, DevNullLogger())) |
460 | 81 | 81 | ||
461 | 82 | def testBadDebianChangelog(self): | 82 | def testBadDebianChangelog(self): |
462 | @@ -98,7 +98,7 @@ | |||
463 | 98 | file.write(changelog) | 98 | file.write(changelog) |
464 | 99 | file.close() | 99 | file.close() |
465 | 100 | 100 | ||
467 | 101 | self.assertEquals( | 101 | self.assertEqual( |
468 | 102 | changelog, find_changelog(self.tmpdir, DevNullLogger())) | 102 | changelog, find_changelog(self.tmpdir, DevNullLogger())) |
469 | 103 | 103 | ||
470 | 104 | def testOversizedFile(self): | 104 | def testOversizedFile(self): |
471 | @@ -252,7 +252,7 @@ | |||
472 | 252 | DEBIAN_TARBALL: 0, | 252 | DEBIAN_TARBALL: 0, |
473 | 253 | } | 253 | } |
474 | 254 | full_files.update(files) | 254 | full_files.update(files) |
476 | 255 | self.assertEquals( | 255 | self.assertEqual( |
477 | 256 | expected, | 256 | expected, |
478 | 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]( |
479 | 258 | 'foo_1.dsc', full_files, components, component_signatures, | 258 | 'foo_1.dsc', full_files, components, component_signatures, |
480 | @@ -408,7 +408,7 @@ | |||
481 | 408 | unpacked_dir = unpack_source( | 408 | unpacked_dir = unpack_source( |
482 | 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'))) |
483 | 410 | try: | 410 | try: |
485 | 411 | self.assertEquals(["bar-1.0"], os.listdir(unpacked_dir)) | 411 | self.assertEqual(["bar-1.0"], os.listdir(unpacked_dir)) |
486 | 412 | self.assertContentEqual( | 412 | self.assertContentEqual( |
487 | 413 | ["THIS_IS_BAR", "debian"], | 413 | ["THIS_IS_BAR", "debian"], |
488 | 414 | os.listdir(os.path.join(unpacked_dir, "bar-1.0"))) | 414 | os.listdir(os.path.join(unpacked_dir, "bar-1.0"))) |
489 | 415 | 415 | ||
490 | === modified file 'lib/lp/archiveuploader/tests/test_nascentupload.py' | |||
491 | --- lib/lp/archiveuploader/tests/test_nascentupload.py 2014-06-11 08:29:40 +0000 | |||
492 | +++ lib/lp/archiveuploader/tests/test_nascentupload.py 2018-01-02 16:24:23 +0000 | |||
493 | @@ -52,7 +52,7 @@ | |||
494 | 52 | return file | 52 | return file |
495 | 53 | 53 | ||
496 | 54 | def assertMatchDDEBErrors(self, error_list): | 54 | def assertMatchDDEBErrors(self, error_list): |
498 | 55 | self.assertEquals( | 55 | self.assertEqual( |
499 | 56 | error_list, [str(e) for e in self.upload._matchDDEBs()]) | 56 | error_list, [str(e) for e in self.upload._matchDDEBs()]) |
500 | 57 | 57 | ||
501 | 58 | def testNoLinksWithNoBinaries(self): | 58 | def testNoLinksWithNoBinaries(self): |
502 | 59 | 59 | ||
503 | === modified file 'lib/lp/archiveuploader/tests/test_nascentuploadfile.py' | |||
504 | --- lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2016-11-17 16:46:04 +0000 | |||
505 | +++ lib/lp/archiveuploader/tests/test_nascentuploadfile.py 2018-01-02 16:24:23 +0000 | |||
506 | @@ -124,7 +124,7 @@ | |||
507 | 124 | # The mime type gets set according to PackageUploadCustomFormat. | 124 | # The mime type gets set according to PackageUploadCustomFormat. |
508 | 125 | uploadfile = self.createCustomUploadFile( | 125 | uploadfile = self.createCustomUploadFile( |
509 | 126 | "bla.txt", "data", "main/raw-installer", "extra") | 126 | "bla.txt", "data", "main/raw-installer", "extra") |
511 | 127 | self.assertEquals( | 127 | self.assertEqual( |
512 | 128 | PackageUploadCustomFormat.DEBIAN_INSTALLER, | 128 | PackageUploadCustomFormat.DEBIAN_INSTALLER, |
513 | 129 | uploadfile.custom_type) | 129 | uploadfile.custom_type) |
514 | 130 | 130 | ||
515 | @@ -132,10 +132,10 @@ | |||
516 | 132 | # storeInDatabase creates a library file. | 132 | # storeInDatabase creates a library file. |
517 | 133 | uploadfile = self.createCustomUploadFile( | 133 | uploadfile = self.createCustomUploadFile( |
518 | 134 | "bla.txt", "data", "main/raw-installer", "extra") | 134 | "bla.txt", "data", "main/raw-installer", "extra") |
520 | 135 | self.assertEquals("application/octet-stream", uploadfile.content_type) | 135 | self.assertEqual("application/octet-stream", uploadfile.content_type) |
521 | 136 | libraryfile = uploadfile.storeInDatabase() | 136 | libraryfile = uploadfile.storeInDatabase() |
524 | 137 | self.assertEquals("bla.txt", libraryfile.filename) | 137 | self.assertEqual("bla.txt", libraryfile.filename) |
525 | 138 | self.assertEquals("application/octet-stream", libraryfile.mimetype) | 138 | self.assertEqual("application/octet-stream", libraryfile.mimetype) |
526 | 139 | 139 | ||
527 | 140 | def test_debian_installer_verify(self): | 140 | def test_debian_installer_verify(self): |
528 | 141 | # debian-installer uploads are required to have sensible filenames. | 141 | # debian-installer uploads are required to have sensible filenames. |
529 | @@ -236,7 +236,7 @@ | |||
530 | 236 | priority_name, package, version, changes): | 236 | priority_name, package, version, changes): |
531 | 237 | (path, md5, sha1, size) = self.writeUploadFile(filename, dsc.dump()) | 237 | (path, md5, sha1, size) = self.writeUploadFile(filename, dsc.dump()) |
532 | 238 | if changes: | 238 | if changes: |
534 | 239 | self.assertEquals([], list(changes.processAddresses())) | 239 | self.assertEqual([], list(changes.processAddresses())) |
535 | 240 | return DSCFile( | 240 | return DSCFile( |
536 | 241 | path, dict(MD5=md5), size, component_and_section, priority_name, | 241 | path, dict(MD5=md5), size, component_and_section, priority_name, |
537 | 242 | package, version, changes, self.policy, self.logger) | 242 | package, version, changes, self.policy, self.logger) |
538 | @@ -246,7 +246,7 @@ | |||
539 | 246 | dsc = self.getBaseDsc() | 246 | dsc = self.getBaseDsc() |
540 | 247 | uploadfile = self.createDSCFile( | 247 | uploadfile = self.createDSCFile( |
541 | 248 | "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42", None) | 248 | "foo.dsc", dsc, "main/net", "extra", "dulwich", "0.42", None) |
543 | 249 | self.assertEquals( | 249 | self.assertEqual( |
544 | 250 | "text/x-debian-source-package", uploadfile.content_type) | 250 | "text/x-debian-source-package", uploadfile.content_type) |
545 | 251 | 251 | ||
546 | 252 | def test_storeInDatabase(self): | 252 | def test_storeInDatabase(self): |
547 | @@ -260,8 +260,8 @@ | |||
548 | 260 | uploadfile.changelog = "DUMMY" | 260 | uploadfile.changelog = "DUMMY" |
549 | 261 | uploadfile.files = [] | 261 | uploadfile.files = [] |
550 | 262 | release = uploadfile.storeInDatabase(None) | 262 | release = uploadfile.storeInDatabase(None) |
553 | 263 | self.assertEquals("0.42", release.version) | 263 | self.assertEqual("0.42", release.version) |
554 | 264 | self.assertEquals("dpkg, bzr", release.builddepends) | 264 | self.assertEqual("dpkg, bzr", release.builddepends) |
555 | 265 | 265 | ||
556 | 266 | def test_storeInDatabase_case_sensitivity(self): | 266 | def test_storeInDatabase_case_sensitivity(self): |
557 | 267 | # storeInDatabase supports field names with different cases, | 267 | # storeInDatabase supports field names with different cases, |
558 | @@ -275,7 +275,7 @@ | |||
559 | 275 | uploadfile.files = [] | 275 | uploadfile.files = [] |
560 | 276 | uploadfile.changelog = "DUMMY" | 276 | uploadfile.changelog = "DUMMY" |
561 | 277 | release = uploadfile.storeInDatabase(None) | 277 | release = uploadfile.storeInDatabase(None) |
563 | 278 | self.assertEquals("dpkg, bzr", release.builddepends) | 278 | self.assertEqual("dpkg, bzr", release.builddepends) |
564 | 279 | 279 | ||
565 | 280 | def test_user_defined_fields(self): | 280 | def test_user_defined_fields(self): |
566 | 281 | # storeInDatabase updates user_defined_fields. | 281 | # storeInDatabase updates user_defined_fields. |
567 | @@ -289,7 +289,7 @@ | |||
568 | 289 | uploadfile.files = [] | 289 | uploadfile.files = [] |
569 | 290 | release = uploadfile.storeInDatabase(None) | 290 | release = uploadfile.storeInDatabase(None) |
570 | 291 | # DSCFile lowercases the field names | 291 | # DSCFile lowercases the field names |
572 | 292 | self.assertEquals( | 292 | self.assertEqual( |
573 | 293 | [["Python-Version", u"2.5"]], release.user_defined_fields) | 293 | [["Python-Version", u"2.5"]], release.user_defined_fields) |
574 | 294 | 294 | ||
575 | 295 | def test_homepage(self): | 295 | def test_homepage(self): |
576 | @@ -303,7 +303,7 @@ | |||
577 | 303 | uploadfile.changelog = "DUMMY" | 303 | uploadfile.changelog = "DUMMY" |
578 | 304 | uploadfile.files = [] | 304 | uploadfile.files = [] |
579 | 305 | release = uploadfile.storeInDatabase(None) | 305 | release = uploadfile.storeInDatabase(None) |
581 | 306 | self.assertEquals(u"http://samba.org/~jelmer/bzr", release.homepage) | 306 | self.assertEqual(u"http://samba.org/~jelmer/bzr", release.homepage) |
582 | 307 | 307 | ||
583 | 308 | def test_checkBuild(self): | 308 | def test_checkBuild(self): |
584 | 309 | # checkBuild() verifies consistency with a build. | 309 | # checkBuild() verifies consistency with a build. |
585 | @@ -320,7 +320,7 @@ | |||
586 | 320 | uploadfile.checkBuild(build) | 320 | uploadfile.checkBuild(build) |
587 | 321 | # checkBuild() sets the build status to FULLYBUILT and | 321 | # checkBuild() sets the build status to FULLYBUILT and |
588 | 322 | # removes the upload log. | 322 | # removes the upload log. |
590 | 323 | self.assertEquals(BuildStatus.FULLYBUILT, build.status) | 323 | self.assertEqual(BuildStatus.FULLYBUILT, build.status) |
591 | 324 | self.assertIs(None, build.upload_log) | 324 | self.assertIs(None, build.upload_log) |
592 | 325 | 325 | ||
593 | 326 | def test_checkBuild_inconsistent(self): | 326 | def test_checkBuild_inconsistent(self): |
594 | @@ -399,7 +399,7 @@ | |||
595 | 399 | # Unknown priorities automatically get changed to 'extra'. | 399 | # Unknown priorities automatically get changed to 'extra'. |
596 | 400 | uploadfile = self.createDebBinaryUploadFile( | 400 | uploadfile = self.createDebBinaryUploadFile( |
597 | 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) |
599 | 402 | self.assertEquals("extra", uploadfile.priority_name) | 402 | self.assertEqual("extra", uploadfile.priority_name) |
600 | 403 | 403 | ||
601 | 404 | def test_parseControl(self): | 404 | def test_parseControl(self): |
602 | 405 | # parseControl sets various fields on DebBinaryUploadFile. | 405 | # parseControl sets various fields on DebBinaryUploadFile. |
603 | @@ -408,10 +408,10 @@ | |||
604 | 408 | None) | 408 | None) |
605 | 409 | control = self.getBaseControl() | 409 | control = self.getBaseControl() |
606 | 410 | uploadfile.parseControl(control) | 410 | uploadfile.parseControl(control) |
611 | 411 | self.assertEquals("python", uploadfile.section_name) | 411 | self.assertEqual("python", uploadfile.section_name) |
612 | 412 | self.assertEquals("dulwich", uploadfile.source_name) | 412 | self.assertEqual("dulwich", uploadfile.source_name) |
613 | 413 | self.assertEquals("0.42", uploadfile.source_version) | 413 | self.assertEqual("0.42", uploadfile.source_version) |
614 | 414 | self.assertEquals("0.42", uploadfile.control_version) | 414 | self.assertEqual("0.42", uploadfile.control_version) |
615 | 415 | 415 | ||
616 | 416 | def test_verifyFormat_control_xz(self): | 416 | def test_verifyFormat_control_xz(self): |
617 | 417 | # verifyFormat accepts .debs with an xz-compressed control member. | 417 | # verifyFormat accepts .debs with an xz-compressed control member. |
618 | @@ -452,15 +452,15 @@ | |||
619 | 452 | uploadfile.parseControl(control) | 452 | uploadfile.parseControl(control) |
620 | 453 | build = self.factory.makeBinaryPackageBuild() | 453 | build = self.factory.makeBinaryPackageBuild() |
621 | 454 | bpr = uploadfile.storeInDatabase(build) | 454 | bpr = uploadfile.storeInDatabase(build) |
624 | 455 | self.assertEquals(u'python (<< 2.7), python (>= 2.5)', bpr.depends) | 455 | self.assertEqual(u'python (<< 2.7), python (>= 2.5)', bpr.depends) |
625 | 456 | self.assertEquals( | 456 | self.assertEqual( |
626 | 457 | u"Dulwich is a Python implementation of the file formats " | 457 | u"Dulwich is a Python implementation of the file formats " |
627 | 458 | u"and protocols", bpr.description) | 458 | u"and protocols", bpr.description) |
633 | 459 | self.assertEquals(False, bpr.essential) | 459 | self.assertEqual(False, bpr.essential) |
634 | 460 | self.assertEquals(524, bpr.installedsize) | 460 | self.assertEqual(524, bpr.installedsize) |
635 | 461 | self.assertEquals(True, bpr.architecturespecific) | 461 | self.assertEqual(True, bpr.architecturespecific) |
636 | 462 | self.assertEquals(u"", bpr.recommends) | 462 | self.assertEqual(u"", bpr.recommends) |
637 | 463 | self.assertEquals("0.42", bpr.version) | 463 | self.assertEqual("0.42", bpr.version) |
638 | 464 | 464 | ||
639 | 465 | def test_user_defined_fields(self): | 465 | def test_user_defined_fields(self): |
640 | 466 | # storeInDatabase stores user defined fields. | 466 | # storeInDatabase stores user defined fields. |
641 | @@ -472,7 +472,7 @@ | |||
642 | 472 | uploadfile.parseControl(control) | 472 | uploadfile.parseControl(control) |
643 | 473 | build = self.factory.makeBinaryPackageBuild() | 473 | build = self.factory.makeBinaryPackageBuild() |
644 | 474 | bpr = uploadfile.storeInDatabase(build) | 474 | bpr = uploadfile.storeInDatabase(build) |
646 | 475 | self.assertEquals( | 475 | self.assertEqual( |
647 | 476 | [[u"Python-Version", u"2.5"]], bpr.user_defined_fields) | 476 | [[u"Python-Version", u"2.5"]], bpr.user_defined_fields) |
648 | 477 | 477 | ||
649 | 478 | def test_user_defined_fields_newlines(self): | 478 | def test_user_defined_fields_newlines(self): |
650 | @@ -485,7 +485,7 @@ | |||
651 | 485 | uploadfile.parseControl(control) | 485 | uploadfile.parseControl(control) |
652 | 486 | build = self.factory.makeBinaryPackageBuild() | 486 | build = self.factory.makeBinaryPackageBuild() |
653 | 487 | bpr = uploadfile.storeInDatabase(build) | 487 | bpr = uploadfile.storeInDatabase(build) |
655 | 488 | self.assertEquals( | 488 | self.assertEqual( |
656 | 489 | [ | 489 | [ |
657 | 490 | [u"RandomData", u"Foo\nbar\nbla\n"], | 490 | [u"RandomData", u"Foo\nbar\nbla\n"], |
658 | 491 | ], bpr.user_defined_fields) | 491 | ], bpr.user_defined_fields) |
659 | @@ -500,7 +500,7 @@ | |||
660 | 500 | uploadfile.parseControl(control) | 500 | uploadfile.parseControl(control) |
661 | 501 | build = self.factory.makeBinaryPackageBuild() | 501 | build = self.factory.makeBinaryPackageBuild() |
662 | 502 | bpr = uploadfile.storeInDatabase(build) | 502 | bpr = uploadfile.storeInDatabase(build) |
664 | 503 | self.assertEquals( | 503 | self.assertEqual( |
665 | 504 | u"http://samba.org/~jelmer/dulwich", bpr.homepage) | 504 | u"http://samba.org/~jelmer/dulwich", bpr.homepage) |
666 | 505 | 505 | ||
667 | 506 | def test_checkBuild(self): | 506 | def test_checkBuild(self): |
668 | @@ -516,7 +516,7 @@ | |||
669 | 516 | uploadfile.checkBuild(build) | 516 | uploadfile.checkBuild(build) |
670 | 517 | # checkBuild() sets the build status to FULLYBUILT and | 517 | # checkBuild() sets the build status to FULLYBUILT and |
671 | 518 | # removes the upload log. | 518 | # removes the upload log. |
673 | 519 | self.assertEquals(BuildStatus.FULLYBUILT, build.status) | 519 | self.assertEqual(BuildStatus.FULLYBUILT, build.status) |
674 | 520 | self.assertIs(None, build.upload_log) | 520 | self.assertIs(None, build.upload_log) |
675 | 521 | 521 | ||
676 | 522 | def test_checkBuild_inconsistent(self): | 522 | def test_checkBuild_inconsistent(self): |
677 | @@ -549,7 +549,7 @@ | |||
678 | 549 | control = self.getBaseControl() | 549 | control = self.getBaseControl() |
679 | 550 | control["Source"] = "foo" | 550 | control["Source"] = "foo" |
680 | 551 | uploadfile.parseControl(control) | 551 | uploadfile.parseControl(control) |
682 | 552 | self.assertEquals( | 552 | self.assertEqual( |
683 | 553 | spph.sourcepackagerelease, uploadfile.findSourcePackageRelease()) | 553 | spph.sourcepackagerelease, uploadfile.findSourcePackageRelease()) |
684 | 554 | 554 | ||
685 | 555 | def test_findSourcePackageRelease_no_spph(self): | 555 | def test_findSourcePackageRelease_no_spph(self): |
686 | @@ -594,5 +594,5 @@ | |||
687 | 594 | control = self.getBaseControl() | 594 | control = self.getBaseControl() |
688 | 595 | control["Source"] = "foo" | 595 | control["Source"] = "foo" |
689 | 596 | uploadfile.parseControl(control) | 596 | uploadfile.parseControl(control) |
691 | 597 | self.assertEquals( | 597 | self.assertEqual( |
692 | 598 | spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease()) | 598 | spph2.sourcepackagerelease, uploadfile.findSourcePackageRelease()) |
693 | 599 | 599 | ||
694 | === modified file 'lib/lp/archiveuploader/tests/test_ppauploadprocessor.py' | |||
695 | --- lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2016-07-02 07:55:26 +0000 | |||
696 | +++ lib/lp/archiveuploader/tests/test_ppauploadprocessor.py 2018-01-02 16:24:23 +0000 | |||
697 | @@ -1146,7 +1146,7 @@ | |||
698 | 1146 | # primary archive. | 1146 | # primary archive. |
699 | 1147 | upload_dir = self.queueUpload( | 1147 | upload_dir = self.queueUpload( |
700 | 1148 | "bar_1.0-2_3.0-quilt_without_orig", "~name16/ubuntu") | 1148 | "bar_1.0-2_3.0-quilt_without_orig", "~name16/ubuntu") |
702 | 1149 | self.assertEquals( | 1149 | self.assertEqual( |
703 | 1150 | self.processUpload(self.uploadprocessor, upload_dir), | 1150 | self.processUpload(self.uploadprocessor, upload_dir), |
704 | 1151 | ['accepted']) | 1151 | ['accepted']) |
705 | 1152 | 1152 | ||
706 | 1153 | 1153 | ||
707 | === modified file 'lib/lp/archiveuploader/tests/test_recipeuploads.py' | |||
708 | --- lib/lp/archiveuploader/tests/test_recipeuploads.py 2015-04-20 15:59:52 +0000 | |||
709 | +++ lib/lp/archiveuploader/tests/test_recipeuploads.py 2018-01-02 16:24:23 +0000 | |||
710 | @@ -60,7 +60,7 @@ | |||
711 | 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) |
712 | 61 | self.layer.txn.commit() | 61 | self.layer.txn.commit() |
713 | 62 | 62 | ||
715 | 63 | self.assertEquals(UploadStatusEnum.ACCEPTED, result, | 63 | self.assertEqual(UploadStatusEnum.ACCEPTED, result, |
716 | 64 | "Source upload failed\nGot: %s" % self.log.getLogBuffer()) | 64 | "Source upload failed\nGot: %s" % self.log.getLogBuffer()) |
717 | 65 | 65 | ||
718 | 66 | self.assertEqual(BuildStatus.FULLYBUILT, self.build.status) | 66 | self.assertEqual(BuildStatus.FULLYBUILT, self.build.status) |
719 | 67 | 67 | ||
720 | === modified file 'lib/lp/archiveuploader/tests/test_uploadpolicy.py' | |||
721 | --- lib/lp/archiveuploader/tests/test_uploadpolicy.py 2017-05-02 23:02:41 +0000 | |||
722 | +++ lib/lp/archiveuploader/tests/test_uploadpolicy.py 2018-01-02 16:24:23 +0000 | |||
723 | @@ -70,7 +70,7 @@ | |||
724 | 70 | 70 | ||
725 | 71 | policy.validateUploadType(upload) | 71 | policy.validateUploadType(upload) |
726 | 72 | 72 | ||
728 | 73 | self.assertEquals([], upload.rejections) | 73 | self.assertEqual([], upload.rejections) |
729 | 74 | 74 | ||
730 | 75 | def test_binaryful_accepted(self): | 75 | def test_binaryful_accepted(self): |
731 | 76 | policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY) | 76 | policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY) |
732 | @@ -78,7 +78,7 @@ | |||
733 | 78 | 78 | ||
734 | 79 | policy.validateUploadType(upload) | 79 | policy.validateUploadType(upload) |
735 | 80 | 80 | ||
737 | 81 | self.assertEquals([], upload.rejections) | 81 | self.assertEqual([], upload.rejections) |
738 | 82 | 82 | ||
739 | 83 | def test_mixed_accepted(self): | 83 | def test_mixed_accepted(self): |
740 | 84 | policy = make_policy(accepted_type=ArchiveUploadType.MIXED_ONLY) | 84 | policy = make_policy(accepted_type=ArchiveUploadType.MIXED_ONLY) |
741 | @@ -86,7 +86,7 @@ | |||
742 | 86 | 86 | ||
743 | 87 | policy.validateUploadType(upload) | 87 | policy.validateUploadType(upload) |
744 | 88 | 88 | ||
746 | 89 | self.assertEquals([], upload.rejections) | 89 | self.assertEqual([], upload.rejections) |
747 | 90 | 90 | ||
748 | 91 | def test_sourceful_not_accepted(self): | 91 | def test_sourceful_not_accepted(self): |
749 | 92 | policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY) | 92 | policy = make_policy(accepted_type=ArchiveUploadType.BINARY_ONLY) |
750 | 93 | 93 | ||
751 | === modified file 'lib/lp/archiveuploader/tests/test_uploadprocessor.py' | |||
752 | --- lib/lp/archiveuploader/tests/test_uploadprocessor.py 2017-09-17 10:35:57 +0000 | |||
753 | +++ lib/lp/archiveuploader/tests/test_uploadprocessor.py 2018-01-02 16:24:23 +0000 | |||
754 | @@ -1778,7 +1778,7 @@ | |||
755 | 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) |
756 | 1779 | spph = self.publishPackage("bar", "1.0-1") | 1779 | spph = self.publishPackage("bar", "1.0-1") |
757 | 1780 | 1780 | ||
759 | 1781 | self.assertEquals( | 1781 | self.assertEqual( |
760 | 1782 | sorted((sprf.libraryfile.filename, sprf.filetype) | 1782 | sorted((sprf.libraryfile.filename, sprf.filetype) |
761 | 1783 | for sprf in spph.sourcepackagerelease.files), | 1783 | for sprf in spph.sourcepackagerelease.files), |
762 | 1784 | [('bar_1.0-1.debian.tar.bz2', | 1784 | [('bar_1.0-1.debian.tar.bz2', |
763 | @@ -1819,11 +1819,11 @@ | |||
764 | 1819 | 1819 | ||
765 | 1820 | # Upload another source sharing the same (component) orig. | 1820 | # Upload another source sharing the same (component) orig. |
766 | 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") |
768 | 1822 | self.assertEquals( | 1822 | self.assertEqual( |
769 | 1823 | self.processUpload(uploadprocessor, upload_dir), ['accepted']) | 1823 | self.processUpload(uploadprocessor, upload_dir), ['accepted']) |
770 | 1824 | 1824 | ||
771 | 1825 | queue_item = uploadprocessor.last_processed_upload.queue_root | 1825 | queue_item = uploadprocessor.last_processed_upload.queue_root |
773 | 1826 | self.assertEquals( | 1826 | self.assertEqual( |
774 | 1827 | sorted((sprf.libraryfile.filename, sprf.filetype) for sprf | 1827 | sorted((sprf.libraryfile.filename, sprf.filetype) for sprf |
775 | 1828 | in queue_item.sources[0].sourcepackagerelease.files), | 1828 | in queue_item.sources[0].sourcepackagerelease.files), |
776 | 1829 | [('bar_1.0-2.debian.tar.bz2', | 1829 | [('bar_1.0-2.debian.tar.bz2', |
777 | @@ -1859,7 +1859,7 @@ | |||
778 | 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) |
779 | 1860 | spph = self.publishPackage("bar", "1.0") | 1860 | spph = self.publishPackage("bar", "1.0") |
780 | 1861 | 1861 | ||
782 | 1862 | self.assertEquals( | 1862 | self.assertEqual( |
783 | 1863 | sorted((sprf.libraryfile.filename, sprf.filetype) | 1863 | sorted((sprf.libraryfile.filename, sprf.filetype) |
784 | 1864 | for sprf in spph.sourcepackagerelease.files), | 1864 | for sprf in spph.sourcepackagerelease.files), |
785 | 1865 | [('bar_1.0.dsc', | 1865 | [('bar_1.0.dsc', |
786 | @@ -2194,10 +2194,9 @@ | |||
787 | 2194 | self.options.builds = True | 2194 | self.options.builds = True |
788 | 2195 | BuildUploadHandler(self.uploadprocessor, self.incoming_folder, | 2195 | BuildUploadHandler(self.uploadprocessor, self.incoming_folder, |
789 | 2196 | leaf_name).process() | 2196 | leaf_name).process() |
794 | 2197 | self.assertEquals(1, len(self.oopses)) | 2197 | self.assertEqual(1, len(self.oopses)) |
795 | 2198 | self.assertEquals( | 2198 | self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status) |
796 | 2199 | BuildStatus.FAILEDTOUPLOAD, build.status) | 2199 | self.assertEqual(builder, build.builder) |
793 | 2200 | self.assertEquals(builder, build.builder) | ||
797 | 2201 | self.assertIsNot(None, build.duration) | 2200 | self.assertIsNot(None, build.duration) |
798 | 2202 | log_contents = build.upload_log.read() | 2201 | log_contents = build.upload_log.read() |
799 | 2203 | self.assertTrue('ERROR Exception while processing upload ' | 2202 | self.assertTrue('ERROR Exception while processing upload ' |
800 | @@ -2254,7 +2253,7 @@ | |||
801 | 2254 | build = self.factory.makeSourcePackageRecipeBuild(sourcename=u"bar", | 2253 | build = self.factory.makeSourcePackageRecipeBuild(sourcename=u"bar", |
802 | 2255 | distroseries=self.breezy, archive=archive, | 2254 | distroseries=self.breezy, archive=archive, |
803 | 2256 | requester=archive.owner) | 2255 | requester=archive.owner) |
805 | 2257 | self.assertEquals(archive.owner, build.requester) | 2256 | self.assertEqual(archive.owner, build.requester) |
806 | 2258 | self.switchToUploader() | 2257 | self.switchToUploader() |
807 | 2259 | # Commit so the build cookie has the right ids. | 2258 | # Commit so the build cookie has the right ids. |
808 | 2260 | self.layer.txn.commit() | 2259 | self.layer.txn.commit() |
809 | @@ -2279,8 +2278,8 @@ | |||
810 | 2279 | # Properly uploaded source packages should result in the | 2278 | # Properly uploaded source packages should result in the |
811 | 2280 | # build status changing to FULLYBUILT. | 2279 | # build status changing to FULLYBUILT. |
812 | 2281 | build = self.doSuccessRecipeBuild() | 2280 | build = self.doSuccessRecipeBuild() |
815 | 2282 | self.assertEquals(BuildStatus.FULLYBUILT, build.status) | 2281 | self.assertEqual(BuildStatus.FULLYBUILT, build.status) |
816 | 2283 | self.assertEquals(None, build.builder) | 2282 | self.assertIsNone(build.builder) |
817 | 2284 | self.assertIsNot(None, build.duration) | 2283 | self.assertIsNot(None, build.duration) |
818 | 2285 | # Upon full build the upload log is unset. | 2284 | # Upon full build the upload log is unset. |
819 | 2286 | self.assertIs(None, build.upload_log) | 2285 | self.assertIs(None, build.upload_log) |
820 | @@ -2319,8 +2318,8 @@ | |||
821 | 2319 | 2318 | ||
822 | 2320 | def testSourcePackageRecipeBuild_fail(self): | 2319 | def testSourcePackageRecipeBuild_fail(self): |
823 | 2321 | build = self.doFailureRecipeBuild() | 2320 | build = self.doFailureRecipeBuild() |
826 | 2322 | self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status) | 2321 | self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status) |
827 | 2323 | self.assertEquals(None, build.builder) | 2322 | self.assertIsNone(build.builder) |
828 | 2324 | self.assertIsNot(None, build.duration) | 2323 | self.assertIsNot(None, build.duration) |
829 | 2325 | self.assertIsNot(None, build.upload_log) | 2324 | self.assertIsNot(None, build.upload_log) |
830 | 2326 | 2325 | ||
831 | @@ -2366,8 +2365,8 @@ | |||
832 | 2366 | 2365 | ||
833 | 2367 | def testSourcePackageRecipeBuild_deleted_recipe(self): | 2366 | def testSourcePackageRecipeBuild_deleted_recipe(self): |
834 | 2368 | build = self.doDeletedRecipeBuild() | 2367 | build = self.doDeletedRecipeBuild() |
837 | 2369 | self.assertEquals(BuildStatus.FAILEDTOUPLOAD, build.status) | 2368 | self.assertEqual(BuildStatus.FAILEDTOUPLOAD, build.status) |
838 | 2370 | self.assertEquals(None, build.builder) | 2369 | self.assertIsNone(build.builder) |
839 | 2371 | self.assertIsNot(None, build.duration) | 2370 | self.assertIsNot(None, build.duration) |
840 | 2372 | self.assertIs(None, build.upload_log) | 2371 | self.assertIs(None, build.upload_log) |
841 | 2373 | 2372 | ||
842 | @@ -2437,7 +2436,7 @@ | |||
843 | 2437 | # The build status is not changed | 2436 | # The build status is not changed |
844 | 2438 | self.assertTrue( | 2437 | self.assertTrue( |
845 | 2439 | os.path.exists(os.path.join(self.incoming_folder, leaf_name))) | 2438 | os.path.exists(os.path.join(self.incoming_folder, leaf_name))) |
847 | 2440 | self.assertEquals(BuildStatus.BUILDING, build.status) | 2439 | self.assertEqual(BuildStatus.BUILDING, build.status) |
848 | 2441 | self.assertLogContains("Build status is BUILDING. Ignoring.") | 2440 | self.assertLogContains("Build status is BUILDING. Ignoring.") |
849 | 2442 | 2441 | ||
850 | 2443 | def testBuildWithInvalidStatus(self): | 2442 | def testBuildWithInvalidStatus(self): |
851 | @@ -2451,7 +2450,7 @@ | |||
852 | 2451 | os.path.exists(os.path.join(self.incoming_folder, leaf_name))) | 2450 | os.path.exists(os.path.join(self.incoming_folder, leaf_name))) |
853 | 2452 | self.assertTrue( | 2451 | self.assertTrue( |
854 | 2453 | os.path.exists(os.path.join(self.failed_folder, leaf_name))) | 2452 | os.path.exists(os.path.join(self.failed_folder, leaf_name))) |
856 | 2454 | self.assertEquals(BuildStatus.NEEDSBUILD, build.status) | 2453 | self.assertEqual(BuildStatus.NEEDSBUILD, build.status) |
857 | 2455 | self.assertLogContains( | 2454 | self.assertLogContains( |
858 | 2456 | "Expected build status to be UPLOADING or BUILDING, was " | 2455 | "Expected build status to be UPLOADING or BUILDING, was " |
859 | 2457 | "NEEDSBUILD.") | 2456 | "NEEDSBUILD.") |
860 | @@ -2486,7 +2485,7 @@ | |||
861 | 2486 | """Tests for parse_build_upload_leaf_name.""" | 2485 | """Tests for parse_build_upload_leaf_name.""" |
862 | 2487 | 2486 | ||
863 | 2488 | def test_valid(self): | 2487 | def test_valid(self): |
865 | 2489 | self.assertEquals( | 2488 | self.assertEqual( |
866 | 2490 | ('PACKAGEBUILD', 60), | 2489 | ('PACKAGEBUILD', 60), |
867 | 2491 | parse_build_upload_leaf_name("20100812-PACKAGEBUILD-60")) | 2490 | parse_build_upload_leaf_name("20100812-PACKAGEBUILD-60")) |
868 | 2492 | 2491 | ||
869 | 2493 | 2492 | ||
870 | === modified file 'lib/lp/archiveuploader/tests/test_utils.py' | |||
871 | --- lib/lp/archiveuploader/tests/test_utils.py 2016-06-01 01:59:32 +0000 | |||
872 | +++ lib/lp/archiveuploader/tests/test_utils.py 2018-01-02 16:24:23 +0000 | |||
873 | @@ -30,116 +30,116 @@ | |||
874 | 30 | """lp.archiveuploader.utils.determine_source_file_type should work.""" | 30 | """lp.archiveuploader.utils.determine_source_file_type should work.""" |
875 | 31 | 31 | ||
876 | 32 | # .dsc -> DSC | 32 | # .dsc -> DSC |
878 | 33 | self.assertEquals( | 33 | self.assertEqual( |
879 | 34 | determine_source_file_type('foo_1.0-1.dsc'), | 34 | determine_source_file_type('foo_1.0-1.dsc'), |
880 | 35 | SourcePackageFileType.DSC) | 35 | SourcePackageFileType.DSC) |
881 | 36 | 36 | ||
882 | 37 | # .diff.gz -> DIFF | 37 | # .diff.gz -> DIFF |
884 | 38 | self.assertEquals( | 38 | self.assertEqual( |
885 | 39 | determine_source_file_type('foo_1.0-1.diff.gz'), | 39 | determine_source_file_type('foo_1.0-1.diff.gz'), |
886 | 40 | SourcePackageFileType.DIFF) | 40 | SourcePackageFileType.DIFF) |
887 | 41 | 41 | ||
888 | 42 | # DIFFs can only be gzipped. | 42 | # DIFFs can only be gzipped. |
890 | 43 | self.assertEquals( | 43 | self.assertEqual( |
891 | 44 | determine_source_file_type('foo_1.0.diff.bz2'), None) | 44 | determine_source_file_type('foo_1.0.diff.bz2'), None) |
892 | 45 | 45 | ||
893 | 46 | # Plain original tarballs can be gzipped or bzip2ed. | 46 | # Plain original tarballs can be gzipped or bzip2ed. |
895 | 47 | self.assertEquals( | 47 | self.assertEqual( |
896 | 48 | determine_source_file_type('foo_1.0.orig.tar.gz'), | 48 | determine_source_file_type('foo_1.0.orig.tar.gz'), |
897 | 49 | SourcePackageFileType.ORIG_TARBALL) | 49 | SourcePackageFileType.ORIG_TARBALL) |
899 | 50 | self.assertEquals( | 50 | self.assertEqual( |
900 | 51 | determine_source_file_type('foo_1.0.orig.tar.bz2'), | 51 | determine_source_file_type('foo_1.0.orig.tar.bz2'), |
901 | 52 | SourcePackageFileType.ORIG_TARBALL) | 52 | SourcePackageFileType.ORIG_TARBALL) |
903 | 53 | self.assertEquals( | 53 | self.assertEqual( |
904 | 54 | determine_source_file_type('foo_1.0.orig.tar.xz'), | 54 | determine_source_file_type('foo_1.0.orig.tar.xz'), |
905 | 55 | SourcePackageFileType.ORIG_TARBALL) | 55 | SourcePackageFileType.ORIG_TARBALL) |
906 | 56 | 56 | ||
907 | 57 | # Component original tarballs too. | 57 | # Component original tarballs too. |
909 | 58 | self.assertEquals( | 58 | self.assertEqual( |
910 | 59 | determine_source_file_type('foo_1.0.orig-foo.tar.gz'), | 59 | determine_source_file_type('foo_1.0.orig-foo.tar.gz'), |
911 | 60 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) | 60 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) |
913 | 61 | self.assertEquals( | 61 | self.assertEqual( |
914 | 62 | determine_source_file_type('foo_1.0.orig-bar.tar.bz2'), | 62 | determine_source_file_type('foo_1.0.orig-bar.tar.bz2'), |
915 | 63 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) | 63 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) |
917 | 64 | self.assertEquals( | 64 | self.assertEqual( |
918 | 65 | determine_source_file_type('foo_1.0.orig-bar.tar.xz'), | 65 | determine_source_file_type('foo_1.0.orig-bar.tar.xz'), |
919 | 66 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) | 66 | SourcePackageFileType.COMPONENT_ORIG_TARBALL) |
920 | 67 | 67 | ||
921 | 68 | # And Debian tarballs... | 68 | # And Debian tarballs... |
923 | 69 | self.assertEquals( | 69 | self.assertEqual( |
924 | 70 | determine_source_file_type('foo_1.0-1.debian.tar.gz'), | 70 | determine_source_file_type('foo_1.0-1.debian.tar.gz'), |
925 | 71 | SourcePackageFileType.DEBIAN_TARBALL) | 71 | SourcePackageFileType.DEBIAN_TARBALL) |
927 | 72 | self.assertEquals( | 72 | self.assertEqual( |
928 | 73 | determine_source_file_type('foo_1.0-2.debian.tar.bz2'), | 73 | determine_source_file_type('foo_1.0-2.debian.tar.bz2'), |
929 | 74 | SourcePackageFileType.DEBIAN_TARBALL) | 74 | SourcePackageFileType.DEBIAN_TARBALL) |
931 | 75 | self.assertEquals( | 75 | self.assertEqual( |
932 | 76 | determine_source_file_type('foo_1.0-2.debian.tar.xz'), | 76 | determine_source_file_type('foo_1.0-2.debian.tar.xz'), |
933 | 77 | SourcePackageFileType.DEBIAN_TARBALL) | 77 | SourcePackageFileType.DEBIAN_TARBALL) |
934 | 78 | 78 | ||
935 | 79 | # And even native tarballs! | 79 | # And even native tarballs! |
937 | 80 | self.assertEquals( | 80 | self.assertEqual( |
938 | 81 | determine_source_file_type('foo_1.0.tar.gz'), | 81 | determine_source_file_type('foo_1.0.tar.gz'), |
939 | 82 | SourcePackageFileType.NATIVE_TARBALL) | 82 | SourcePackageFileType.NATIVE_TARBALL) |
941 | 83 | self.assertEquals( | 83 | self.assertEqual( |
942 | 84 | determine_source_file_type('foo_1.0.tar.bz2'), | 84 | determine_source_file_type('foo_1.0.tar.bz2'), |
943 | 85 | SourcePackageFileType.NATIVE_TARBALL) | 85 | SourcePackageFileType.NATIVE_TARBALL) |
945 | 86 | self.assertEquals( | 86 | self.assertEqual( |
946 | 87 | determine_source_file_type('foo_1.0.tar.xz'), | 87 | determine_source_file_type('foo_1.0.tar.xz'), |
947 | 88 | SourcePackageFileType.NATIVE_TARBALL) | 88 | SourcePackageFileType.NATIVE_TARBALL) |
948 | 89 | 89 | ||
949 | 90 | # (Component) original tarball signatures are detected for any | 90 | # (Component) original tarball signatures are detected for any |
950 | 91 | # supported compression method. | 91 | # supported compression method. |
952 | 92 | self.assertEquals( | 92 | self.assertEqual( |
953 | 93 | determine_source_file_type('foo_1.0.orig.tar.gz.asc'), | 93 | determine_source_file_type('foo_1.0.orig.tar.gz.asc'), |
954 | 94 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) | 94 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) |
956 | 95 | self.assertEquals( | 95 | self.assertEqual( |
957 | 96 | determine_source_file_type('foo_1.0.orig.tar.bz2.asc'), | 96 | determine_source_file_type('foo_1.0.orig.tar.bz2.asc'), |
958 | 97 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) | 97 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) |
960 | 98 | self.assertEquals( | 98 | self.assertEqual( |
961 | 99 | determine_source_file_type('foo_1.0.orig.tar.xz.asc'), | 99 | determine_source_file_type('foo_1.0.orig.tar.xz.asc'), |
962 | 100 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) | 100 | SourcePackageFileType.ORIG_TARBALL_SIGNATURE) |
964 | 101 | self.assertEquals( | 101 | self.assertEqual( |
965 | 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'), |
966 | 103 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) | 103 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) |
968 | 104 | self.assertEquals( | 104 | self.assertEqual( |
969 | 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'), |
970 | 106 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) | 106 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) |
972 | 107 | self.assertEquals( | 107 | self.assertEqual( |
973 | 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'), |
974 | 109 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) | 109 | SourcePackageFileType.COMPONENT_ORIG_TARBALL_SIGNATURE) |
975 | 110 | 110 | ||
978 | 111 | self.assertEquals(None, determine_source_file_type('foo_1.0')) | 111 | self.assertIsNone(determine_source_file_type('foo_1.0')) |
979 | 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')) |
980 | 113 | 113 | ||
981 | 114 | def test_determine_binary_file_type(self): | 114 | def test_determine_binary_file_type(self): |
982 | 115 | """lp.archiveuploader.utils.determine_binary_file_type should work.""" | 115 | """lp.archiveuploader.utils.determine_binary_file_type should work.""" |
983 | 116 | # .deb -> DEB | 116 | # .deb -> DEB |
985 | 117 | self.assertEquals( | 117 | self.assertEqual( |
986 | 118 | determine_binary_file_type('foo_1.0-1_all.deb'), | 118 | determine_binary_file_type('foo_1.0-1_all.deb'), |
987 | 119 | BinaryPackageFileType.DEB) | 119 | BinaryPackageFileType.DEB) |
988 | 120 | 120 | ||
989 | 121 | # .ddeb -> DDEB | 121 | # .ddeb -> DDEB |
991 | 122 | self.assertEquals( | 122 | self.assertEqual( |
992 | 123 | determine_binary_file_type('foo_1.0-1_all.ddeb'), | 123 | determine_binary_file_type('foo_1.0-1_all.ddeb'), |
993 | 124 | BinaryPackageFileType.DDEB) | 124 | BinaryPackageFileType.DDEB) |
994 | 125 | 125 | ||
995 | 126 | # .udeb -> UDEB | 126 | # .udeb -> UDEB |
997 | 127 | self.assertEquals( | 127 | self.assertEqual( |
998 | 128 | determine_binary_file_type('foo_1.0-1_all.udeb'), | 128 | determine_binary_file_type('foo_1.0-1_all.udeb'), |
999 | 129 | BinaryPackageFileType.UDEB) | 129 | BinaryPackageFileType.UDEB) |
1000 | 130 | 130 | ||
1003 | 131 | self.assertEquals(determine_binary_file_type('foo_1.0'), None) | 131 | self.assertEqual(determine_binary_file_type('foo_1.0'), None) |
1004 | 132 | self.assertEquals(determine_binary_file_type('foo_1.0.notdeb'), None) | 132 | self.assertEqual(determine_binary_file_type('foo_1.0.notdeb'), None) |
1005 | 133 | 133 | ||
1006 | 134 | def testPrefixMultilineString(self): | 134 | def testPrefixMultilineString(self): |
1007 | 135 | """lp.archiveuploader.utils.prefix_multi_line_string should work""" | 135 | """lp.archiveuploader.utils.prefix_multi_line_string should work""" |
1008 | 136 | from lp.archiveuploader.utils import prefix_multi_line_string | 136 | from lp.archiveuploader.utils import prefix_multi_line_string |
1015 | 137 | self.assertEquals("A:foo\nA:bar", | 137 | self.assertEqual("A:foo\nA:bar", |
1016 | 138 | prefix_multi_line_string("foo\nbar", "A:")) | 138 | prefix_multi_line_string("foo\nbar", "A:")) |
1017 | 139 | self.assertEquals("A:foo\nA:bar", | 139 | self.assertEqual("A:foo\nA:bar", |
1018 | 140 | prefix_multi_line_string("foo\n\nbar", "A:")) | 140 | prefix_multi_line_string("foo\n\nbar", "A:")) |
1019 | 141 | self.assertEquals("A:foo\nA:\nA:bar", | 141 | self.assertEqual("A:foo\nA:\nA:bar", |
1020 | 142 | prefix_multi_line_string("foo\n\nbar", "A:", 1)) | 142 | prefix_multi_line_string("foo\n\nbar", "A:", 1)) |
1021 | 143 | 143 | ||
1022 | 144 | def testExtractComponent(self): | 144 | def testExtractComponent(self): |
1023 | 145 | """lp.archiveuploader.utils.extract_component_from_section should work | 145 | """lp.archiveuploader.utils.extract_component_from_section should work |
1024 | @@ -147,21 +147,21 @@ | |||
1025 | 147 | from lp.archiveuploader.utils import extract_component_from_section | 147 | from lp.archiveuploader.utils import extract_component_from_section |
1026 | 148 | 148 | ||
1027 | 149 | (sect, comp) = extract_component_from_section("libs") | 149 | (sect, comp) = extract_component_from_section("libs") |
1030 | 150 | self.assertEquals(sect, "libs") | 150 | self.assertEqual(sect, "libs") |
1031 | 151 | self.assertEquals(comp, "main") | 151 | self.assertEqual(comp, "main") |
1032 | 152 | 152 | ||
1033 | 153 | (sect, comp) = extract_component_from_section("restricted/libs") | 153 | (sect, comp) = extract_component_from_section("restricted/libs") |
1036 | 154 | self.assertEquals(sect, "libs") | 154 | self.assertEqual(sect, "libs") |
1037 | 155 | self.assertEquals(comp, "restricted") | 155 | self.assertEqual(comp, "restricted") |
1038 | 156 | 156 | ||
1039 | 157 | (sect, comp) = extract_component_from_section("libs", "multiverse") | 157 | (sect, comp) = extract_component_from_section("libs", "multiverse") |
1042 | 158 | self.assertEquals(sect, "libs") | 158 | self.assertEqual(sect, "libs") |
1043 | 159 | self.assertEquals(comp, "multiverse") | 159 | self.assertEqual(comp, "multiverse") |
1044 | 160 | 160 | ||
1045 | 161 | (sect, comp) = extract_component_from_section("restricted/libs", | 161 | (sect, comp) = extract_component_from_section("restricted/libs", |
1046 | 162 | "multiverse") | 162 | "multiverse") |
1049 | 163 | self.assertEquals(sect, "libs") | 163 | self.assertEqual(sect, "libs") |
1050 | 164 | self.assertEquals(comp, "restricted") | 164 | self.assertEqual(comp, "restricted") |
1051 | 165 | 165 | ||
1052 | 166 | def testParseMaintainerOkay(self): | 166 | def testParseMaintainerOkay(self): |
1053 | 167 | """lp.archiveuploader.utils.parse_maintainer should parse correctly | 167 | """lp.archiveuploader.utils.parse_maintainer should parse correctly |
1054 | @@ -224,9 +224,9 @@ | |||
1055 | 224 | 224 | ||
1056 | 225 | for case in cases: | 225 | for case in cases: |
1057 | 226 | (name, email) = parse_maintainer_bytes(case[0], 'Maintainer') | 226 | (name, email) = parse_maintainer_bytes(case[0], 'Maintainer') |
1061 | 227 | self.assertEquals(case[2], name) | 227 | self.assertEqual(case[2], name) |
1062 | 228 | self.assertEquals(case[3], email) | 228 | self.assertEqual(case[3], email) |
1063 | 229 | self.assertEquals(case[1], rfc822_encode_address(name, email)) | 229 | self.assertEqual(case[1], rfc822_encode_address(name, email)) |
1064 | 230 | 230 | ||
1065 | 231 | def testParseMaintainerRaises(self): | 231 | def testParseMaintainerRaises(self): |
1066 | 232 | """lp.archiveuploader.utils.parse_maintainer should raise on incorrect | 232 | """lp.archiveuploader.utils.parse_maintainer should raise on incorrect |
1067 | @@ -251,7 +251,7 @@ | |||
1068 | 251 | def test_re_isadeb(self): | 251 | def test_re_isadeb(self): |
1069 | 252 | # Verify that the three binary extensions match the regexp. | 252 | # Verify that the three binary extensions match the regexp. |
1070 | 253 | for extension in ('deb', 'ddeb', 'udeb'): | 253 | for extension in ('deb', 'ddeb', 'udeb'): |
1072 | 254 | self.assertEquals( | 254 | self.assertEqual( |
1073 | 255 | ('foo-bar', '1.0', 'i386', extension), | 255 | ('foo-bar', '1.0', 'i386', extension), |
1074 | 256 | re_isadeb.match('foo-bar_1.0_i386.%s' % extension).groups()) | 256 | re_isadeb.match('foo-bar_1.0_i386.%s' % extension).groups()) |
1075 | 257 | 257 | ||
1076 | @@ -270,13 +270,13 @@ | |||
1077 | 270 | 'orig-foo_bar.tar.gz', | 270 | 'orig-foo_bar.tar.gz', |
1078 | 271 | 'debian.tar.gz', 'debian.tar.bz2', 'debian.tar.xz') | 271 | 'debian.tar.gz', 'debian.tar.bz2', 'debian.tar.xz') |
1079 | 272 | for extension in extensions: | 272 | for extension in extensions: |
1081 | 273 | self.assertEquals( | 273 | self.assertEqual( |
1082 | 274 | ('foo-bar', '1.0', extension), | 274 | ('foo-bar', '1.0', extension), |
1083 | 275 | re_issource.match('foo-bar_1.0.%s' % extension).groups()) | 275 | re_issource.match('foo-bar_1.0.%s' % extension).groups()) |
1084 | 276 | 276 | ||
1085 | 277 | # While orig-*.tar.gz is all interpreted as extension, *orig-*.tar.gz | 277 | # While orig-*.tar.gz is all interpreted as extension, *orig-*.tar.gz |
1086 | 278 | # is taken to have an extension of just 'tar.gz'. | 278 | # is taken to have an extension of just 'tar.gz'. |
1088 | 279 | self.assertEquals( | 279 | self.assertEqual( |
1089 | 280 | ('foo-bar', '1.0.porig-bar', 'tar.gz'), | 280 | ('foo-bar', '1.0.porig-bar', 'tar.gz'), |
1090 | 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()) |
1091 | 282 | 282 | ||
1092 | @@ -301,7 +301,7 @@ | |||
1093 | 301 | extract_dpkg_source( | 301 | extract_dpkg_source( |
1094 | 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')), |
1095 | 303 | temp_dir) | 303 | temp_dir) |
1097 | 304 | self.assertEquals(["bar-1.0"], os.listdir(temp_dir)) | 304 | self.assertEqual(["bar-1.0"], os.listdir(temp_dir)) |
1098 | 305 | self.assertContentEqual( | 305 | self.assertContentEqual( |
1099 | 306 | ["THIS_IS_BAR", "debian"], | 306 | ["THIS_IS_BAR", "debian"], |
1100 | 307 | os.listdir(os.path.join(temp_dir, "bar-1.0"))) | 307 | os.listdir(os.path.join(temp_dir, "bar-1.0"))) |
1101 | @@ -311,4 +311,4 @@ | |||
1102 | 311 | err = self.assertRaises( | 311 | err = self.assertRaises( |
1103 | 312 | DpkgSourceError, extract_dpkg_source, | 312 | DpkgSourceError, extract_dpkg_source, |
1104 | 313 | "thispathdoesntexist", temp_dir) | 313 | "thispathdoesntexist", temp_dir) |
1106 | 314 | self.assertEquals(2, err.result) | 314 | self.assertEqual(2, err.result) |
1107 | 315 | 315 | ||
1108 | === modified file 'lib/lp/blueprints/browser/tests/test_breadcrumbs.py' | |||
1109 | --- lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2017-10-25 13:10:41 +0000 | |||
1110 | +++ lib/lp/blueprints/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000 | |||
1111 | @@ -27,15 +27,15 @@ | |||
1112 | 27 | crumbs = self.getBreadcrumbsForObject( | 27 | crumbs = self.getBreadcrumbsForObject( |
1113 | 28 | self.product, rootsite='blueprints') | 28 | self.product, rootsite='blueprints') |
1114 | 29 | last_crumb = crumbs[-1] | 29 | last_crumb = crumbs[-1] |
1117 | 30 | self.assertEquals(last_crumb.url, self.product_specs_url) | 30 | self.assertEqual(last_crumb.url, self.product_specs_url) |
1118 | 31 | self.assertEquals(last_crumb.text, 'Blueprints') | 31 | self.assertEqual(last_crumb.text, 'Blueprints') |
1119 | 32 | 32 | ||
1120 | 33 | def test_person(self): | 33 | def test_person(self): |
1121 | 34 | crumbs = self.getBreadcrumbsForObject( | 34 | crumbs = self.getBreadcrumbsForObject( |
1122 | 35 | self.person, rootsite='blueprints') | 35 | self.person, rootsite='blueprints') |
1123 | 36 | last_crumb = crumbs[-1] | 36 | last_crumb = crumbs[-1] |
1126 | 37 | self.assertEquals(last_crumb.url, self.person_specs_url) | 37 | self.assertEqual(last_crumb.url, self.person_specs_url) |
1127 | 38 | self.assertEquals(last_crumb.text, 'Blueprints') | 38 | self.assertEqual(last_crumb.text, 'Blueprints') |
1128 | 39 | 39 | ||
1129 | 40 | 40 | ||
1130 | 41 | class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase): | 41 | class TestSpecificationBreadcrumb(BaseBreadcrumbTestCase): |
1131 | @@ -53,6 +53,5 @@ | |||
1132 | 53 | def test_specification(self): | 53 | def test_specification(self): |
1133 | 54 | crumbs = self.getBreadcrumbsForObject(self.specification) | 54 | crumbs = self.getBreadcrumbsForObject(self.specification) |
1134 | 55 | last_crumb = crumbs[-1] | 55 | last_crumb = crumbs[-1] |
1138 | 56 | self.assertEquals(last_crumb.url, self.specification_url) | 56 | self.assertEqual(last_crumb.url, self.specification_url) |
1139 | 57 | self.assertEquals( | 57 | self.assertEqual(last_crumb.text, self.specification.title) |
1137 | 58 | last_crumb.text, self.specification.title) | ||
1140 | 59 | 58 | ||
1141 | === modified file 'lib/lp/blueprints/model/tests/test_specification.py' | |||
1142 | --- lib/lp/blueprints/model/tests/test_specification.py 2017-10-25 13:10:41 +0000 | |||
1143 | +++ lib/lp/blueprints/model/tests/test_specification.py 2018-01-02 16:24:23 +0000 | |||
1144 | @@ -495,7 +495,7 @@ | |||
1145 | 495 | assignee=None, milestone=milestone) | 495 | assignee=None, milestone=milestone) |
1146 | 496 | 496 | ||
1147 | 497 | # We start with no work items. | 497 | # We start with no work items. |
1149 | 498 | self.assertEquals([], list(spec.work_items)) | 498 | self.assertEqual([], list(spec.work_items)) |
1150 | 499 | 499 | ||
1151 | 500 | login_person(spec.owner) | 500 | login_person(spec.owner) |
1152 | 501 | spec.updateWorkItems([work_item1_data, work_item2_data]) | 501 | spec.updateWorkItems([work_item1_data, work_item2_data]) |
1153 | 502 | 502 | ||
1154 | === modified file 'lib/lp/bugs/adapters/tests/test_bugchange.py' | |||
1155 | --- lib/lp/bugs/adapters/tests/test_bugchange.py 2012-03-13 00:45:33 +0000 | |||
1156 | +++ lib/lp/bugs/adapters/tests/test_bugchange.py 2018-01-02 16:24:23 +0000 | |||
1157 | @@ -71,8 +71,7 @@ | |||
1158 | 71 | 71 | ||
1159 | 72 | change = list(get_bug_changes(bug_delta))[0] | 72 | change = list(get_bug_changes(bug_delta))[0] |
1160 | 73 | self.assertTrue(isinstance(change, BugDescriptionChange)) | 73 | self.assertTrue(isinstance(change, BugDescriptionChange)) |
1163 | 74 | self.assertEquals( | 74 | self.assertEqual(BugNotificationLevel.METADATA, change.change_level) |
1162 | 75 | BugNotificationLevel.METADATA, change.change_level) | ||
1164 | 76 | 75 | ||
1165 | 77 | def test_change_level_lifecycle_status_closing(self): | 76 | def test_change_level_lifecycle_status_closing(self): |
1166 | 78 | # Changing a bug task status from NEW to FIXRELEASED makes this | 77 | # Changing a bug task status from NEW to FIXRELEASED makes this |
1167 | @@ -87,8 +86,7 @@ | |||
1168 | 87 | bugtask_deltas=bugtask_delta) | 86 | bugtask_deltas=bugtask_delta) |
1169 | 88 | 87 | ||
1170 | 89 | change = list(get_bug_changes(bug_delta))[0] | 88 | change = list(get_bug_changes(bug_delta))[0] |
1173 | 90 | self.assertEquals( | 89 | self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level) |
1172 | 91 | BugNotificationLevel.LIFECYCLE, change.change_level) | ||
1174 | 92 | 90 | ||
1175 | 93 | def test_change_level_lifecycle_status_reopening(self): | 91 | def test_change_level_lifecycle_status_reopening(self): |
1176 | 94 | # Changing a bug task status from FIXRELEASED to TRIAGED makes this | 92 | # Changing a bug task status from FIXRELEASED to TRIAGED makes this |
1177 | @@ -103,9 +101,7 @@ | |||
1178 | 103 | bugtask_deltas=bugtask_delta) | 101 | bugtask_deltas=bugtask_delta) |
1179 | 104 | 102 | ||
1180 | 105 | change = list(get_bug_changes(bug_delta))[0] | 103 | change = list(get_bug_changes(bug_delta))[0] |
1184 | 106 | self.assertEquals( | 104 | self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level) |
1182 | 107 | BugNotificationLevel.LIFECYCLE, | ||
1183 | 108 | change.change_level) | ||
1185 | 109 | 105 | ||
1186 | 110 | def test_change_level_metadata_status_worked_on(self): | 106 | def test_change_level_metadata_status_worked_on(self): |
1187 | 111 | # Changing a bug task status from TRIAGED to FIXCOMMITTED makes this | 107 | # Changing a bug task status from TRIAGED to FIXCOMMITTED makes this |
1188 | @@ -120,8 +116,7 @@ | |||
1189 | 120 | bugtask_deltas=bugtask_delta) | 116 | bugtask_deltas=bugtask_delta) |
1190 | 121 | 117 | ||
1191 | 122 | change = list(get_bug_changes(bug_delta))[0] | 118 | change = list(get_bug_changes(bug_delta))[0] |
1194 | 123 | self.assertEquals( | 119 | self.assertEqual(BugNotificationLevel.METADATA, change.change_level) |
1193 | 124 | BugNotificationLevel.METADATA, change.change_level) | ||
1195 | 125 | 120 | ||
1196 | 126 | def test_change_level_metadata_status_stays_closed(self): | 121 | def test_change_level_metadata_status_stays_closed(self): |
1197 | 127 | # Changing a bug task status from OPINION to WONTFIX makes this | 122 | # Changing a bug task status from OPINION to WONTFIX makes this |
1198 | @@ -136,8 +131,7 @@ | |||
1199 | 136 | bugtask_deltas=bugtask_delta) | 131 | bugtask_deltas=bugtask_delta) |
1200 | 137 | 132 | ||
1201 | 138 | change = list(get_bug_changes(bug_delta))[0] | 133 | change = list(get_bug_changes(bug_delta))[0] |
1204 | 139 | self.assertEquals( | 134 | self.assertEqual(BugNotificationLevel.METADATA, change.change_level) |
1203 | 140 | BugNotificationLevel.METADATA, change.change_level) | ||
1205 | 141 | 135 | ||
1206 | 142 | def test_change_level_metadata_duplicate_of_unresolved(self): | 136 | def test_change_level_metadata_duplicate_of_unresolved(self): |
1207 | 143 | # Marking a bug as a duplicate of an unresolved bug is a | 137 | # Marking a bug as a duplicate of an unresolved bug is a |
1208 | @@ -153,8 +147,7 @@ | |||
1209 | 153 | }) | 147 | }) |
1210 | 154 | 148 | ||
1211 | 155 | change = list(get_bug_changes(bug_delta))[0] | 149 | change = list(get_bug_changes(bug_delta))[0] |
1214 | 156 | self.assertEquals( | 150 | self.assertEqual(BugNotificationLevel.METADATA, change.change_level) |
1213 | 157 | BugNotificationLevel.METADATA, change.change_level) | ||
1215 | 158 | 151 | ||
1216 | 159 | def test_change_level_lifecycle_duplicate_of_resolved(self): | 152 | def test_change_level_lifecycle_duplicate_of_resolved(self): |
1217 | 160 | # Marking a bug as a duplicate of a resolved bug is | 153 | # Marking a bug as a duplicate of a resolved bug is |
1218 | @@ -170,8 +163,7 @@ | |||
1219 | 170 | }) | 163 | }) |
1220 | 171 | 164 | ||
1221 | 172 | change = list(get_bug_changes(bug_delta))[0] | 165 | change = list(get_bug_changes(bug_delta))[0] |
1224 | 173 | self.assertEquals( | 166 | self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level) |
1223 | 174 | BugNotificationLevel.LIFECYCLE, change.change_level) | ||
1225 | 175 | 167 | ||
1226 | 176 | def test_change_level_metadata_not_duplicate_of_unresolved(self): | 168 | def test_change_level_metadata_not_duplicate_of_unresolved(self): |
1227 | 177 | # Un-marking a bug as a duplicate of an unresolved bug is a | 169 | # Un-marking a bug as a duplicate of an unresolved bug is a |
1228 | @@ -187,8 +179,7 @@ | |||
1229 | 187 | }) | 179 | }) |
1230 | 188 | 180 | ||
1231 | 189 | change = list(get_bug_changes(bug_delta))[0] | 181 | change = list(get_bug_changes(bug_delta))[0] |
1234 | 190 | self.assertEquals( | 182 | self.assertEqual(BugNotificationLevel.METADATA, change.change_level) |
1233 | 191 | BugNotificationLevel.METADATA, change.change_level) | ||
1235 | 192 | 183 | ||
1236 | 193 | def test_change_level_lifecycle_not_duplicate_of_resolved(self): | 184 | def test_change_level_lifecycle_not_duplicate_of_resolved(self): |
1237 | 194 | # Un-marking a bug as a duplicate of a resolved bug is | 185 | # Un-marking a bug as a duplicate of a resolved bug is |
1238 | @@ -203,5 +194,4 @@ | |||
1239 | 203 | 'old': duplicate_of}) | 194 | 'old': duplicate_of}) |
1240 | 204 | 195 | ||
1241 | 205 | change = list(get_bug_changes(bug_delta))[0] | 196 | change = list(get_bug_changes(bug_delta))[0] |
1244 | 206 | self.assertEquals( | 197 | self.assertEqual(BugNotificationLevel.LIFECYCLE, change.change_level) |
1243 | 207 | BugNotificationLevel.LIFECYCLE, change.change_level) | ||
1245 | 208 | 198 | ||
1246 | === modified file 'lib/lp/bugs/browser/tests/test_breadcrumbs.py' | |||
1247 | --- lib/lp/bugs/browser/tests/test_breadcrumbs.py 2014-02-19 00:35:25 +0000 | |||
1248 | +++ lib/lp/bugs/browser/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000 | |||
1249 | @@ -24,17 +24,17 @@ | |||
1250 | 24 | def test_bugtask(self): | 24 | def test_bugtask(self): |
1251 | 25 | crumbs = self.getBreadcrumbsForObject(self.bugtask) | 25 | crumbs = self.getBreadcrumbsForObject(self.bugtask) |
1252 | 26 | last_crumb = crumbs[-1] | 26 | last_crumb = crumbs[-1] |
1256 | 27 | self.assertEquals(self.bugtask_url, last_crumb.url) | 27 | self.assertEqual(self.bugtask_url, last_crumb.url) |
1257 | 28 | self.assertEquals("Bug #%d" % self.bug.id, last_crumb.text) | 28 | self.assertEqual("Bug #%d" % self.bug.id, last_crumb.text) |
1258 | 29 | self.assertEquals( | 29 | self.assertEqual( |
1259 | 30 | u"Bug #%d \u201cborked\u201d" % self.bug.id, last_crumb.detail) | 30 | u"Bug #%d \u201cborked\u201d" % self.bug.id, last_crumb.detail) |
1260 | 31 | 31 | ||
1261 | 32 | def test_bugtask_child(self): | 32 | def test_bugtask_child(self): |
1262 | 33 | crumbs = self.getBreadcrumbsForObject( | 33 | crumbs = self.getBreadcrumbsForObject( |
1263 | 34 | self.bugtask, view_name='+activity') | 34 | self.bugtask, view_name='+activity') |
1267 | 35 | self.assertEquals(crumbs[-1].url, "%s/+activity" % self.bugtask_url) | 35 | self.assertEqual(crumbs[-1].url, "%s/+activity" % self.bugtask_url) |
1268 | 36 | self.assertEquals(crumbs[-2].url, self.bugtask_url) | 36 | self.assertEqual(crumbs[-2].url, self.bugtask_url) |
1269 | 37 | self.assertEquals(crumbs[-2].text, "Bug #%d" % self.bug.id) | 37 | self.assertEqual(crumbs[-2].text, "Bug #%d" % self.bug.id) |
1270 | 38 | 38 | ||
1271 | 39 | def test_bugtask_comment(self): | 39 | def test_bugtask_comment(self): |
1272 | 40 | login_person(self.bug.owner) | 40 | login_person(self.bug.owner) |
1273 | @@ -88,13 +88,13 @@ | |||
1274 | 88 | person_bugs_url = canonical_url(person, rootsite='bugs') | 88 | person_bugs_url = canonical_url(person, rootsite='bugs') |
1275 | 89 | crumbs = self.getBreadcrumbsForObject(person, rootsite='bugs') | 89 | crumbs = self.getBreadcrumbsForObject(person, rootsite='bugs') |
1276 | 90 | last_crumb = crumbs[-1] | 90 | last_crumb = crumbs[-1] |
1279 | 91 | self.assertEquals(person_bugs_url, last_crumb.url) | 91 | self.assertEqual(person_bugs_url, last_crumb.url) |
1280 | 92 | self.assertEquals("Bugs", last_crumb.text) | 92 | self.assertEqual("Bugs", last_crumb.text) |
1281 | 93 | 93 | ||
1282 | 94 | def test_bugtarget(self): | 94 | def test_bugtarget(self): |
1283 | 95 | project = self.factory.makeProduct(name='fnord') | 95 | project = self.factory.makeProduct(name='fnord') |
1284 | 96 | project_bugs_url = canonical_url(project, rootsite='bugs') | 96 | project_bugs_url = canonical_url(project, rootsite='bugs') |
1285 | 97 | crumbs = self.getBreadcrumbsForObject(project, rootsite='bugs') | 97 | crumbs = self.getBreadcrumbsForObject(project, rootsite='bugs') |
1286 | 98 | last_crumb = crumbs[-1] | 98 | last_crumb = crumbs[-1] |
1289 | 99 | self.assertEquals(project_bugs_url, last_crumb.url) | 99 | self.assertEqual(project_bugs_url, last_crumb.url) |
1290 | 100 | self.assertEquals("Bugs", last_crumb.text) | 100 | self.assertEqual("Bugs", last_crumb.text) |
1291 | 101 | 101 | ||
1292 | === modified file 'lib/lp/bugs/browser/tests/test_bug_views.py' | |||
1293 | --- lib/lp/bugs/browser/tests/test_bug_views.py 2017-10-21 18:14:14 +0000 | |||
1294 | +++ lib/lp/bugs/browser/tests/test_bug_views.py 2018-01-02 16:24:23 +0000 | |||
1295 | @@ -654,7 +654,7 @@ | |||
1296 | 654 | view = create_initialized_view( | 654 | view = create_initialized_view( |
1297 | 655 | bug.default_bugtask, '+addcomment', form=form) | 655 | bug.default_bugtask, '+addcomment', form=form) |
1298 | 656 | expected_error = u'Either a comment or attachment must be provided.' | 656 | expected_error = u'Either a comment or attachment must be provided.' |
1300 | 657 | self.assertEquals(view.errors[0], expected_error) | 657 | self.assertEqual(view.errors[0], expected_error) |
1301 | 658 | 658 | ||
1302 | 659 | def test_whitespaces_message_with_attached_file(self): | 659 | def test_whitespaces_message_with_attached_file(self): |
1303 | 660 | # If the message only contains whitespaces but a file | 660 | # If the message only contains whitespaces but a file |
1304 | 661 | 661 | ||
1305 | === modified file 'lib/lp/bugs/browser/tests/test_bugnomination.py' | |||
1306 | --- lib/lp/bugs/browser/tests/test_bugnomination.py 2016-10-05 08:44:13 +0000 | |||
1307 | +++ lib/lp/bugs/browser/tests/test_bugnomination.py 2018-01-02 16:24:23 +0000 | |||
1308 | @@ -243,7 +243,7 @@ | |||
1309 | 243 | return view | 243 | return view |
1310 | 244 | 244 | ||
1311 | 245 | def assertApproves(self, nomination): | 245 | def assertApproves(self, nomination): |
1313 | 246 | self.assertEquals( | 246 | self.assertEqual( |
1314 | 247 | 302, | 247 | 302, |
1315 | 248 | self.getNominationEditView( | 248 | self.getNominationEditView( |
1316 | 249 | nomination, | 249 | nomination, |
1317 | 250 | 250 | ||
1318 | === modified file 'lib/lp/bugs/browser/tests/test_bugtask.py' | |||
1319 | --- lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 10:54:31 +0000 | |||
1320 | +++ lib/lp/bugs/browser/tests/test_bugtask.py 2018-01-02 16:24:23 +0000 | |||
1321 | @@ -1751,7 +1751,7 @@ | |||
1322 | 1751 | self.setAttribute( | 1751 | self.setAttribute( |
1323 | 1752 | task, 'assignee', | 1752 | task, 'assignee', |
1324 | 1753 | self.factory.makePerson(displayname="Foo &<>", name='foo')) | 1753 | self.factory.makePerson(displayname="Foo &<>", name='foo')) |
1326 | 1754 | self.assertEquals( | 1754 | self.assertEqual( |
1327 | 1755 | "nobody → Foo &<> (foo)", | 1755 | "nobody → Foo &<> (foo)", |
1328 | 1756 | BugActivityItem(task.bug.activity[-1]).change_details) | 1756 | BugActivityItem(task.bug.activity[-1]).change_details) |
1329 | 1757 | 1757 | ||
1330 | @@ -1759,7 +1759,7 @@ | |||
1331 | 1759 | with celebrity_logged_in('admin'): | 1759 | with celebrity_logged_in('admin'): |
1332 | 1760 | bug = self.factory.makeBug(title="foo") | 1760 | bug = self.factory.makeBug(title="foo") |
1333 | 1761 | self.setAttribute(bug, 'title', "bar &<>") | 1761 | self.setAttribute(bug, 'title', "bar &<>") |
1335 | 1762 | self.assertEquals( | 1762 | self.assertEqual( |
1336 | 1763 | "- foo<br />+ bar &<>", | 1763 | "- foo<br />+ bar &<>", |
1337 | 1764 | BugActivityItem(bug.activity[-1]).change_details) | 1764 | BugActivityItem(bug.activity[-1]).change_details) |
1338 | 1765 | 1765 | ||
1339 | 1766 | 1766 | ||
1340 | === modified file 'lib/lp/bugs/browser/tests/test_expose.py' | |||
1341 | --- lib/lp/bugs/browser/tests/test_expose.py 2015-09-09 16:47:34 +0000 | |||
1342 | +++ lib/lp/bugs/browser/tests/test_expose.py 2018-01-02 16:24:23 +0000 | |||
1343 | @@ -249,7 +249,7 @@ | |||
1344 | 249 | expose_user_administered_teams_to_js(self.request, self.user, context, | 249 | expose_user_administered_teams_to_js(self.request, self.user, context, |
1345 | 250 | absoluteURL=fake_absoluteURL) | 250 | absoluteURL=fake_absoluteURL) |
1346 | 251 | team_info = self.request.objects['administratedTeams'] | 251 | team_info = self.request.objects['administratedTeams'] |
1348 | 252 | self.assertEquals(len(team_info), 0) | 252 | self.assertEqual(len(team_info), 0) |
1349 | 253 | 253 | ||
1350 | 254 | def test_teams_for_distro_with_bug_super(self): | 254 | def test_teams_for_distro_with_bug_super(self): |
1351 | 255 | self._setup_teams(self.user) | 255 | self._setup_teams(self.user) |
1352 | 256 | 256 | ||
1353 | === modified file 'lib/lp/bugs/mail/tests/test_handler.py' | |||
1354 | --- lib/lp/bugs/mail/tests/test_handler.py 2016-03-23 17:55:39 +0000 | |||
1355 | +++ lib/lp/bugs/mail/tests/test_handler.py 2018-01-02 16:24:23 +0000 | |||
1356 | @@ -98,7 +98,7 @@ | |||
1357 | 98 | # NB SignedMessage by default isn't actually signed, it just has the | 98 | # NB SignedMessage by default isn't actually signed, it just has the |
1358 | 99 | # capability of knowing about signing. | 99 | # capability of knowing about signing. |
1359 | 100 | message = self.factory.makeSignedMessage(body=' affects malone\nhi!') | 100 | message = self.factory.makeSignedMessage(body=' affects malone\nhi!') |
1361 | 101 | self.assertEquals(message.signature, None) | 101 | self.assertEqual(message.signature, None) |
1362 | 102 | 102 | ||
1363 | 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. |
1364 | 104 | handler = MaloneHandler() | 104 | handler = MaloneHandler() |
1365 | @@ -106,8 +106,8 @@ | |||
1366 | 106 | mail_handled, add_comment_to_bug, commands = \ | 106 | mail_handled, add_comment_to_bug, commands = \ |
1367 | 107 | handler.extractAndAuthenticateCommands(message, | 107 | handler.extractAndAuthenticateCommands(message, |
1368 | 108 | 'new@bugs.launchpad.net') | 108 | 'new@bugs.launchpad.net') |
1371 | 109 | self.assertEquals(mail_handled, None) | 109 | self.assertEqual(mail_handled, None) |
1372 | 110 | self.assertEquals(map(str, commands), [ | 110 | self.assertEqual(map(str, commands), [ |
1373 | 111 | 'bug new', | 111 | 'bug new', |
1374 | 112 | 'affects malone', | 112 | 'affects malone', |
1375 | 113 | ]) | 113 | ]) |
1376 | 114 | 114 | ||
1377 | === modified file 'lib/lp/bugs/model/tests/test_bugtask.py' | |||
1378 | --- lib/lp/bugs/model/tests/test_bugtask.py 2017-05-08 11:38:20 +0000 | |||
1379 | +++ lib/lp/bugs/model/tests/test_bugtask.py 2018-01-02 16:24:23 +0000 | |||
1380 | @@ -729,7 +729,7 @@ | |||
1381 | 729 | names = set( | 729 | names = set( |
1382 | 730 | name for interface in providedBy(delta) for name in interface) | 730 | name for interface in providedBy(delta) for name in interface) |
1383 | 731 | for name in names: | 731 | for name in names: |
1385 | 732 | self.assertEquals(getattr(delta, name), expected_delta.get(name)) | 732 | self.assertEqual(getattr(delta, name), expected_delta.get(name)) |
1386 | 733 | 733 | ||
1387 | 734 | def test_get_bugwatch_delta(self): | 734 | def test_get_bugwatch_delta(self): |
1388 | 735 | # Exercise getDelta() with a change to bugwatch. | 735 | # Exercise getDelta() with a change to bugwatch. |
1389 | @@ -1199,8 +1199,8 @@ | |||
1390 | 1199 | 1199 | ||
1391 | 1200 | # Get a debbugs watch. | 1200 | # Get a debbugs watch. |
1392 | 1201 | watch_debbugs_327452 = bugwatchset.get(9) | 1201 | watch_debbugs_327452 = bugwatchset.get(9) |
1395 | 1202 | self.assertEquals(watch_debbugs_327452.bugtracker.name, "debbugs") | 1202 | self.assertEqual(watch_debbugs_327452.bugtracker.name, "debbugs") |
1396 | 1203 | self.assertEquals(watch_debbugs_327452.remotebug, "327452") | 1203 | self.assertEqual(watch_debbugs_327452.remotebug, "327452") |
1397 | 1204 | 1204 | ||
1398 | 1205 | # Associate the watch to a Fix Released task. | 1205 | # Associate the watch to a Fix Released task. |
1399 | 1206 | debian = getUtility(IDistributionSet).getByName("debian") | 1206 | debian = getUtility(IDistributionSet).getByName("debian") |
1400 | @@ -2208,7 +2208,7 @@ | |||
1401 | 2208 | def test_distribution_to_package_works(self): | 2208 | def test_distribution_to_package_works(self): |
1402 | 2209 | distro = self.factory.makeDistribution() | 2209 | distro = self.factory.makeDistribution() |
1403 | 2210 | dsp = self.factory.makeDistributionSourcePackage(distribution=distro) | 2210 | dsp = self.factory.makeDistributionSourcePackage(distribution=distro) |
1405 | 2211 | self.assertEquals(dsp.distribution, distro) | 2211 | self.assertEqual(dsp.distribution, distro) |
1406 | 2212 | self.assertTransitionWorks(distro, dsp) | 2212 | self.assertTransitionWorks(distro, dsp) |
1407 | 2213 | 2213 | ||
1408 | 2214 | def test_package_to_package_works(self): | 2214 | def test_package_to_package_works(self): |
1409 | 2215 | 2215 | ||
1410 | === modified file 'lib/lp/bugs/scripts/checkwatches/tests/test_core.py' | |||
1411 | --- lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 10:54:31 +0000 | |||
1412 | +++ lib/lp/bugs/scripts/checkwatches/tests/test_core.py 2018-01-02 16:24:23 +0000 | |||
1413 | @@ -244,7 +244,7 @@ | |||
1414 | 244 | transaction.commit() | 244 | transaction.commit() |
1415 | 245 | master._updateBugTracker(bug_tracker) | 245 | master._updateBugTracker(bug_tracker) |
1416 | 246 | for bug_watch in bug_watches: | 246 | for bug_watch in bug_watches: |
1418 | 247 | self.assertEquals( | 247 | self.assertEqual( |
1419 | 248 | BugWatchActivityStatus.CONNECTION_ERROR, | 248 | BugWatchActivityStatus.CONNECTION_ERROR, |
1420 | 249 | bug_watch.last_error_type) | 249 | bug_watch.last_error_type) |
1421 | 250 | self.assertEqual( | 250 | self.assertEqual( |
1422 | @@ -264,7 +264,7 @@ | |||
1423 | 264 | transaction.commit() | 264 | transaction.commit() |
1424 | 265 | master._updateBugTracker(bug_tracker) | 265 | master._updateBugTracker(bug_tracker) |
1425 | 266 | for bug_watch in bug_watches: | 266 | for bug_watch in bug_watches: |
1427 | 267 | self.assertEquals( | 267 | self.assertEqual( |
1428 | 268 | BugWatchActivityStatus.UNKNOWN, | 268 | BugWatchActivityStatus.UNKNOWN, |
1429 | 269 | bug_watch.last_error_type) | 269 | bug_watch.last_error_type) |
1430 | 270 | self.assertEqual( | 270 | self.assertEqual( |
1431 | 271 | 271 | ||
1432 | === modified file 'lib/lp/bugs/scripts/tests/test_bugnotification.py' | |||
1433 | --- lib/lp/bugs/scripts/tests/test_bugnotification.py 2015-08-06 12:09:28 +0000 | |||
1434 | +++ lib/lp/bugs/scripts/tests/test_bugnotification.py 2018-01-02 16:24:23 +0000 | |||
1435 | @@ -439,20 +439,20 @@ | |||
1436 | 439 | 439 | ||
1437 | 440 | def test_with_nothing(self): | 440 | def test_with_nothing(self): |
1438 | 441 | # Nothing is generated if an empty list is passed in. | 441 | # Nothing is generated if an empty list is passed in. |
1440 | 442 | self.assertEquals([], list(notification_comment_batches([]))) | 442 | self.assertEqual([], list(notification_comment_batches([]))) |
1441 | 443 | 443 | ||
1442 | 444 | def test_with_one_non_comment_notification(self): | 444 | def test_with_one_non_comment_notification(self): |
1443 | 445 | # Given a single non-comment notification, a single tuple is | 445 | # Given a single non-comment notification, a single tuple is |
1444 | 446 | # generated. | 446 | # generated. |
1445 | 447 | notification = FakeNotification(False) | 447 | notification = FakeNotification(False) |
1447 | 448 | self.assertEquals( | 448 | self.assertEqual( |
1448 | 449 | [(1, notification)], | 449 | [(1, notification)], |
1449 | 450 | list(notification_comment_batches([notification]))) | 450 | list(notification_comment_batches([notification]))) |
1450 | 451 | 451 | ||
1451 | 452 | def test_with_one_comment_notification(self): | 452 | def test_with_one_comment_notification(self): |
1452 | 453 | # Given a single comment notification, a single tuple is generated. | 453 | # Given a single comment notification, a single tuple is generated. |
1453 | 454 | notification = FakeNotification(True) | 454 | notification = FakeNotification(True) |
1455 | 455 | self.assertEquals( | 455 | self.assertEqual( |
1456 | 456 | [(1, notification)], | 456 | [(1, notification)], |
1457 | 457 | list(notification_comment_batches([notification]))) | 457 | list(notification_comment_batches([notification]))) |
1458 | 458 | 458 | ||
1459 | @@ -462,7 +462,7 @@ | |||
1460 | 462 | notification1 = FakeNotification(True) | 462 | notification1 = FakeNotification(True) |
1461 | 463 | notification2 = FakeNotification(False) | 463 | notification2 = FakeNotification(False) |
1462 | 464 | notifications = [notification1, notification2] | 464 | notifications = [notification1, notification2] |
1464 | 465 | self.assertEquals( | 465 | self.assertEqual( |
1465 | 466 | [(1, notification1), (1, notification2)], | 466 | [(1, notification1), (1, notification2)], |
1466 | 467 | list(notification_comment_batches(notifications))) | 467 | list(notification_comment_batches(notifications))) |
1467 | 468 | 468 | ||
1468 | @@ -472,7 +472,7 @@ | |||
1469 | 472 | notification1 = FakeNotification(False) | 472 | notification1 = FakeNotification(False) |
1470 | 473 | notification2 = FakeNotification(True) | 473 | notification2 = FakeNotification(True) |
1471 | 474 | notifications = [notification1, notification2] | 474 | notifications = [notification1, notification2] |
1473 | 475 | self.assertEquals( | 475 | self.assertEqual( |
1474 | 476 | [(1, notification1), (1, notification2)], | 476 | [(1, notification1), (1, notification2)], |
1475 | 477 | list(notification_comment_batches(notifications))) | 477 | list(notification_comment_batches(notifications))) |
1476 | 478 | 478 | ||
1477 | @@ -483,7 +483,7 @@ | |||
1478 | 483 | notification2 = FakeNotification(True) | 483 | notification2 = FakeNotification(True) |
1479 | 484 | notification3 = FakeNotification(False) | 484 | notification3 = FakeNotification(False) |
1480 | 485 | notifications = [notification1, notification2, notification3] | 485 | notifications = [notification1, notification2, notification3] |
1482 | 486 | self.assertEquals( | 486 | self.assertEqual( |
1483 | 487 | [(1, notification1), (1, notification2), (1, notification3)], | 487 | [(1, notification1), (1, notification2), (1, notification3)], |
1484 | 488 | list(notification_comment_batches(notifications))) | 488 | list(notification_comment_batches(notifications))) |
1485 | 489 | 489 | ||
1486 | @@ -500,7 +500,7 @@ | |||
1487 | 500 | notification1, notification2, | 500 | notification1, notification2, |
1488 | 501 | notification3, notification4, | 501 | notification3, notification4, |
1489 | 502 | ] | 502 | ] |
1491 | 503 | self.assertEquals( | 503 | self.assertEqual( |
1492 | 504 | [(1, notification1), (1, notification2), | 504 | [(1, notification1), (1, notification2), |
1493 | 505 | (1, notification3), (2, notification4)], | 505 | (1, notification3), (2, notification4)], |
1494 | 506 | list(notification_comment_batches(notifications))) | 506 | list(notification_comment_batches(notifications))) |
1495 | @@ -511,20 +511,20 @@ | |||
1496 | 511 | 511 | ||
1497 | 512 | def test_with_nothing(self): | 512 | def test_with_nothing(self): |
1498 | 513 | # Nothing is generated if an empty list is passed in. | 513 | # Nothing is generated if an empty list is passed in. |
1500 | 514 | self.assertEquals([], list(notification_batches([]))) | 514 | self.assertEqual([], list(notification_batches([]))) |
1501 | 515 | 515 | ||
1502 | 516 | def test_with_one_non_comment_notification(self): | 516 | def test_with_one_non_comment_notification(self): |
1503 | 517 | # Given a single non-comment notification, a single batch is | 517 | # Given a single non-comment notification, a single batch is |
1504 | 518 | # generated. | 518 | # generated. |
1505 | 519 | notification = FakeNotification(False) | 519 | notification = FakeNotification(False) |
1507 | 520 | self.assertEquals( | 520 | self.assertEqual( |
1508 | 521 | [[notification]], | 521 | [[notification]], |
1509 | 522 | list(notification_batches([notification]))) | 522 | list(notification_batches([notification]))) |
1510 | 523 | 523 | ||
1511 | 524 | def test_with_one_comment_notification(self): | 524 | def test_with_one_comment_notification(self): |
1512 | 525 | # Given a single comment notification, a single batch is generated. | 525 | # Given a single comment notification, a single batch is generated. |
1513 | 526 | notification = FakeNotification(True) | 526 | notification = FakeNotification(True) |
1515 | 527 | self.assertEquals( | 527 | self.assertEqual( |
1516 | 528 | [[notification]], | 528 | [[notification]], |
1517 | 529 | list(notification_batches([notification]))) | 529 | list(notification_batches([notification]))) |
1518 | 530 | 530 | ||
1519 | @@ -534,7 +534,7 @@ | |||
1520 | 534 | notification1 = FakeNotification(True) | 534 | notification1 = FakeNotification(True) |
1521 | 535 | notification2 = FakeNotification(False) | 535 | notification2 = FakeNotification(False) |
1522 | 536 | notifications = [notification1, notification2] | 536 | notifications = [notification1, notification2] |
1524 | 537 | self.assertEquals( | 537 | self.assertEqual( |
1525 | 538 | [[notification1, notification2]], | 538 | [[notification1, notification2]], |
1526 | 539 | list(notification_batches(notifications))) | 539 | list(notification_batches(notifications))) |
1527 | 540 | 540 | ||
1528 | @@ -544,7 +544,7 @@ | |||
1529 | 544 | notification1 = FakeNotification(False) | 544 | notification1 = FakeNotification(False) |
1530 | 545 | notification2 = FakeNotification(True) | 545 | notification2 = FakeNotification(True) |
1531 | 546 | notifications = [notification1, notification2] | 546 | notifications = [notification1, notification2] |
1533 | 547 | self.assertEquals( | 547 | self.assertEqual( |
1534 | 548 | [[notification1, notification2]], | 548 | [[notification1, notification2]], |
1535 | 549 | list(notification_batches(notifications))) | 549 | list(notification_batches(notifications))) |
1536 | 550 | 550 | ||
1537 | @@ -555,7 +555,7 @@ | |||
1538 | 555 | notification2 = FakeNotification(True) | 555 | notification2 = FakeNotification(True) |
1539 | 556 | notification3 = FakeNotification(False) | 556 | notification3 = FakeNotification(False) |
1540 | 557 | notifications = [notification1, notification2, notification3] | 557 | notifications = [notification1, notification2, notification3] |
1542 | 558 | self.assertEquals( | 558 | self.assertEqual( |
1543 | 559 | [[notification1, notification2, notification3]], | 559 | [[notification1, notification2, notification3]], |
1544 | 560 | list(notification_batches(notifications))) | 560 | list(notification_batches(notifications))) |
1545 | 561 | 561 | ||
1546 | @@ -571,7 +571,7 @@ | |||
1547 | 571 | notification1, notification2, | 571 | notification1, notification2, |
1548 | 572 | notification3, notification4, | 572 | notification3, notification4, |
1549 | 573 | ] | 573 | ] |
1551 | 574 | self.assertEquals( | 574 | self.assertEqual( |
1552 | 575 | [[notification1, notification2, notification3], [notification4]], | 575 | [[notification1, notification2, notification3], [notification4]], |
1553 | 576 | list(notification_batches(notifications))) | 576 | list(notification_batches(notifications))) |
1554 | 577 | 577 | ||
1555 | @@ -579,20 +579,20 @@ | |||
1556 | 579 | # Batches are grouped by bug. | 579 | # Batches are grouped by bug. |
1557 | 580 | notifications = [FakeNotification(bug=1) for number in range(5)] | 580 | notifications = [FakeNotification(bug=1) for number in range(5)] |
1558 | 581 | observed = list(notification_batches(notifications)) | 581 | observed = list(notification_batches(notifications)) |
1560 | 582 | self.assertEquals([notifications], observed) | 582 | self.assertEqual([notifications], observed) |
1561 | 583 | 583 | ||
1562 | 584 | def test_notifications_for_different_bugs(self): | 584 | def test_notifications_for_different_bugs(self): |
1563 | 585 | # Batches are grouped by bug. | 585 | # Batches are grouped by bug. |
1564 | 586 | notifications = [FakeNotification(bug=number) for number in range(5)] | 586 | notifications = [FakeNotification(bug=number) for number in range(5)] |
1565 | 587 | expected = [[notification] for notification in notifications] | 587 | expected = [[notification] for notification in notifications] |
1566 | 588 | observed = list(notification_batches(notifications)) | 588 | observed = list(notification_batches(notifications)) |
1568 | 589 | self.assertEquals(expected, observed) | 589 | self.assertEqual(expected, observed) |
1569 | 590 | 590 | ||
1570 | 591 | def test_notifications_for_same_owner(self): | 591 | def test_notifications_for_same_owner(self): |
1571 | 592 | # Batches are grouped by owner. | 592 | # Batches are grouped by owner. |
1572 | 593 | notifications = [FakeNotification(owner=1) for number in range(5)] | 593 | notifications = [FakeNotification(owner=1) for number in range(5)] |
1573 | 594 | observed = list(notification_batches(notifications)) | 594 | observed = list(notification_batches(notifications)) |
1575 | 595 | self.assertEquals([notifications], observed) | 595 | self.assertEqual([notifications], observed) |
1576 | 596 | 596 | ||
1577 | 597 | def test_notifications_for_different_owners(self): | 597 | def test_notifications_for_different_owners(self): |
1578 | 598 | # Batches are grouped by owner. | 598 | # Batches are grouped by owner. |
1579 | @@ -600,7 +600,7 @@ | |||
1580 | 600 | FakeNotification(owner=number) for number in range(5)] | 600 | FakeNotification(owner=number) for number in range(5)] |
1581 | 601 | expected = [[notification] for notification in notifications] | 601 | expected = [[notification] for notification in notifications] |
1582 | 602 | observed = list(notification_batches(notifications)) | 602 | observed = list(notification_batches(notifications)) |
1584 | 603 | self.assertEquals(expected, observed) | 603 | self.assertEqual(expected, observed) |
1585 | 604 | 604 | ||
1586 | 605 | def test_notifications_with_mixed_bugs_and_owners(self): | 605 | def test_notifications_with_mixed_bugs_and_owners(self): |
1587 | 606 | # Batches are grouped by bug and owner. | 606 | # Batches are grouped by bug and owner. |
1588 | @@ -612,7 +612,7 @@ | |||
1589 | 612 | ] | 612 | ] |
1590 | 613 | expected = [[notification] for notification in notifications] | 613 | expected = [[notification] for notification in notifications] |
1591 | 614 | observed = list(notification_batches(notifications)) | 614 | observed = list(notification_batches(notifications)) |
1593 | 615 | self.assertEquals(expected, observed) | 615 | self.assertEqual(expected, observed) |
1594 | 616 | 616 | ||
1595 | 617 | def test_notifications_with_mixed_bugs_and_owners_2(self): | 617 | def test_notifications_with_mixed_bugs_and_owners_2(self): |
1596 | 618 | # Batches are grouped by bug and owner. | 618 | # Batches are grouped by bug and owner. |
1597 | @@ -624,7 +624,7 @@ | |||
1598 | 624 | ] | 624 | ] |
1599 | 625 | expected = [notifications[0:2], notifications[2:4]] | 625 | expected = [notifications[0:2], notifications[2:4]] |
1600 | 626 | observed = list(notification_batches(notifications)) | 626 | observed = list(notification_batches(notifications)) |
1602 | 627 | self.assertEquals(expected, observed) | 627 | self.assertEqual(expected, observed) |
1603 | 628 | 628 | ||
1604 | 629 | def test_notifications_with_mixed_bugs_owners_and_comments(self): | 629 | def test_notifications_with_mixed_bugs_owners_and_comments(self): |
1605 | 630 | # Batches are grouped by bug, owner and comments. | 630 | # Batches are grouped by bug, owner and comments. |
1606 | @@ -636,7 +636,7 @@ | |||
1607 | 636 | ] | 636 | ] |
1608 | 637 | expected = [notifications[0:3], notifications[3:4]] | 637 | expected = [notifications[0:3], notifications[3:4]] |
1609 | 638 | observed = list(notification_batches(notifications)) | 638 | observed = list(notification_batches(notifications)) |
1611 | 639 | self.assertEquals(expected, observed) | 639 | self.assertEqual(expected, observed) |
1612 | 640 | 640 | ||
1613 | 641 | 641 | ||
1614 | 642 | class EmailNotificationTestBase(TestCaseWithFactory): | 642 | class EmailNotificationTestBase(TestCaseWithFactory): |
1615 | @@ -1122,7 +1122,7 @@ | |||
1616 | 1122 | self.addFilter(u"Test filter") | 1122 | self.addFilter(u"Test filter") |
1617 | 1123 | 1123 | ||
1618 | 1124 | the_subscriber = self.subscription.subscriber | 1124 | the_subscriber = self.subscription.subscriber |
1620 | 1125 | self.assertEquals( | 1125 | self.assertEqual( |
1621 | 1126 | {other_person.preferredemail.email: [u"Someone's filter"], | 1126 | {other_person.preferredemail.email: [u"Someone's filter"], |
1622 | 1127 | the_subscriber.preferredemail.email: [u"Test filter"]}, | 1127 | the_subscriber.preferredemail.email: [u"Test filter"]}, |
1623 | 1128 | self.getSubscriptionEmailHeaders(by_person=True)) | 1128 | self.getSubscriptionEmailHeaders(by_person=True)) |
1624 | 1129 | 1129 | ||
1625 | === modified file 'lib/lp/buildmaster/browser/tests/test_processor.py' | |||
1626 | --- lib/lp/buildmaster/browser/tests/test_processor.py 2015-04-20 11:07:41 +0000 | |||
1627 | +++ lib/lp/buildmaster/browser/tests/test_processor.py 2018-01-02 16:24:23 +0000 | |||
1628 | @@ -16,7 +16,7 @@ | |||
1629 | 16 | 16 | ||
1630 | 17 | def test_processor_url(self): | 17 | def test_processor_url(self): |
1631 | 18 | quantum = self.factory.makeProcessor('quantum') | 18 | quantum = self.factory.makeProcessor('quantum') |
1633 | 19 | self.assertEquals( | 19 | self.assertEqual( |
1634 | 20 | '/+processors/quantum', | 20 | '/+processors/quantum', |
1635 | 21 | canonical_url(quantum, force_local_path=True)) | 21 | canonical_url(quantum, force_local_path=True)) |
1636 | 22 | 22 | ||
1637 | @@ -24,4 +24,4 @@ | |||
1638 | 24 | quantum = self.factory.makeProcessor('quantum') | 24 | quantum = self.factory.makeProcessor('quantum') |
1639 | 25 | obj, view, request = test_traverse( | 25 | obj, view, request = test_traverse( |
1640 | 26 | 'http://api.launchpad.dev/devel/+processors/quantum') | 26 | 'http://api.launchpad.dev/devel/+processors/quantum') |
1642 | 27 | self.assertEquals(quantum, obj) | 27 | self.assertEqual(quantum, obj) |
1643 | 28 | 28 | ||
1644 | === modified file 'lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py' | |||
1645 | --- lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2016-06-01 15:13:12 +0000 | |||
1646 | +++ lib/lp/buildmaster/tests/test_buildfarmjobbehaviour.py 2018-01-02 16:24:23 +0000 | |||
1647 | @@ -269,7 +269,7 @@ | |||
1648 | 269 | result=True) | 269 | result=True) |
1649 | 270 | 270 | ||
1650 | 271 | def assertResultCount(self, count, result): | 271 | def assertResultCount(self, count, result): |
1652 | 272 | self.assertEquals( | 272 | self.assertEqual( |
1653 | 273 | 1, len(os.listdir(os.path.join(self.upload_root, result)))) | 273 | 1, len(os.listdir(os.path.join(self.upload_root, result)))) |
1654 | 274 | 274 | ||
1655 | 275 | @defer.inlineCallbacks | 275 | @defer.inlineCallbacks |
1656 | 276 | 276 | ||
1657 | === modified file 'lib/lp/buildmaster/tests/test_processor.py' | |||
1658 | --- lib/lp/buildmaster/tests/test_processor.py 2015-04-20 11:07:41 +0000 | |||
1659 | +++ lib/lp/buildmaster/tests/test_processor.py 2018-01-02 16:24:23 +0000 | |||
1660 | @@ -27,7 +27,7 @@ | |||
1661 | 27 | def test_getByName(self): | 27 | def test_getByName(self): |
1662 | 28 | processor_set = getUtility(IProcessorSet) | 28 | processor_set = getUtility(IProcessorSet) |
1663 | 29 | q1 = self.factory.makeProcessor(name='q1') | 29 | q1 = self.factory.makeProcessor(name='q1') |
1665 | 30 | self.assertEquals(q1, processor_set.getByName('q1')) | 30 | self.assertEqual(q1, processor_set.getByName('q1')) |
1666 | 31 | 31 | ||
1667 | 32 | def test_getByName_not_found(self): | 32 | def test_getByName_not_found(self): |
1668 | 33 | processor_set = getUtility(IProcessorSet) | 33 | processor_set = getUtility(IProcessorSet) |
1669 | @@ -42,7 +42,7 @@ | |||
1670 | 42 | self.factory.makeProcessor(name='q1') | 42 | self.factory.makeProcessor(name='q1') |
1671 | 43 | self.factory.makeProcessor(name='i686') | 43 | self.factory.makeProcessor(name='i686') |
1672 | 44 | self.factory.makeProcessor(name='g4') | 44 | self.factory.makeProcessor(name='g4') |
1674 | 45 | self.assertEquals( | 45 | self.assertEqual( |
1675 | 46 | ['g4', 'i686', 'q1'], | 46 | ['g4', 'i686', 'q1'], |
1676 | 47 | sorted( | 47 | sorted( |
1677 | 48 | processor.name for processor in processor_set.getAll() | 48 | processor.name for processor in processor_set.getAll() |
1678 | @@ -68,7 +68,7 @@ | |||
1679 | 68 | processor = self.webservice.named_get( | 68 | processor = self.webservice.named_get( |
1680 | 69 | '/+processors', 'getByName', name='transmeta', | 69 | '/+processors', 'getByName', name='transmeta', |
1681 | 70 | api_version='devel').jsonBody() | 70 | api_version='devel').jsonBody() |
1683 | 71 | self.assertEquals('transmeta', processor['name']) | 71 | self.assertEqual('transmeta', processor['name']) |
1684 | 72 | 72 | ||
1685 | 73 | def test_default_collection(self): | 73 | def test_default_collection(self): |
1686 | 74 | # Make it easy to filter out sample data | 74 | # Make it easy to filter out sample data |
1687 | @@ -82,7 +82,7 @@ | |||
1688 | 82 | 82 | ||
1689 | 83 | collection = self.webservice.get( | 83 | collection = self.webservice.get( |
1690 | 84 | '/+processors?ws.size=10', api_version='devel').jsonBody() | 84 | '/+processors?ws.size=10', api_version='devel').jsonBody() |
1692 | 85 | self.assertEquals( | 85 | self.assertEqual( |
1693 | 86 | ['g4', 'i686', 'q1'], | 86 | ['g4', 'i686', 'q1'], |
1694 | 87 | sorted( | 87 | sorted( |
1695 | 88 | processor['name'] for processor in collection['entries'] | 88 | processor['name'] for processor in collection['entries'] |
1696 | 89 | 89 | ||
1697 | === modified file 'lib/lp/buildmaster/tests/test_queuedepth.py' | |||
1698 | --- lib/lp/buildmaster/tests/test_queuedepth.py 2015-05-14 08:50:41 +0000 | |||
1699 | +++ lib/lp/buildmaster/tests/test_queuedepth.py 2018-01-02 16:24:23 +0000 | |||
1700 | @@ -75,7 +75,7 @@ | |||
1701 | 75 | time_stamp = job.date_started or datetime.now(utc) | 75 | time_stamp = job.date_started or datetime.now(utc) |
1702 | 76 | estimate = job.getEstimatedJobStartTime(now=time_stamp) | 76 | estimate = job.getEstimatedJobStartTime(now=time_stamp) |
1703 | 77 | if delay_in_seconds is None: | 77 | if delay_in_seconds is None: |
1705 | 78 | test.assertEquals( | 78 | test.assertEqual( |
1706 | 79 | delay_in_seconds, estimate, | 79 | delay_in_seconds, estimate, |
1707 | 80 | "An estimate should not be possible at present but one was " | 80 | "An estimate should not be possible at present but one was " |
1708 | 81 | "returned (%s) nevertheless." % estimate) | 81 | "returned (%s) nevertheless." % estimate) |
1709 | @@ -509,7 +509,7 @@ | |||
1710 | 509 | builder.builderok = False | 509 | builder.builderok = False |
1711 | 510 | 510 | ||
1712 | 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. |
1714 | 512 | self.assertEquals(0, builders_for_job(apg_job)) | 512 | self.assertEqual(0, builders_for_job(apg_job)) |
1715 | 513 | # The "minimum time to builder" estimation logic is not aware of this | 513 | # The "minimum time to builder" estimation logic is not aware of this |
1716 | 514 | # though. | 514 | # though. |
1717 | 515 | check_mintime_to_builder(self, apg_job, 0) | 515 | check_mintime_to_builder(self, apg_job, 0) |
1718 | @@ -526,7 +526,7 @@ | |||
1719 | 526 | 526 | ||
1720 | 527 | # All native builders are disabled now. No builders capable of | 527 | # All native builders are disabled now. No builders capable of |
1721 | 528 | # running the job at hand are available. | 528 | # running the job at hand are available. |
1723 | 529 | self.assertEquals(0, builders_for_job(job)) | 529 | self.assertEqual(0, builders_for_job(job)) |
1724 | 530 | # The "minimum time to builder" estimation logic is not aware of the | 530 | # The "minimum time to builder" estimation logic is not aware of the |
1725 | 531 | # fact that no builders capable of running the job are available. | 531 | # fact that no builders capable of running the job are available. |
1726 | 532 | check_mintime_to_builder(self, job, 0) | 532 | check_mintime_to_builder(self, job, 0) |
1727 | @@ -678,7 +678,7 @@ | |||
1728 | 678 | builder.builderok = False | 678 | builder.builderok = False |
1729 | 679 | 679 | ||
1730 | 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. |
1732 | 681 | self.assertEquals(0, builders_for_job(apg_job)) | 681 | self.assertEqual(0, builders_for_job(apg_job)) |
1733 | 682 | check_mintime_to_builder(self, apg_job, 0) | 682 | check_mintime_to_builder(self, apg_job, 0) |
1734 | 683 | 683 | ||
1735 | 684 | # Let's add a processor-independent job to the mix. | 684 | # Let's add a processor-independent job to the mix. |
1736 | @@ -687,7 +687,7 @@ | |||
1737 | 687 | sourcename='my-recipe-digikam', score=9999) | 687 | sourcename='my-recipe-digikam', score=9999) |
1738 | 688 | # There are still builders available for the processor-independent | 688 | # There are still builders available for the processor-independent |
1739 | 689 | # job. | 689 | # job. |
1741 | 690 | self.assertEquals(6, builders_for_job(job)) | 690 | self.assertEqual(6, builders_for_job(job)) |
1742 | 691 | # Even free ones. | 691 | # Even free ones. |
1743 | 692 | self.assertTrue( | 692 | self.assertTrue( |
1744 | 693 | bq._getFreeBuildersCount(job.processor, job.virtualized) > 0, | 693 | bq._getFreeBuildersCount(job.processor, job.virtualized) > 0, |
1745 | @@ -702,7 +702,7 @@ | |||
1746 | 702 | 702 | ||
1747 | 703 | # There are no builders capable of running even the processor | 703 | # There are no builders capable of running even the processor |
1748 | 704 | # independent jobs now. | 704 | # independent jobs now. |
1750 | 705 | self.assertEquals(0, builders_for_job(job)) | 705 | self.assertEqual(0, builders_for_job(job)) |
1751 | 706 | check_mintime_to_builder(self, job, 0) | 706 | check_mintime_to_builder(self, job, 0) |
1752 | 707 | 707 | ||
1753 | 708 | # Re-enable the native hppa builders. | 708 | # Re-enable the native hppa builders. |
1754 | @@ -840,9 +840,9 @@ | |||
1755 | 840 | check_delay_for_job(self, zsh_job, 0) | 840 | check_delay_for_job(self, zsh_job, 0) |
1756 | 841 | 841 | ||
1757 | 842 | # Assign the zsh job to a builder. | 842 | # Assign the zsh job to a builder. |
1759 | 843 | self.assertEquals((None, False), bash_job._getHeadJobPlatform()) | 843 | self.assertEqual((None, False), bash_job._getHeadJobPlatform()) |
1760 | 844 | assign_to_builder(self, 'xx-recipe-zsh', 1, None) | 844 | assign_to_builder(self, 'xx-recipe-zsh', 1, None) |
1762 | 845 | self.assertEquals((1, False), bash_job._getHeadJobPlatform()) | 845 | self.assertEqual((1, False), bash_job._getHeadJobPlatform()) |
1763 | 846 | 846 | ||
1764 | 847 | # Now that the highest-scored job is out of the way, the estimation | 847 | # Now that the highest-scored job is out of the way, the estimation |
1765 | 848 | # for the 'bash' recipe build is 222 seconds shorter. | 848 | # for the 'bash' recipe build is 222 seconds shorter. |
1766 | @@ -858,7 +858,7 @@ | |||
1767 | 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* |
1768 | 859 | # the head job now. | 859 | # the head job now. |
1769 | 860 | pg_platform = (postgres_job.processor.id, postgres_job.virtualized) | 860 | pg_platform = (postgres_job.processor.id, postgres_job.virtualized) |
1771 | 861 | self.assertEquals(pg_platform, postgres_job._getHeadJobPlatform()) | 861 | self.assertEqual(pg_platform, postgres_job._getHeadJobPlatform()) |
1772 | 862 | 862 | ||
1773 | 863 | 863 | ||
1774 | 864 | class TestJobDispatchTimeEstimation(MultiArchBuildsBase): | 864 | class TestJobDispatchTimeEstimation(MultiArchBuildsBase): |
1775 | @@ -948,7 +948,7 @@ | |||
1776 | 948 | # processor-independent jobs: | 948 | # processor-independent jobs: |
1777 | 949 | # (12:56 + 11:05 + 18:30 + 16:38 + 14:47 + 9:14)/6 = 831 | 949 | # (12:56 + 11:05 + 18:30 + 16:38 + 14:47 + 9:14)/6 = 831 |
1778 | 950 | check_estimate(self, gcc_job, 1671) | 950 | check_estimate(self, gcc_job, 1671) |
1780 | 951 | self.assertEquals(5, builders_for_job(gcc_job)) | 951 | self.assertEqual(5, builders_for_job(gcc_job)) |
1781 | 952 | 952 | ||
1782 | 953 | def test_proc_indep_virtual_true(self): | 953 | def test_proc_indep_virtual_true(self): |
1783 | 954 | xxr_build, xxr_job = find_job(self, 'xxr-apt-build', None) | 954 | xxr_build, xxr_job = find_job(self, 'xxr-apt-build', None) |
1784 | @@ -1029,8 +1029,8 @@ | |||
1785 | 1029 | # processor-independent jobs : | 1029 | # processor-independent jobs : |
1786 | 1030 | # (12:56 + 11:05 + 18:30 + 16:38 + 14:47)/5 = 887 | 1030 | # (12:56 + 11:05 + 18:30 + 16:38 + 14:47)/5 = 887 |
1787 | 1031 | # waiting time for next builder: = 120 | 1031 | # waiting time for next builder: = 120 |
1790 | 1032 | self.assertEquals(2, builders_for_job(vim_job)) | 1032 | self.assertEqual(2, builders_for_job(vim_job)) |
1791 | 1033 | self.assertEquals(9, builders_for_job(xxr_job)) | 1033 | self.assertEqual(9, builders_for_job(xxr_job)) |
1792 | 1034 | check_estimate(self, vim_job, 2747) | 1034 | check_estimate(self, vim_job, 2747) |
1793 | 1035 | 1035 | ||
1794 | 1036 | def test_estimation_binary_virtual_headjob(self): | 1036 | def test_estimation_binary_virtual_headjob(self): |
1795 | 1037 | 1037 | ||
1796 | === modified file 'lib/lp/buildmaster/tests/test_webservice.py' | |||
1797 | --- lib/lp/buildmaster/tests/test_webservice.py 2015-09-29 01:38:34 +0000 | |||
1798 | +++ lib/lp/buildmaster/tests/test_webservice.py 2018-01-02 16:24:23 +0000 | |||
1799 | @@ -79,7 +79,7 @@ | |||
1800 | 79 | logout() | 79 | logout() |
1801 | 80 | results = self.webservice.named_get( | 80 | results = self.webservice.named_get( |
1802 | 81 | '/builders', 'getBuildQueueSizes', api_version='devel') | 81 | '/builders', 'getBuildQueueSizes', api_version='devel') |
1804 | 82 | self.assertEquals( | 82 | self.assertEqual( |
1805 | 83 | ['nonvirt', 'virt'], sorted(results.jsonBody().keys())) | 83 | ['nonvirt', 'virt'], sorted(results.jsonBody().keys())) |
1806 | 84 | 84 | ||
1807 | 85 | def test_getBuildersForQueue(self): | 85 | def test_getBuildersForQueue(self): |
1808 | @@ -99,7 +99,7 @@ | |||
1809 | 99 | '/builders', 'getBuildersForQueue', | 99 | '/builders', 'getBuildersForQueue', |
1810 | 100 | processor=api_url(quantum), virtualized=True, | 100 | processor=api_url(quantum), virtualized=True, |
1811 | 101 | api_version='devel').jsonBody() | 101 | api_version='devel').jsonBody() |
1813 | 102 | self.assertEquals( | 102 | self.assertEqual( |
1814 | 103 | ['quantum_builder1', 'quantum_builder2'], | 103 | ['quantum_builder1', 'quantum_builder2'], |
1815 | 104 | sorted(builder['name'] for builder in results['entries'])) | 104 | sorted(builder['name'] for builder in results['entries'])) |
1816 | 105 | 105 | ||
1817 | 106 | 106 | ||
1818 | === modified file 'lib/lp/code/browser/tests/test_branch.py' | |||
1819 | --- lib/lp/code/browser/tests/test_branch.py 2017-11-10 11:28:43 +0000 | |||
1820 | +++ lib/lp/code/browser/tests/test_branch.py 2018-01-02 16:24:23 +0000 | |||
1821 | @@ -1046,7 +1046,7 @@ | |||
1822 | 1046 | browser.contents, | 1046 | browser.contents, |
1823 | 1047 | Contains('Public branches are not allowed for target Commercial.')) | 1047 | Contains('Public branches are not allowed for target Commercial.')) |
1824 | 1048 | with person_logged_in(owner): | 1048 | with person_logged_in(owner): |
1826 | 1049 | self.assertEquals(initial_target, branch.target.context) | 1049 | self.assertEqual(initial_target, branch.target.context) |
1827 | 1050 | 1050 | ||
1828 | 1051 | def test_information_type_in_ui(self): | 1051 | def test_information_type_in_ui(self): |
1829 | 1052 | # The information_type of a branch can be changed via the UI by an | 1052 | # The information_type of a branch can be changed via the UI by an |
1830 | 1053 | 1053 | ||
1831 | === modified file 'lib/lp/code/browser/tests/test_sourcepackagerecipe.py' | |||
1832 | --- lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2017-10-21 18:14:14 +0000 | |||
1833 | +++ lib/lp/code/browser/tests/test_sourcepackagerecipe.py 2018-01-02 16:24:23 +0000 | |||
1834 | @@ -443,7 +443,7 @@ | |||
1835 | 443 | self.makeBranchAndPackage(), '+new-recipe', user=self.chef) | 443 | self.makeBranchAndPackage(), '+new-recipe', user=self.chef) |
1836 | 444 | # The options for the owner include the Good Chefs team. | 444 | # The options for the owner include the Good Chefs team. |
1837 | 445 | options = browser.getControl(name='field.owner.owner').displayOptions | 445 | options = browser.getControl(name='field.owner.owner').displayOptions |
1839 | 446 | self.assertEquals( | 446 | self.assertEqual( |
1840 | 447 | ['Good Chefs (good-chefs)', 'Master Chef (chef)'], | 447 | ['Good Chefs (good-chefs)', 'Master Chef (chef)'], |
1841 | 448 | sorted([str(option) for option in options])) | 448 | sorted([str(option) for option in options])) |
1842 | 449 | 449 | ||
1843 | 450 | 450 | ||
1844 | === modified file 'lib/lp/code/model/tests/test_branch.py' | |||
1845 | --- lib/lp/code/model/tests/test_branch.py 2017-11-06 09:32:45 +0000 | |||
1846 | +++ lib/lp/code/model/tests/test_branch.py 2018-01-02 16:24:23 +0000 | |||
1847 | @@ -1240,8 +1240,8 @@ | |||
1848 | 1240 | branch_id = self.branch.id | 1240 | branch_id = self.branch.id |
1849 | 1241 | branch_set = getUtility(IBranchLookup) | 1241 | branch_set = getUtility(IBranchLookup) |
1850 | 1242 | self.branch.destroySelf() | 1242 | self.branch.destroySelf() |
1853 | 1243 | self.assert_(branch_set.get(branch_id) is None, | 1243 | self.assertIsNone( |
1854 | 1244 | "The branch has not been deleted.") | 1244 | branch_set.get(branch_id), "The branch has not been deleted.") |
1855 | 1245 | 1245 | ||
1856 | 1246 | def test_stackedBranchDisablesDeletion(self): | 1246 | def test_stackedBranchDisablesDeletion(self): |
1857 | 1247 | # A branch that is stacked upon cannot be deleted. | 1247 | # A branch that is stacked upon cannot be deleted. |
1858 | 1248 | 1248 | ||
1859 | === modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py' | |||
1860 | --- lib/lp/code/model/tests/test_branchmergeproposal.py 2017-11-24 17:22:34 +0000 | |||
1861 | +++ lib/lp/code/model/tests/test_branchmergeproposal.py 2018-01-02 16:24:23 +0000 | |||
1862 | @@ -2354,13 +2354,13 @@ | |||
1863 | 2354 | self.factory.makeRevisionsForBranch(bmp.source_branch, count=5) | 2354 | self.factory.makeRevisionsForBranch(bmp.source_branch, count=5) |
1864 | 2355 | r1 = bmp.source_branch.getBranchRevision(sequence=1) | 2355 | r1 = bmp.source_branch.getBranchRevision(sequence=1) |
1865 | 2356 | initial_revisions = list(bmp.getUnlandedSourceBranchRevisions()) | 2356 | initial_revisions = list(bmp.getUnlandedSourceBranchRevisions()) |
1867 | 2357 | self.assertEquals(5, len(initial_revisions)) | 2357 | self.assertEqual(5, len(initial_revisions)) |
1868 | 2358 | self.assertIn(r1, initial_revisions) | 2358 | self.assertIn(r1, initial_revisions) |
1869 | 2359 | # If we push one of the revisions into the target, it disappears | 2359 | # If we push one of the revisions into the target, it disappears |
1870 | 2360 | # from the unlanded list. | 2360 | # from the unlanded list. |
1871 | 2361 | bmp.target_branch.createBranchRevision(1, r1.revision) | 2361 | bmp.target_branch.createBranchRevision(1, r1.revision) |
1872 | 2362 | partial_revisions = list(bmp.getUnlandedSourceBranchRevisions()) | 2362 | partial_revisions = list(bmp.getUnlandedSourceBranchRevisions()) |
1874 | 2363 | self.assertEquals(4, len(partial_revisions)) | 2363 | self.assertEqual(4, len(partial_revisions)) |
1875 | 2364 | self.assertNotIn(r1, partial_revisions) | 2364 | self.assertNotIn(r1, partial_revisions) |
1876 | 2365 | 2365 | ||
1877 | 2366 | 2366 | ||
1878 | 2367 | 2367 | ||
1879 | === modified file 'lib/lp/code/model/tests/test_codeimportjob.py' | |||
1880 | --- lib/lp/code/model/tests/test_codeimportjob.py 2017-10-04 01:53:48 +0000 | |||
1881 | +++ lib/lp/code/model/tests/test_codeimportjob.py 2018-01-02 16:24:23 +0000 | |||
1882 | @@ -137,7 +137,7 @@ | |||
1883 | 137 | """Assert that the expected job is chosen by getJobForMachine.""" | 137 | """Assert that the expected job is chosen by getJobForMachine.""" |
1884 | 138 | observed_job = getUtility(ICodeImportJobSet).getJobForMachine( | 138 | observed_job = getUtility(ICodeImportJobSet).getJobForMachine( |
1885 | 139 | self.machine.hostname, worker_limit=10) | 139 | self.machine.hostname, worker_limit=10) |
1887 | 140 | self.assert_(observed_job is not None, "No job was selected.") | 140 | self.assertIsNotNone(observed_job, "No job was selected.") |
1888 | 141 | self.assertEqual(desired_job, observed_job, | 141 | self.assertEqual(desired_job, observed_job, |
1889 | 142 | "Expected job not selected.") | 142 | "Expected job not selected.") |
1890 | 143 | 143 | ||
1891 | @@ -145,7 +145,7 @@ | |||
1892 | 145 | """Assert that no job is selected.""" | 145 | """Assert that no job is selected.""" |
1893 | 146 | observed_job = getUtility(ICodeImportJobSet).getJobForMachine( | 146 | observed_job = getUtility(ICodeImportJobSet).getJobForMachine( |
1894 | 147 | 'machine', worker_limit=10) | 147 | 'machine', worker_limit=10) |
1896 | 148 | self.assert_(observed_job is None, "Job unexpectedly selected.") | 148 | self.assertIsNone(observed_job, "Job unexpectedly selected.") |
1897 | 149 | 149 | ||
1898 | 150 | def test_nothingSelectedIfNothingCreated(self): | 150 | def test_nothingSelectedIfNothingCreated(self): |
1899 | 151 | # There are no due jobs pending if we don't create any (this | 151 | # There are no due jobs pending if we don't create any (this |
1900 | @@ -775,7 +775,7 @@ | |||
1901 | 775 | getUtility(ICodeImportJobWorkflow).finishJob( | 775 | getUtility(ICodeImportJobWorkflow).finishJob( |
1902 | 776 | running_job, CodeImportResultStatus.SUCCESS, None) | 776 | running_job, CodeImportResultStatus.SUCCESS, None) |
1903 | 777 | new_job = code_import.import_job | 777 | new_job = code_import.import_job |
1905 | 778 | self.assert_(new_job is not None) | 778 | self.assertIsNotNone(new_job) |
1906 | 779 | self.assertEqual(new_job.state, CodeImportJobState.PENDING) | 779 | self.assertEqual(new_job.state, CodeImportJobState.PENDING) |
1907 | 780 | self.assertEqual(new_job.machine, None) | 780 | self.assertEqual(new_job.machine, None) |
1908 | 781 | self.assertEqual( | 781 | self.assertEqual( |
1909 | @@ -791,7 +791,7 @@ | |||
1910 | 791 | getUtility(ICodeImportJobWorkflow).finishJob( | 791 | getUtility(ICodeImportJobWorkflow).finishJob( |
1911 | 792 | running_job, CodeImportResultStatus.SUCCESS_PARTIAL, None) | 792 | running_job, CodeImportResultStatus.SUCCESS_PARTIAL, None) |
1912 | 793 | new_job = code_import.import_job | 793 | new_job = code_import.import_job |
1914 | 794 | self.assert_(new_job is not None) | 794 | self.assertIsNotNone(new_job) |
1915 | 795 | self.assertEqual(new_job.state, CodeImportJobState.PENDING) | 795 | self.assertEqual(new_job.state, CodeImportJobState.PENDING) |
1916 | 796 | self.assertEqual(new_job.machine, None) | 796 | self.assertEqual(new_job.machine, None) |
1917 | 797 | self.assertSqlAttributeEqualsDate(new_job, 'date_due', UTC_NOW) | 797 | self.assertSqlAttributeEqualsDate(new_job, 'date_due', UTC_NOW) |
1918 | 798 | 798 | ||
1919 | === modified file 'lib/lp/code/model/tests/test_recipebuilder.py' | |||
1920 | --- lib/lp/code/model/tests/test_recipebuilder.py 2017-10-04 01:53:48 +0000 | |||
1921 | +++ lib/lp/code/model/tests/test_recipebuilder.py 2018-01-02 16:24:23 +0000 | |||
1922 | @@ -128,7 +128,7 @@ | |||
1923 | 128 | job.setBuilder(builder, OkSlave()) | 128 | job.setBuilder(builder, OkSlave()) |
1924 | 129 | logger = BufferLogger() | 129 | logger = BufferLogger() |
1925 | 130 | job.verifyBuildRequest(logger) | 130 | job.verifyBuildRequest(logger) |
1927 | 131 | self.assertEquals("", logger.getLogBuffer()) | 131 | self.assertEqual("", logger.getLogBuffer()) |
1928 | 132 | 132 | ||
1929 | 133 | def test_verifyBuildRequest_non_virtual(self): | 133 | def test_verifyBuildRequest_non_virtual(self): |
1930 | 134 | # verifyBuildRequest will raise if a non-virtual builder is proposed. | 134 | # verifyBuildRequest will raise if a non-virtual builder is proposed. |
1931 | 135 | 135 | ||
1932 | === modified file 'lib/lp/code/model/tests/test_revision.py' | |||
1933 | --- lib/lp/code/model/tests/test_revision.py 2017-10-04 01:49:22 +0000 | |||
1934 | +++ lib/lp/code/model/tests/test_revision.py 2018-01-02 16:24:23 +0000 | |||
1935 | @@ -215,7 +215,7 @@ | |||
1936 | 215 | # IRevisionSet.getByRevisionId returns the revision with that id. | 215 | # IRevisionSet.getByRevisionId returns the revision with that id. |
1937 | 216 | revision = self.factory.makeRevision() | 216 | revision = self.factory.makeRevision() |
1938 | 217 | found = self.revision_set.getByRevisionId(revision.revision_id) | 217 | found = self.revision_set.getByRevisionId(revision.revision_id) |
1940 | 218 | self.assertEquals(revision, found) | 218 | self.assertEqual(revision, found) |
1941 | 219 | 219 | ||
1942 | 220 | def test_getRevisionById_nonexistent(self): | 220 | def test_getRevisionById_nonexistent(self): |
1943 | 221 | # IRevisionSet.getByRevisionId returns None if there is no revision | 221 | # IRevisionSet.getByRevisionId returns None if there is no revision |
1944 | 222 | 222 | ||
1945 | === modified file 'lib/lp/code/model/tests/test_sourcepackagerecipebuild.py' | |||
1946 | --- lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2017-10-04 01:53:48 +0000 | |||
1947 | +++ lib/lp/code/model/tests/test_sourcepackagerecipebuild.py 2018-01-02 16:24:23 +0000 | |||
1948 | @@ -356,9 +356,9 @@ | |||
1949 | 356 | date_created=datetime.now(utc) - timedelta(hours=24, seconds=1), | 356 | date_created=datetime.now(utc) - timedelta(hours=24, seconds=1), |
1950 | 357 | status=BuildStatus.FULLYBUILT) | 357 | status=BuildStatus.FULLYBUILT) |
1951 | 358 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() | 358 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() |
1953 | 359 | self.assertEquals(1, len(daily_builds)) | 359 | self.assertEqual(1, len(daily_builds)) |
1954 | 360 | actual_title = [b.title for b in daily_builds] | 360 | actual_title = [b.title for b in daily_builds] |
1956 | 361 | self.assertEquals([build.title], actual_title) | 361 | self.assertEqual([build.title], actual_title) |
1957 | 362 | 362 | ||
1958 | 363 | def test_makeDailyBuilds_with_an_older_and_newer_build(self): | 363 | def test_makeDailyBuilds_with_an_older_and_newer_build(self): |
1959 | 364 | # If a recipe has been built twice, and the most recent build is | 364 | # If a recipe has been built twice, and the most recent build is |
1960 | @@ -374,7 +374,7 @@ | |||
1961 | 374 | date_created=datetime.now(utc) - timediff, | 374 | date_created=datetime.now(utc) - timediff, |
1962 | 375 | status=BuildStatus.FULLYBUILT) | 375 | status=BuildStatus.FULLYBUILT) |
1963 | 376 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() | 376 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() |
1965 | 377 | self.assertEquals([], list(daily_builds)) | 377 | self.assertEqual([], list(daily_builds)) |
1966 | 378 | 378 | ||
1967 | 379 | def test_makeDailyBuilds_with_new_build_different_archive(self): | 379 | def test_makeDailyBuilds_with_new_build_different_archive(self): |
1968 | 380 | # If a recipe has been built into an archive that isn't the | 380 | # If a recipe has been built into an archive that isn't the |
1969 | @@ -390,7 +390,7 @@ | |||
1970 | 390 | status=BuildStatus.FULLYBUILT) | 390 | status=BuildStatus.FULLYBUILT) |
1971 | 391 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() | 391 | daily_builds = SourcePackageRecipeBuild.makeDailyBuilds() |
1972 | 392 | actual_title = [b.title for b in daily_builds] | 392 | actual_title = [b.title for b in daily_builds] |
1974 | 393 | self.assertEquals([build.title], actual_title) | 393 | self.assertEqual([build.title], actual_title) |
1975 | 394 | 394 | ||
1976 | 395 | def test_makeDailyBuilds_with_disallowed_series(self): | 395 | def test_makeDailyBuilds_with_disallowed_series(self): |
1977 | 396 | # If a recipe is set to build into a disallowed series, | 396 | # If a recipe is set to build into a disallowed series, |
1978 | @@ -402,7 +402,7 @@ | |||
1979 | 402 | distroseries = list(recipe.distroseries)[0] | 402 | distroseries = list(recipe.distroseries)[0] |
1980 | 403 | removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE | 403 | removeSecurityProxy(distroseries).status = SeriesStatus.OBSOLETE |
1981 | 404 | SourcePackageRecipeBuild.makeDailyBuilds(logger) | 404 | SourcePackageRecipeBuild.makeDailyBuilds(logger) |
1983 | 405 | self.assertEquals([], self.oopses) | 405 | self.assertEqual([], self.oopses) |
1984 | 406 | self.assertIn( | 406 | self.assertIn( |
1985 | 407 | "DEBUG - cannot build against Warty (4.10).", | 407 | "DEBUG - cannot build against Warty (4.10).", |
1986 | 408 | logger.getLogBuffer()) | 408 | logger.getLogBuffer()) |
1987 | @@ -452,7 +452,7 @@ | |||
1988 | 452 | def test_getUploader(self): | 452 | def test_getUploader(self): |
1989 | 453 | # For ACL purposes the uploader is the build requester. | 453 | # For ACL purposes the uploader is the build requester. |
1990 | 454 | build = self.makeSourcePackageRecipeBuild() | 454 | build = self.makeSourcePackageRecipeBuild() |
1992 | 455 | self.assertEquals(build.requester, | 455 | self.assertEqual(build.requester, |
1993 | 456 | build.getUploader(None)) | 456 | build.getUploader(None)) |
1994 | 457 | 457 | ||
1995 | 458 | def test_getByBuildFarmJob(self): | 458 | def test_getByBuildFarmJob(self): |
1996 | @@ -497,7 +497,7 @@ | |||
1997 | 497 | build.updateStatus(BuildStatus.FULLYBUILT) | 497 | build.updateStatus(BuildStatus.FULLYBUILT) |
1998 | 498 | IStore(build).flush() | 498 | IStore(build).flush() |
1999 | 499 | build.notify() | 499 | build.notify() |
2001 | 500 | self.assertEquals(0, len(pop_notifications())) | 500 | self.assertEqual(0, len(pop_notifications())) |
2002 | 501 | 501 | ||
2003 | 502 | def test_notify_when_recipe_deleted(self): | 502 | def test_notify_when_recipe_deleted(self): |
2004 | 503 | """Notify does nothing if recipe has been deleted.""" | 503 | """Notify does nothing if recipe has been deleted.""" |
2005 | @@ -516,4 +516,4 @@ | |||
2006 | 516 | IStore(build).flush() | 516 | IStore(build).flush() |
2007 | 517 | build.notify() | 517 | build.notify() |
2008 | 518 | notifications = pop_notifications() | 518 | notifications = pop_notifications() |
2010 | 519 | self.assertEquals(0, len(notifications)) | 519 | self.assertEqual(0, len(notifications)) |
2011 | 520 | 520 | ||
2012 | === modified file 'lib/lp/code/tests/test_branch_webservice.py' | |||
2013 | --- lib/lp/code/tests/test_branch_webservice.py 2017-10-04 01:53:48 +0000 | |||
2014 | +++ lib/lp/code/tests/test_branch_webservice.py 2018-01-02 16:24:23 +0000 | |||
2015 | @@ -114,7 +114,7 @@ | |||
2016 | 114 | target_branch=target, initial_comment='Merge\nit!', | 114 | target_branch=target, initial_comment='Merge\nit!', |
2017 | 115 | needs_review=True, commit_message='It was merged!\n', | 115 | needs_review=True, commit_message='It was merged!\n', |
2018 | 116 | reviewers=[source.owner.self_link], review_types=[]) | 116 | reviewers=[source.owner.self_link], review_types=[]) |
2020 | 117 | self.assertEquals( | 117 | self.assertEqual( |
2021 | 118 | exception.content, | 118 | exception.content, |
2022 | 119 | 'reviewers and review_types must be equal length.') | 119 | 'reviewers and review_types must be equal length.') |
2023 | 120 | 120 | ||
2024 | @@ -148,7 +148,7 @@ | |||
2025 | 148 | BadRequest, source.createMergeProposal, | 148 | BadRequest, source.createMergeProposal, |
2026 | 149 | target_branch=source, initial_comment='Merge\nit!', | 149 | target_branch=source, initial_comment='Merge\nit!', |
2027 | 150 | needs_review=True, commit_message='It was merged!\n') | 150 | needs_review=True, commit_message='It was merged!\n') |
2029 | 151 | self.assertEquals( | 151 | self.assertEqual( |
2030 | 152 | exception.content, | 152 | exception.content, |
2031 | 153 | 'Source and target branches must be different.') | 153 | 'Source and target branches must be different.') |
2032 | 154 | 154 | ||
2033 | 155 | 155 | ||
2034 | === modified file 'lib/lp/code/tests/test_bzr.py' | |||
2035 | --- lib/lp/code/tests/test_bzr.py 2017-10-04 01:49:22 +0000 | |||
2036 | +++ lib/lp/code/tests/test_bzr.py 2018-01-02 16:24:23 +0000 | |||
2037 | @@ -85,7 +85,7 @@ | |||
2038 | 85 | 85 | ||
2039 | 86 | def test_empty(self): | 86 | def test_empty(self): |
2040 | 87 | branch = self.make_branch('test') | 87 | branch = self.make_branch('test') |
2042 | 88 | self.assertEquals([], branch_revision_history(branch)) | 88 | self.assertEqual([], branch_revision_history(branch)) |
2043 | 89 | 89 | ||
2044 | 90 | def test_some_commits(self): | 90 | def test_some_commits(self): |
2045 | 91 | branch = self.make_branch('test') | 91 | branch = self.make_branch('test') |
2046 | @@ -93,7 +93,7 @@ | |||
2047 | 93 | tree.commit('acommit', rev_id=b'A') | 93 | tree.commit('acommit', rev_id=b'A') |
2048 | 94 | tree.commit('bcommit', rev_id=b'B') | 94 | tree.commit('bcommit', rev_id=b'B') |
2049 | 95 | tree.commit('ccommit', rev_id=b'C') | 95 | tree.commit('ccommit', rev_id=b'C') |
2051 | 96 | self.assertEquals( | 96 | self.assertEqual( |
2052 | 97 | [b'A', b'B', b'C'], branch_revision_history(tree.branch)) | 97 | [b'A', b'B', b'C'], branch_revision_history(tree.branch)) |
2053 | 98 | 98 | ||
2054 | 99 | 99 | ||
2055 | 100 | 100 | ||
2056 | === modified file 'lib/lp/code/xmlrpc/tests/test_codehosting.py' | |||
2057 | --- lib/lp/code/xmlrpc/tests/test_codehosting.py 2016-12-31 05:01:10 +0000 | |||
2058 | +++ lib/lp/code/xmlrpc/tests/test_codehosting.py 2018-01-02 16:24:23 +0000 | |||
2059 | @@ -258,7 +258,7 @@ | |||
2060 | 258 | self.assertUnmirrored(branch) | 258 | self.assertUnmirrored(branch) |
2061 | 259 | 259 | ||
2062 | 260 | branch.requestMirror() | 260 | branch.requestMirror() |
2064 | 261 | self.assertEquals( | 261 | self.assertEqual( |
2065 | 262 | branch.id, self.codehosting_api.acquireBranchToPull([])[0]) | 262 | branch.id, self.codehosting_api.acquireBranchToPull([])[0]) |
2066 | 263 | 263 | ||
2067 | 264 | failure_message = self.factory.getUniqueString() | 264 | failure_message = self.factory.getUniqueString() |
2068 | 265 | 265 | ||
2069 | === modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py' | |||
2070 | --- lib/lp/codehosting/codeimport/tests/test_worker.py 2017-01-12 18:01:56 +0000 | |||
2071 | +++ lib/lp/codehosting/codeimport/tests/test_worker.py 2018-01-02 16:24:23 +0000 | |||
2072 | @@ -253,7 +253,7 @@ | |||
2073 | 253 | target_url = store._getMirrorURL(self.arbitrary_branch_id) | 253 | target_url = store._getMirrorURL(self.arbitrary_branch_id) |
2074 | 254 | knit_format = format_registry.get('knit')() | 254 | knit_format = format_registry.get('knit')() |
2075 | 255 | tree = create_branch_with_one_revision(target_url, format=knit_format) | 255 | tree = create_branch_with_one_revision(target_url, format=knit_format) |
2077 | 256 | self.assertNotEquals( | 256 | self.assertNotEqual( |
2078 | 257 | tree.bzrdir._format.repository_format.network_name(), | 257 | tree.bzrdir._format.repository_format.network_name(), |
2079 | 258 | default_format.repository_format.network_name()) | 258 | default_format.repository_format.network_name()) |
2080 | 259 | 259 | ||
2081 | @@ -261,8 +261,8 @@ | |||
2082 | 261 | new_branch = store.pull( | 261 | new_branch = store.pull( |
2083 | 262 | self.arbitrary_branch_id, self.temp_dir, default_format) | 262 | self.arbitrary_branch_id, self.temp_dir, default_format) |
2084 | 263 | # Make sure backup.bzr is removed, as it interferes with CSCVS. | 263 | # Make sure backup.bzr is removed, as it interferes with CSCVS. |
2087 | 264 | self.assertEquals(os.listdir(self.temp_dir), [".bzr"]) | 264 | self.assertEqual(os.listdir(self.temp_dir), [".bzr"]) |
2088 | 265 | self.assertEquals(new_branch.repository._format.network_name(), | 265 | self.assertEqual(new_branch.repository._format.network_name(), |
2089 | 266 | default_format.repository_format.network_name()) | 266 | default_format.repository_format.network_name()) |
2090 | 267 | 267 | ||
2091 | 268 | def test_pushUpgradesFormat(self): | 268 | def test_pushUpgradesFormat(self): |
2092 | @@ -292,13 +292,13 @@ | |||
2093 | 292 | # Only .bzr is left behind. The scanner removes branches | 292 | # Only .bzr is left behind. The scanner removes branches |
2094 | 293 | # in which invalid directories (such as .bzr.retire. | 293 | # in which invalid directories (such as .bzr.retire. |
2095 | 294 | # exist). (bug #798560) | 294 | # exist). (bug #798560) |
2097 | 295 | self.assertEquals( | 295 | self.assertEqual( |
2098 | 296 | target_branch.user_transport.list_dir("."), | 296 | target_branch.user_transport.list_dir("."), |
2099 | 297 | [".bzr"]) | 297 | [".bzr"]) |
2100 | 298 | self.assertEqual( | 298 | self.assertEqual( |
2101 | 299 | default_format.get_branch_format(), | 299 | default_format.get_branch_format(), |
2102 | 300 | target_branch._format) | 300 | target_branch._format) |
2104 | 301 | self.assertEquals( | 301 | self.assertEqual( |
2105 | 302 | target_branch.last_revision_info(), | 302 | target_branch.last_revision_info(), |
2106 | 303 | new_branch.last_revision_info()) | 303 | new_branch.last_revision_info()) |
2107 | 304 | 304 | ||
2108 | @@ -461,7 +461,7 @@ | |||
2109 | 461 | store = ImportDataStore(transport, source_details) | 461 | store = ImportDataStore(transport, source_details) |
2110 | 462 | local_name = '%s.tar.gz' % (self.factory.getUniqueString('tarball'),) | 462 | local_name = '%s.tar.gz' % (self.factory.getUniqueString('tarball'),) |
2111 | 463 | store.fetch(local_name) | 463 | store.fetch(local_name) |
2113 | 464 | self.assertEquals(content, open(local_name).read()) | 464 | self.assertEqual(content, open(local_name).read()) |
2114 | 465 | 465 | ||
2115 | 466 | def test_fetch_with_dest_transport(self): | 466 | def test_fetch_with_dest_transport(self): |
2116 | 467 | # The second, optional, argument to fetch is the transport in which to | 467 | # The second, optional, argument to fetch is the transport in which to |
2117 | @@ -478,7 +478,7 @@ | |||
2118 | 478 | self.get_transport(local_prefix).ensure_base() | 478 | self.get_transport(local_prefix).ensure_base() |
2119 | 479 | local_name = '%s.tar.gz' % (self.factory.getUniqueString(),) | 479 | local_name = '%s.tar.gz' % (self.factory.getUniqueString(),) |
2120 | 480 | store.fetch(local_name, self.get_transport(local_prefix)) | 480 | store.fetch(local_name, self.get_transport(local_prefix)) |
2122 | 481 | self.assertEquals( | 481 | self.assertEqual( |
2123 | 482 | content, open(os.path.join(local_prefix, local_name)).read()) | 482 | content, open(os.path.join(local_prefix, local_name)).read()) |
2124 | 483 | 483 | ||
2125 | 484 | def test_put_copiesFileToTransport(self): | 484 | def test_put_copiesFileToTransport(self): |
2126 | @@ -494,7 +494,7 @@ | |||
2127 | 494 | # That the remote name is like this is part of the interface of | 494 | # That the remote name is like this is part of the interface of |
2128 | 495 | # ImportDataStore. | 495 | # ImportDataStore. |
2129 | 496 | remote_name = '%08x.tar.gz' % (source_details.target_id,) | 496 | remote_name = '%08x.tar.gz' % (source_details.target_id,) |
2131 | 497 | self.assertEquals(content, transport.get_bytes(remote_name)) | 497 | self.assertEqual(content, transport.get_bytes(remote_name)) |
2132 | 498 | 498 | ||
2133 | 499 | def test_put_ensures_base(self): | 499 | def test_put_ensures_base(self): |
2134 | 500 | # Put ensures that the directory pointed to by the transport exists. | 500 | # Put ensures that the directory pointed to by the transport exists. |
2135 | @@ -522,7 +522,7 @@ | |||
2136 | 522 | # That the remote name is like this is part of the interface of | 522 | # That the remote name is like this is part of the interface of |
2137 | 523 | # ImportDataStore. | 523 | # ImportDataStore. |
2138 | 524 | remote_name = '%08x.tar.gz' % (source_details.target_id,) | 524 | remote_name = '%08x.tar.gz' % (source_details.target_id,) |
2140 | 525 | self.assertEquals(content, transport.get_bytes(remote_name)) | 525 | self.assertEqual(content, transport.get_bytes(remote_name)) |
2141 | 526 | 526 | ||
2142 | 527 | 527 | ||
2143 | 528 | class MockForeignWorkingTree: | 528 | class MockForeignWorkingTree: |
2144 | @@ -1110,7 +1110,7 @@ | |||
2145 | 1110 | # There should only be one revision there, the other | 1110 | # There should only be one revision there, the other |
2146 | 1111 | # one is in the stacked-on repository. | 1111 | # one is in the stacked-on repository. |
2147 | 1112 | self.addCleanup(stacked_on.lock_read().unlock) | 1112 | self.addCleanup(stacked_on.lock_read().unlock) |
2149 | 1113 | self.assertEquals( | 1113 | self.assertEqual( |
2150 | 1114 | base_rev_count, | 1114 | base_rev_count, |
2151 | 1115 | len(stacked_on.repository.revisions.keys())) | 1115 | len(stacked_on.repository.revisions.keys())) |
2152 | 1116 | worker = self.makeImportWorker( | 1116 | worker = self.makeImportWorker( |
2153 | @@ -1120,15 +1120,15 @@ | |||
2154 | 1120 | self.assertEqual( | 1120 | self.assertEqual( |
2155 | 1121 | CodeImportWorkerExitCode.SUCCESS, worker.run()) | 1121 | CodeImportWorkerExitCode.SUCCESS, worker.run()) |
2156 | 1122 | branch = self.getStoredBazaarBranch(worker) | 1122 | branch = self.getStoredBazaarBranch(worker) |
2158 | 1123 | self.assertEquals( | 1123 | self.assertEqual( |
2159 | 1124 | base_rev_count, | 1124 | base_rev_count, |
2160 | 1125 | len(stacked_on.repository.revisions.keys())) | 1125 | len(stacked_on.repository.revisions.keys())) |
2161 | 1126 | # There should only be one revision there, the other | 1126 | # There should only be one revision there, the other |
2162 | 1127 | # one is in the stacked-on repository. | 1127 | # one is in the stacked-on repository. |
2163 | 1128 | self.addCleanup(branch.lock_read().unlock) | 1128 | self.addCleanup(branch.lock_read().unlock) |
2165 | 1129 | self.assertEquals(1, | 1129 | self.assertEqual(1, |
2166 | 1130 | len(branch.repository.revisions.without_fallbacks().keys())) | 1130 | len(branch.repository.revisions.without_fallbacks().keys())) |
2168 | 1131 | self.assertEquals(stacked_on.base, branch.get_stacked_on_url()) | 1131 | self.assertEqual(stacked_on.base, branch.get_stacked_on_url()) |
2169 | 1132 | 1132 | ||
2170 | 1133 | 1133 | ||
2171 | 1134 | class TestGitImport(WorkerTest, TestActualImportMixin, | 1134 | class TestGitImport(WorkerTest, TestActualImportMixin, |
2172 | @@ -1197,7 +1197,7 @@ | |||
2173 | 1197 | source_details.url = urlutils.join_segment_parameters( | 1197 | source_details.url = urlutils.join_segment_parameters( |
2174 | 1198 | source_details.url, {"branch": "other"}) | 1198 | source_details.url, {"branch": "other"}) |
2175 | 1199 | source_transport = get_transport_from_url(source_details.url) | 1199 | source_transport = get_transport_from_url(source_details.url) |
2177 | 1200 | self.assertEquals( | 1200 | self.assertEqual( |
2178 | 1201 | {"branch": "other"}, | 1201 | {"branch": "other"}, |
2179 | 1202 | source_transport.get_segment_parameters()) | 1202 | source_transport.get_segment_parameters()) |
2180 | 1203 | worker = self.makeImportWorker(source_details, | 1203 | worker = self.makeImportWorker(source_details, |
2181 | @@ -1207,7 +1207,7 @@ | |||
2182 | 1207 | CodeImportWorkerExitCode.SUCCESS, worker.run()) | 1207 | CodeImportWorkerExitCode.SUCCESS, worker.run()) |
2183 | 1208 | branch = worker.getBazaarBranch() | 1208 | branch = worker.getBazaarBranch() |
2184 | 1209 | lastrev = branch.repository.get_revision(branch.last_revision()) | 1209 | lastrev = branch.repository.get_revision(branch.last_revision()) |
2186 | 1210 | self.assertEquals(lastrev.message, "Message for other") | 1210 | self.assertEqual(lastrev.message, "Message for other") |
2187 | 1211 | 1211 | ||
2188 | 1212 | 1212 | ||
2189 | 1213 | class TestBzrSvnImport(WorkerTest, SubversionImportHelpers, | 1213 | class TestBzrSvnImport(WorkerTest, SubversionImportHelpers, |
2190 | @@ -1311,7 +1311,7 @@ | |||
2191 | 1311 | self.policy = CodeImportBranchOpenPolicy("bzr", "bzr") | 1311 | self.policy = CodeImportBranchOpenPolicy("bzr", "bzr") |
2192 | 1312 | 1312 | ||
2193 | 1313 | def test_follows_references(self): | 1313 | def test_follows_references(self): |
2195 | 1314 | self.assertEquals(True, self.policy.shouldFollowReferences()) | 1314 | self.assertEqual(True, self.policy.shouldFollowReferences()) |
2196 | 1315 | 1315 | ||
2197 | 1316 | def assertBadUrl(self, url): | 1316 | def assertBadUrl(self, url): |
2198 | 1317 | self.assertRaises(BadUrl, self.policy.checkOneURL, url) | 1317 | self.assertRaises(BadUrl, self.policy.checkOneURL, url) |
2199 | @@ -1378,7 +1378,7 @@ | |||
2200 | 1378 | branch_url = self.bazaar_store._getMirrorURL( | 1378 | branch_url = self.bazaar_store._getMirrorURL( |
2201 | 1379 | worker.source_details.target_id) | 1379 | worker.source_details.target_id) |
2202 | 1380 | branch = Branch.open(branch_url) | 1380 | branch = Branch.open(branch_url) |
2204 | 1381 | self.assertEquals(self.revid, branch.last_revision()) | 1381 | self.assertEqual(self.revid, branch.last_revision()) |
2205 | 1382 | 1382 | ||
2206 | 1383 | def test_redirect_to_forbidden_url(self): | 1383 | def test_redirect_to_forbidden_url(self): |
2207 | 1384 | class NewUrlBlacklistPolicy(BranchOpenPolicy): | 1384 | class NewUrlBlacklistPolicy(BranchOpenPolicy): |
2208 | 1385 | 1385 | ||
2209 | === modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py' | |||
2210 | --- lib/lp/codehosting/scanner/tests/test_buglinks.py 2016-02-04 05:43:46 +0000 | |||
2211 | +++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2018-01-02 16:24:23 +0000 | |||
2212 | @@ -61,7 +61,7 @@ | |||
2213 | 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, |
2214 | 62 | # mapping the bug_id to the status. | 62 | # mapping the bug_id to the status. |
2215 | 63 | bugs = self.extractBugInfo("https://launchpad.net/bugs/9999 fixed") | 63 | bugs = self.extractBugInfo("https://launchpad.net/bugs/9999 fixed") |
2217 | 64 | self.assertEquals(bugs, {9999: 'fixed'}) | 64 | self.assertEqual(bugs, {9999: 'fixed'}) |
2218 | 65 | 65 | ||
2219 | 66 | def test_multiple(self): | 66 | def test_multiple(self): |
2220 | 67 | # Information about more than one bug can be specified. Make sure that | 67 | # Information about more than one bug can be specified. Make sure that |
2221 | @@ -69,39 +69,39 @@ | |||
2222 | 69 | bugs = self.extractBugInfo( | 69 | bugs = self.extractBugInfo( |
2223 | 70 | "https://launchpad.net/bugs/9999 fixed\n" | 70 | "https://launchpad.net/bugs/9999 fixed\n" |
2224 | 71 | "https://launchpad.net/bugs/8888 fixed") | 71 | "https://launchpad.net/bugs/8888 fixed") |
2227 | 72 | self.assertEquals(bugs, {9999: 'fixed', | 72 | self.assertEqual(bugs, {9999: 'fixed', |
2228 | 73 | 8888: 'fixed'}) | 73 | 8888: 'fixed'}) |
2229 | 74 | 74 | ||
2230 | 75 | def test_empty(self): | 75 | def test_empty(self): |
2231 | 76 | # If the property is empty, then return an empty dict. | 76 | # If the property is empty, then return an empty dict. |
2232 | 77 | bugs = self.extractBugInfo('') | 77 | bugs = self.extractBugInfo('') |
2234 | 78 | self.assertEquals(bugs, {}) | 78 | self.assertEqual(bugs, {}) |
2235 | 79 | 79 | ||
2236 | 80 | def test_bad_bug(self): | 80 | def test_bad_bug(self): |
2237 | 81 | # If the given bug is not a valid integer, then skip it, generate an | 81 | # If the given bug is not a valid integer, then skip it, generate an |
2238 | 82 | # OOPS and continue processing. | 82 | # OOPS and continue processing. |
2239 | 83 | bugs = self.extractBugInfo('https://launchpad.net/~jml fixed') | 83 | bugs = self.extractBugInfo('https://launchpad.net/~jml fixed') |
2241 | 84 | self.assertEquals(bugs, {}) | 84 | self.assertEqual(bugs, {}) |
2242 | 85 | 85 | ||
2243 | 86 | def test_non_launchpad_bug(self): | 86 | def test_non_launchpad_bug(self): |
2244 | 87 | # References to bugs on sites other than launchpad are ignored. | 87 | # References to bugs on sites other than launchpad are ignored. |
2245 | 88 | bugs = self.extractBugInfo('http://bugs.debian.org/1234 fixed') | 88 | bugs = self.extractBugInfo('http://bugs.debian.org/1234 fixed') |
2247 | 89 | self.assertEquals(bugs, {}) | 89 | self.assertEqual(bugs, {}) |
2248 | 90 | 90 | ||
2249 | 91 | def test_duplicated_line(self): | 91 | def test_duplicated_line(self): |
2250 | 92 | # If a particular line is duplicated, silently ignore the duplicates. | 92 | # If a particular line is duplicated, silently ignore the duplicates. |
2251 | 93 | bugs = self.extractBugInfo( | 93 | bugs = self.extractBugInfo( |
2252 | 94 | 'https://launchpad.net/bugs/9999 fixed\n' | 94 | 'https://launchpad.net/bugs/9999 fixed\n' |
2253 | 95 | 'https://launchpad.net/bugs/9999 fixed') | 95 | 'https://launchpad.net/bugs/9999 fixed') |
2255 | 96 | self.assertEquals(bugs, {9999: 'fixed'}) | 96 | self.assertEqual(bugs, {9999: 'fixed'}) |
2256 | 97 | 97 | ||
2257 | 98 | def test_strict_url_checking(self): | 98 | def test_strict_url_checking(self): |
2258 | 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. |
2259 | 100 | bugs = self.extractBugInfo('https://launchpad.net/people/1234 fixed') | 100 | bugs = self.extractBugInfo('https://launchpad.net/people/1234 fixed') |
2261 | 101 | self.assertEquals(bugs, {}) | 101 | self.assertEqual(bugs, {}) |
2262 | 102 | bugs = self.extractBugInfo( | 102 | bugs = self.extractBugInfo( |
2263 | 103 | 'https://launchpad.net/bugs/foo/1234 fixed') | 103 | 'https://launchpad.net/bugs/foo/1234 fixed') |
2265 | 104 | self.assertEquals(bugs, {}) | 104 | self.assertEqual(bugs, {}) |
2266 | 105 | 105 | ||
2267 | 106 | 106 | ||
2268 | 107 | class TestBugLinking(BzrSyncTestCase): | 107 | class TestBugLinking(BzrSyncTestCase): |
2269 | 108 | 108 | ||
2270 | === modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py' | |||
2271 | --- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 10:54:31 +0000 | |||
2272 | +++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2018-01-02 16:24:23 +0000 | |||
2273 | @@ -359,7 +359,7 @@ | |||
2274 | 359 | self.commitRevision(committer=author) | 359 | self.commitRevision(committer=author) |
2275 | 360 | self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1) | 360 | self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1) |
2276 | 361 | db_author = RevisionAuthor.selectOneBy(name=author) | 361 | db_author = RevisionAuthor.selectOneBy(name=author) |
2278 | 362 | self.assertEquals(db_author.name, author) | 362 | self.assertEqual(db_author.name, author) |
2279 | 363 | 363 | ||
2280 | 364 | def test_new_parent(self): | 364 | def test_new_parent(self): |
2281 | 365 | # Importing two revisions should import a new parent. | 365 | # Importing two revisions should import a new parent. |
2282 | @@ -371,13 +371,13 @@ | |||
2283 | 371 | def test_sync_updates_branch(self): | 371 | def test_sync_updates_branch(self): |
2284 | 372 | # test that the last scanned revision ID is recorded | 372 | # test that the last scanned revision ID is recorded |
2285 | 373 | self.syncAndCount() | 373 | self.syncAndCount() |
2287 | 374 | self.assertEquals(NULL_REVISION, self.db_branch.last_scanned_id) | 374 | self.assertEqual(NULL_REVISION, self.db_branch.last_scanned_id) |
2288 | 375 | last_modified = self.db_branch.date_last_modified | 375 | last_modified = self.db_branch.date_last_modified |
2289 | 376 | last_scanned = self.db_branch.last_scanned | 376 | last_scanned = self.db_branch.last_scanned |
2290 | 377 | self.commitRevision() | 377 | self.commitRevision() |
2291 | 378 | self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1) | 378 | self.syncAndCount(new_revisions=1, new_numbers=1, new_authors=1) |
2294 | 379 | self.assertEquals(self.bzr_branch.last_revision(), | 379 | self.assertEqual(self.bzr_branch.last_revision(), |
2295 | 380 | self.db_branch.last_scanned_id) | 380 | self.db_branch.last_scanned_id) |
2296 | 381 | self.assertTrue(self.db_branch.last_scanned > last_scanned, | 381 | self.assertTrue(self.db_branch.last_scanned > last_scanned, |
2297 | 382 | "last_scanned was not updated") | 382 | "last_scanned was not updated") |
2298 | 383 | self.assertTrue(self.db_branch.date_last_modified > last_modified, | 383 | self.assertTrue(self.db_branch.date_last_modified > last_modified, |
2299 | @@ -814,7 +814,7 @@ | |||
2300 | 814 | self.makeBzrSync(self.db_branch).syncBranchAndClose() | 814 | self.makeBzrSync(self.db_branch).syncBranchAndClose() |
2301 | 815 | # Check that properties were saved to the revision. | 815 | # Check that properties were saved to the revision. |
2302 | 816 | bzr_revision = self.bzr_branch.repository.get_revision('rev1') | 816 | bzr_revision = self.bzr_branch.repository.get_revision('rev1') |
2304 | 817 | self.assertEquals(properties, bzr_revision.properties) | 817 | self.assertEqual(properties, bzr_revision.properties) |
2305 | 818 | # Check that properties are stored in the database. | 818 | # Check that properties are stored in the database. |
2306 | 819 | db_revision = getUtility(IRevisionSet).getByRevisionId('rev1') | 819 | db_revision = getUtility(IRevisionSet).getByRevisionId('rev1') |
2308 | 820 | self.assertEquals(properties, db_revision.getProperties()) | 820 | self.assertEqual(properties, db_revision.getProperties()) |
2309 | 821 | 821 | ||
2310 | === modified file 'lib/lp/codehosting/sshserver/tests/test_session.py' | |||
2311 | --- lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 10:54:31 +0000 | |||
2312 | +++ lib/lp/codehosting/sshserver/tests/test_session.py 2018-01-02 16:24:23 +0000 | |||
2313 | @@ -435,7 +435,7 @@ | |||
2314 | 435 | self.assertRaises(ForbiddenCommand, lookup_command_template, 'foo') | 435 | self.assertRaises(ForbiddenCommand, lookup_command_template, 'foo') |
2315 | 436 | 436 | ||
2316 | 437 | def test_bzr(self): | 437 | def test_bzr(self): |
2318 | 438 | self.assertEquals( | 438 | self.assertEqual( |
2319 | 439 | config.root + '/bin/py ' + get_bzr_path() + | 439 | config.root + '/bin/py ' + get_bzr_path() + |
2320 | 440 | ' lp-serve --inet %(user_id)s', | 440 | ' lp-serve --inet %(user_id)s', |
2321 | 441 | lookup_command_template( | 441 | lookup_command_template( |
2322 | 442 | 442 | ||
2323 | === modified file 'lib/lp/codehosting/tests/test_safe_open.py' | |||
2324 | --- lib/lp/codehosting/tests/test_safe_open.py 2012-09-06 00:01:38 +0000 | |||
2325 | +++ lib/lp/codehosting/tests/test_safe_open.py 2018-01-02 16:24:23 +0000 | |||
2326 | @@ -79,9 +79,8 @@ | |||
2327 | 79 | # When branch references are forbidden, checkAndFollowBranchReference | 79 | # When branch references are forbidden, checkAndFollowBranchReference |
2328 | 80 | # does not raise on non-references. | 80 | # does not raise on non-references. |
2329 | 81 | opener = self.makeBranchOpener(False, ['a', None]) | 81 | opener = self.makeBranchOpener(False, ['a', None]) |
2333 | 82 | self.assertEquals( | 82 | self.assertEqual('a', opener.checkAndFollowBranchReference('a')) |
2334 | 83 | 'a', opener.checkAndFollowBranchReference('a')) | 83 | self.assertEqual(['a'], opener.follow_reference_calls) |
2332 | 84 | self.assertEquals(['a'], opener.follow_reference_calls) | ||
2335 | 85 | 84 | ||
2336 | 86 | def testBranchReferenceForbidden(self): | 85 | def testBranchReferenceForbidden(self): |
2337 | 87 | # checkAndFollowBranchReference raises BranchReferenceForbidden if | 86 | # checkAndFollowBranchReference raises BranchReferenceForbidden if |
2338 | @@ -91,16 +90,15 @@ | |||
2339 | 91 | self.assertRaises( | 90 | self.assertRaises( |
2340 | 92 | BranchReferenceForbidden, | 91 | BranchReferenceForbidden, |
2341 | 93 | opener.checkAndFollowBranchReference, 'a') | 92 | opener.checkAndFollowBranchReference, 'a') |
2343 | 94 | self.assertEquals(['a'], opener.follow_reference_calls) | 93 | self.assertEqual(['a'], opener.follow_reference_calls) |
2344 | 95 | 94 | ||
2345 | 96 | def testAllowedReference(self): | 95 | def testAllowedReference(self): |
2346 | 97 | # checkAndFollowBranchReference does not raise if following references | 96 | # checkAndFollowBranchReference does not raise if following references |
2347 | 98 | # is allowed and the source URL points to a branch reference to a | 97 | # is allowed and the source URL points to a branch reference to a |
2348 | 99 | # permitted location. | 98 | # permitted location. |
2349 | 100 | opener = self.makeBranchOpener(True, ['a', 'b', None]) | 99 | opener = self.makeBranchOpener(True, ['a', 'b', None]) |
2353 | 101 | self.assertEquals( | 100 | self.assertEqual('b', opener.checkAndFollowBranchReference('a')) |
2354 | 102 | 'b', opener.checkAndFollowBranchReference('a')) | 101 | self.assertEqual(['a', 'b'], opener.follow_reference_calls) |
2352 | 103 | self.assertEquals(['a', 'b'], opener.follow_reference_calls) | ||
2355 | 104 | 102 | ||
2356 | 105 | def testCheckReferencedURLs(self): | 103 | def testCheckReferencedURLs(self): |
2357 | 106 | # checkAndFollowBranchReference checks if the URL a reference points | 104 | # checkAndFollowBranchReference checks if the URL a reference points |
2358 | @@ -109,7 +107,7 @@ | |||
2359 | 109 | True, ['a', 'b', None], unsafe_urls=set('b')) | 107 | True, ['a', 'b', None], unsafe_urls=set('b')) |
2360 | 110 | self.assertRaises( | 108 | self.assertRaises( |
2361 | 111 | BadUrl, opener.checkAndFollowBranchReference, 'a') | 109 | BadUrl, opener.checkAndFollowBranchReference, 'a') |
2363 | 112 | self.assertEquals(['a'], opener.follow_reference_calls) | 110 | self.assertEqual(['a'], opener.follow_reference_calls) |
2364 | 113 | 111 | ||
2365 | 114 | def testSelfReferencingBranch(self): | 112 | def testSelfReferencingBranch(self): |
2366 | 115 | # checkAndFollowBranchReference raises BranchReferenceLoopError if | 113 | # checkAndFollowBranchReference raises BranchReferenceLoopError if |
2367 | @@ -118,7 +116,7 @@ | |||
2368 | 118 | opener = self.makeBranchOpener(True, ['a', 'a']) | 116 | opener = self.makeBranchOpener(True, ['a', 'a']) |
2369 | 119 | self.assertRaises( | 117 | self.assertRaises( |
2370 | 120 | BranchLoopError, opener.checkAndFollowBranchReference, 'a') | 118 | BranchLoopError, opener.checkAndFollowBranchReference, 'a') |
2372 | 121 | self.assertEquals(['a'], opener.follow_reference_calls) | 119 | self.assertEqual(['a'], opener.follow_reference_calls) |
2373 | 122 | 120 | ||
2374 | 123 | def testBranchReferenceLoop(self): | 121 | def testBranchReferenceLoop(self): |
2375 | 124 | # checkAndFollowBranchReference raises BranchReferenceLoopError if | 122 | # checkAndFollowBranchReference raises BranchReferenceLoopError if |
2376 | @@ -128,7 +126,7 @@ | |||
2377 | 128 | opener = self.makeBranchOpener(True, references) | 126 | opener = self.makeBranchOpener(True, references) |
2378 | 129 | self.assertRaises( | 127 | self.assertRaises( |
2379 | 130 | BranchLoopError, opener.checkAndFollowBranchReference, 'a') | 128 | BranchLoopError, opener.checkAndFollowBranchReference, 'a') |
2381 | 131 | self.assertEquals(['a', 'b'], opener.follow_reference_calls) | 129 | self.assertEqual(['a', 'b'], opener.follow_reference_calls) |
2382 | 132 | 130 | ||
2383 | 133 | 131 | ||
2384 | 134 | class TrackingProber(BzrProber): | 132 | class TrackingProber(BzrProber): |
2385 | @@ -166,7 +164,7 @@ | |||
2386 | 166 | opener = self.makeBranchOpener([b.base], probers=[]) | 164 | opener = self.makeBranchOpener([b.base], probers=[]) |
2387 | 167 | self.assertRaises(NotBranchError, opener.open, b.base) | 165 | self.assertRaises(NotBranchError, opener.open, b.base) |
2388 | 168 | opener = self.makeBranchOpener([b.base], probers=[BzrProber]) | 166 | opener = self.makeBranchOpener([b.base], probers=[BzrProber]) |
2390 | 169 | self.assertEquals(b.base, opener.open(b.base).base) | 167 | self.assertEqual(b.base, opener.open(b.base).base) |
2391 | 170 | 168 | ||
2392 | 171 | def testDefaultProbers(self): | 169 | def testDefaultProbers(self): |
2393 | 172 | # If no probers are specified to the constructor | 170 | # If no probers are specified to the constructor |
2394 | @@ -180,18 +178,18 @@ | |||
2395 | 180 | TrackingProber.seen_urls = [] | 178 | TrackingProber.seen_urls = [] |
2396 | 181 | opener = self.makeBranchOpener(["."], probers=[TrackingProber]) | 179 | opener = self.makeBranchOpener(["."], probers=[TrackingProber]) |
2397 | 182 | self.assertRaises(NotBranchError, opener.open, ".") | 180 | self.assertRaises(NotBranchError, opener.open, ".") |
2399 | 183 | self.assertEquals(1, len(TrackingProber.seen_urls)) | 181 | self.assertEqual(1, len(TrackingProber.seen_urls)) |
2400 | 184 | TrackingProber.seen_urls = [] | 182 | TrackingProber.seen_urls = [] |
2401 | 185 | # And make sure it's registered in such a way that BzrDir.open would | 183 | # And make sure it's registered in such a way that BzrDir.open would |
2402 | 186 | # use it. | 184 | # use it. |
2403 | 187 | self.assertRaises(NotBranchError, BzrDir.open, ".") | 185 | self.assertRaises(NotBranchError, BzrDir.open, ".") |
2405 | 188 | self.assertEquals(1, len(TrackingProber.seen_urls)) | 186 | self.assertEqual(1, len(TrackingProber.seen_urls)) |
2406 | 189 | TrackingProber.seen_urls = [] | 187 | TrackingProber.seen_urls = [] |
2407 | 190 | # Make sure that SafeBranchOpener doesn't use it if no | 188 | # Make sure that SafeBranchOpener doesn't use it if no |
2408 | 191 | # probers were specified | 189 | # probers were specified |
2409 | 192 | opener = self.makeBranchOpener(["."]) | 190 | opener = self.makeBranchOpener(["."]) |
2410 | 193 | self.assertRaises(NotBranchError, opener.open, ".") | 191 | self.assertRaises(NotBranchError, opener.open, ".") |
2412 | 194 | self.assertEquals(0, len(TrackingProber.seen_urls)) | 192 | self.assertEqual(0, len(TrackingProber.seen_urls)) |
2413 | 195 | 193 | ||
2414 | 196 | def testAllowedURL(self): | 194 | def testAllowedURL(self): |
2415 | 197 | # checkSource does not raise an exception for branches stacked on | 195 | # checkSource does not raise an exception for branches stacked on |
2416 | @@ -289,8 +287,7 @@ | |||
2417 | 289 | opener = self.makeBranchOpener( | 287 | opener = self.makeBranchOpener( |
2418 | 290 | [a.base, b.base], probers=[TrackingProber]) | 288 | [a.base, b.base], probers=[TrackingProber]) |
2419 | 291 | opener.open(b.base) | 289 | opener.open(b.base) |
2422 | 292 | self.assertEquals( | 290 | self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base])) |
2421 | 293 | set(TrackingProber.seen_urls), set([b.base, a.base])) | ||
2423 | 294 | 291 | ||
2424 | 295 | def testCustomOpenerWithBranchReference(self): | 292 | def testCustomOpenerWithBranchReference(self): |
2425 | 296 | # A custom function for opening a control dir can be specified. | 293 | # A custom function for opening a control dir can be specified. |
2426 | @@ -301,8 +298,7 @@ | |||
2427 | 301 | opener = self.makeBranchOpener( | 298 | opener = self.makeBranchOpener( |
2428 | 302 | [a.base, b.base], probers=[TrackingProber]) | 299 | [a.base, b.base], probers=[TrackingProber]) |
2429 | 303 | opener.open(b.base) | 300 | opener.open(b.base) |
2432 | 304 | self.assertEquals( | 301 | self.assertEqual(set(TrackingProber.seen_urls), set([b.base, a.base])) |
2431 | 305 | set(TrackingProber.seen_urls), set([b.base, a.base])) | ||
2433 | 306 | 302 | ||
2434 | 307 | def test_ignore_fallbacks(self): | 303 | def test_ignore_fallbacks(self): |
2435 | 308 | """"Cross-format stacking doesn't error with ignore_fallbacks.""" | 304 | """"Cross-format stacking doesn't error with ignore_fallbacks.""" |
2436 | 309 | 305 | ||
2437 | === modified file 'lib/lp/registry/browser/tests/test_distroseries.py' | |||
2438 | --- lib/lp/registry/browser/tests/test_distroseries.py 2017-10-21 18:14:14 +0000 | |||
2439 | +++ lib/lp/registry/browser/tests/test_distroseries.py 2018-01-02 16:24:23 +0000 | |||
2440 | @@ -592,7 +592,7 @@ | |||
2441 | 592 | [launchpad] | 592 | [launchpad] |
2442 | 593 | default_batch_size: 2 | 593 | default_batch_size: 2 |
2443 | 594 | """) | 594 | """) |
2445 | 595 | self.assert_( | 595 | self.assertTrue( |
2446 | 596 | isinstance(view.milestone_batch_navigator, BatchNavigator), | 596 | isinstance(view.milestone_batch_navigator, BatchNavigator), |
2447 | 597 | 'milestone_batch_navigator is not a BatchNavigator object: %r' | 597 | 'milestone_batch_navigator is not a BatchNavigator object: %r' |
2448 | 598 | % view.milestone_batch_navigator) | 598 | % view.milestone_batch_navigator) |
2449 | @@ -693,7 +693,7 @@ | |||
2450 | 693 | distroseries = self.factory.makeDistroSeries() | 693 | distroseries = self.factory.makeDistroSeries() |
2451 | 694 | formatted_dict = seriesToVocab(distroseries) | 694 | formatted_dict = seriesToVocab(distroseries) |
2452 | 695 | 695 | ||
2454 | 696 | self.assertEquals( | 696 | self.assertEqual( |
2455 | 697 | ['api_uri', 'title', 'value'], | 697 | ['api_uri', 'title', 'value'], |
2456 | 698 | sorted(formatted_dict.keys())) | 698 | sorted(formatted_dict.keys())) |
2457 | 699 | 699 | ||
2458 | @@ -1477,9 +1477,9 @@ | |||
2459 | 1477 | job_source = getUtility(IPlainPackageCopyJobSource) | 1477 | job_source = getUtility(IPlainPackageCopyJobSource) |
2460 | 1478 | jobs = list( | 1478 | jobs = list( |
2461 | 1479 | job_source.getActiveJobs(series.distribution.main_archive)) | 1479 | job_source.getActiveJobs(series.distribution.main_archive)) |
2463 | 1480 | self.assertEquals(1, len(jobs)) | 1480 | self.assertEqual(1, len(jobs)) |
2464 | 1481 | job = jobs[0] | 1481 | job = jobs[0] |
2466 | 1482 | self.assertEquals(series, job.target_distroseries) | 1482 | self.assertEqual(series, job.target_distroseries) |
2467 | 1483 | self.assertEqual(dsd.source_package_name.name, job.package_name) | 1483 | self.assertEqual(dsd.source_package_name.name, job.package_name) |
2468 | 1484 | self.assertEqual(dsd.parent_source_version, job.package_version) | 1484 | self.assertEqual(dsd.parent_source_version, job.package_version) |
2469 | 1485 | self.assertEqual(PackagePublishingPocket.RELEASE, job.target_pocket) | 1485 | self.assertEqual(PackagePublishingPocket.RELEASE, job.target_pocket) |
2470 | @@ -2161,7 +2161,7 @@ | |||
2471 | 2161 | derived_series, '+localpackagediffs', method='GET', | 2161 | derived_series, '+localpackagediffs', method='GET', |
2472 | 2162 | query_string='start=1&batch=1') | 2162 | query_string='start=1&batch=1') |
2473 | 2163 | 2163 | ||
2475 | 2164 | self.assertEquals( | 2164 | self.assertEqual( |
2476 | 2165 | 'http://127.0.0.1?start=1&batch=1', | 2165 | 'http://127.0.0.1?start=1&batch=1', |
2477 | 2166 | view.action_url) | 2166 | view.action_url) |
2478 | 2167 | 2167 | ||
2479 | 2168 | 2168 | ||
2480 | === modified file 'lib/lp/registry/browser/tests/test_person.py' | |||
2481 | --- lib/lp/registry/browser/tests/test_person.py 2018-01-02 10:54:31 +0000 | |||
2482 | +++ lib/lp/registry/browser/tests/test_person.py 2018-01-02 16:24:23 +0000 | |||
2483 | @@ -189,7 +189,7 @@ | |||
2484 | 189 | 189 | ||
2485 | 190 | def test_should_be_profile_page_when_delegating(self): | 190 | def test_should_be_profile_page_when_delegating(self): |
2486 | 191 | """The profile page is the OpenID identifier in normal situation.""" | 191 | """The profile page is the OpenID identifier in normal situation.""" |
2488 | 192 | self.assertEquals( | 192 | self.assertEqual( |
2489 | 193 | 'http://launchpad.dev/~eris', self.view.openid_identity_url) | 193 | 'http://launchpad.dev/~eris', self.view.openid_identity_url) |
2490 | 194 | 194 | ||
2491 | 195 | def test_should_be_production_profile_page_when_not_delegating(self): | 195 | def test_should_be_production_profile_page_when_not_delegating(self): |
2492 | @@ -202,7 +202,7 @@ | |||
2493 | 202 | [launchpad] | 202 | [launchpad] |
2494 | 203 | non_restricted_hostname: prod.launchpad.dev | 203 | non_restricted_hostname: prod.launchpad.dev |
2495 | 204 | ''')) | 204 | ''')) |
2497 | 205 | self.assertEquals( | 205 | self.assertEqual( |
2498 | 206 | 'http://prod.launchpad.dev/~eris', self.view.openid_identity_url) | 206 | 'http://prod.launchpad.dev/~eris', self.view.openid_identity_url) |
2499 | 207 | 207 | ||
2500 | 208 | 208 | ||
2501 | 209 | 209 | ||
2502 | === modified file 'lib/lp/registry/browser/tests/test_person_webservice.py' | |||
2503 | --- lib/lp/registry/browser/tests/test_person_webservice.py 2017-06-01 12:58:53 +0000 | |||
2504 | +++ lib/lp/registry/browser/tests/test_person_webservice.py 2018-01-02 16:24:23 +0000 | |||
2505 | @@ -151,7 +151,7 @@ | |||
2506 | 151 | self.assertEqual(response.status, 200) | 151 | self.assertEqual(response.status, 200) |
2507 | 152 | 152 | ||
2508 | 153 | rendered_comment = response.body | 153 | rendered_comment = response.body |
2510 | 154 | self.assertEquals( | 154 | self.assertEqual( |
2511 | 155 | rendered_comment, | 155 | rendered_comment, |
2512 | 156 | '<a href="/~test-person" class="sprite person">Test Person</a>') | 156 | '<a href="/~test-person" class="sprite person">Test Person</a>') |
2513 | 157 | 157 | ||
2514 | 158 | 158 | ||
2515 | === modified file 'lib/lp/registry/tests/test_distribution.py' | |||
2516 | --- lib/lp/registry/tests/test_distribution.py 2018-01-02 10:54:31 +0000 | |||
2517 | +++ lib/lp/registry/tests/test_distribution.py 2018-01-02 16:24:23 +0000 | |||
2518 | @@ -151,7 +151,7 @@ | |||
2519 | 151 | distroseries = self.factory.makeDistroSeries() | 151 | distroseries = self.factory.makeDistroSeries() |
2520 | 152 | spph = self.factory.makeSourcePackagePublishingHistory( | 152 | spph = self.factory.makeSourcePackagePublishingHistory( |
2521 | 153 | distroseries=distroseries, sourcepackagename='my-package') | 153 | distroseries=distroseries, sourcepackagename='my-package') |
2523 | 154 | self.assertEquals( | 154 | self.assertEqual( |
2524 | 155 | spph.sourcepackagerelease.sourcepackagename, | 155 | spph.sourcepackagerelease.sourcepackagename, |
2525 | 156 | distroseries.distribution.guessPublishedSourcePackageName( | 156 | distroseries.distribution.guessPublishedSourcePackageName( |
2526 | 157 | 'my-package')) | 157 | 'my-package')) |
2527 | @@ -164,7 +164,7 @@ | |||
2528 | 164 | archive=distroseries.main_archive, | 164 | archive=distroseries.main_archive, |
2529 | 165 | binarypackagename='binary-package', | 165 | binarypackagename='binary-package', |
2530 | 166 | source_package_release=spph.sourcepackagerelease) | 166 | source_package_release=spph.sourcepackagerelease) |
2532 | 167 | self.assertEquals( | 167 | self.assertEqual( |
2533 | 168 | spph.sourcepackagerelease.sourcepackagename, | 168 | spph.sourcepackagerelease.sourcepackagename, |
2534 | 169 | distroseries.distribution.guessPublishedSourcePackageName( | 169 | distroseries.distribution.guessPublishedSourcePackageName( |
2535 | 170 | 'binary-package')) | 170 | 'binary-package')) |
2536 | @@ -188,7 +188,7 @@ | |||
2537 | 188 | distroseries2 = self.factory.makeDistroSeries() | 188 | distroseries2 = self.factory.makeDistroSeries() |
2538 | 189 | spph = self.factory.makeSourcePackagePublishingHistory( | 189 | spph = self.factory.makeSourcePackagePublishingHistory( |
2539 | 190 | distroseries=distroseries1, sourcepackagename='my-package') | 190 | distroseries=distroseries1, sourcepackagename='my-package') |
2541 | 191 | self.assertEquals( | 191 | self.assertEqual( |
2542 | 192 | spph.sourcepackagerelease.sourcepackagename, | 192 | spph.sourcepackagerelease.sourcepackagename, |
2543 | 193 | distroseries1.distribution.guessPublishedSourcePackageName( | 193 | distroseries1.distribution.guessPublishedSourcePackageName( |
2544 | 194 | 'my-package')) | 194 | 'my-package')) |
2545 | @@ -206,7 +206,7 @@ | |||
2546 | 206 | self.factory.makeBinaryPackagePublishingHistory( | 206 | self.factory.makeBinaryPackagePublishingHistory( |
2547 | 207 | archive=distroseries.main_archive, | 207 | archive=distroseries.main_archive, |
2548 | 208 | binarypackagename='my-package', sourcepackagename='other-package') | 208 | binarypackagename='my-package', sourcepackagename='other-package') |
2550 | 209 | self.assertEquals( | 209 | self.assertEqual( |
2551 | 210 | my_spph.sourcepackagerelease.sourcepackagename, | 210 | my_spph.sourcepackagerelease.sourcepackagename, |
2552 | 211 | distroseries.distribution.guessPublishedSourcePackageName( | 211 | distroseries.distribution.guessPublishedSourcePackageName( |
2553 | 212 | 'my-package')) | 212 | 'my-package')) |
2554 | @@ -223,7 +223,7 @@ | |||
2555 | 223 | archive=distroseries.main_archive, | 223 | archive=distroseries.main_archive, |
2556 | 224 | sourcepackagename='new-source-name', | 224 | sourcepackagename='new-source-name', |
2557 | 225 | binarypackagename='my-package') | 225 | binarypackagename='my-package') |
2559 | 226 | self.assertEquals( | 226 | self.assertEqual( |
2560 | 227 | 'new-source-name', | 227 | 'new-source-name', |
2561 | 228 | distroseries.distribution.guessPublishedSourcePackageName( | 228 | distroseries.distribution.guessPublishedSourcePackageName( |
2562 | 229 | 'my-package').name) | 229 | 'my-package').name) |
2563 | @@ -235,7 +235,7 @@ | |||
2564 | 235 | sourcepackagename='my-package') | 235 | sourcepackagename='my-package') |
2565 | 236 | self.factory.makeRelatedBranchesForSourcePackage( | 236 | self.factory.makeRelatedBranchesForSourcePackage( |
2566 | 237 | sourcepackage=sourcepackage) | 237 | sourcepackage=sourcepackage) |
2568 | 238 | self.assertEquals( | 238 | self.assertEqual( |
2569 | 239 | 'my-package', | 239 | 'my-package', |
2570 | 240 | sourcepackage.distribution.guessPublishedSourcePackageName( | 240 | sourcepackage.distribution.guessPublishedSourcePackageName( |
2571 | 241 | 'my-package').name) | 241 | 'my-package').name) |
2572 | @@ -371,14 +371,14 @@ | |||
2573 | 371 | 371 | ||
2574 | 372 | def test_get_none(self): | 372 | def test_get_none(self): |
2575 | 373 | distro = self.factory.makeDistribution() | 373 | distro = self.factory.makeDistribution() |
2577 | 374 | self.assertEquals([], | 374 | self.assertEqual([], |
2578 | 375 | list(distro.getSeriesByStatus(SeriesStatus.FROZEN))) | 375 | list(distro.getSeriesByStatus(SeriesStatus.FROZEN))) |
2579 | 376 | 376 | ||
2580 | 377 | def test_get_current(self): | 377 | def test_get_current(self): |
2581 | 378 | distro = self.factory.makeDistribution() | 378 | distro = self.factory.makeDistribution() |
2582 | 379 | series = self.factory.makeDistroSeries(distribution=distro, | 379 | series = self.factory.makeDistroSeries(distribution=distro, |
2583 | 380 | status=SeriesStatus.CURRENT) | 380 | status=SeriesStatus.CURRENT) |
2585 | 381 | self.assertEquals([series], | 381 | self.assertEqual([series], |
2586 | 382 | list(distro.getSeriesByStatus(SeriesStatus.CURRENT))) | 382 | list(distro.getSeriesByStatus(SeriesStatus.CURRENT))) |
2587 | 383 | 383 | ||
2588 | 384 | 384 | ||
2589 | @@ -396,13 +396,13 @@ | |||
2590 | 396 | distro = self.factory.makeDistribution() | 396 | distro = self.factory.makeDistribution() |
2591 | 397 | series = self.factory.makeDistroSeries(distribution=distro, | 397 | series = self.factory.makeDistroSeries(distribution=distro, |
2592 | 398 | name="dappere") | 398 | name="dappere") |
2594 | 399 | self.assertEquals(series, distro.getSeries("dappere")) | 399 | self.assertEqual(series, distro.getSeries("dappere")) |
2595 | 400 | 400 | ||
2596 | 401 | def test_get_by_version(self): | 401 | def test_get_by_version(self): |
2597 | 402 | distro = self.factory.makeDistribution() | 402 | distro = self.factory.makeDistribution() |
2598 | 403 | series = self.factory.makeDistroSeries(distribution=distro, | 403 | series = self.factory.makeDistroSeries(distribution=distro, |
2599 | 404 | name="dappere", version="42.6") | 404 | name="dappere", version="42.6") |
2601 | 405 | self.assertEquals(series, distro.getSeries("42.6")) | 405 | self.assertEqual(series, distro.getSeries("42.6")) |
2602 | 406 | 406 | ||
2603 | 407 | def test_development_series_alias(self): | 407 | def test_development_series_alias(self): |
2604 | 408 | distro = self.factory.makeDistribution() | 408 | distro = self.factory.makeDistribution() |
2605 | 409 | 409 | ||
2606 | === modified file 'lib/lp/registry/tests/test_distributionmirror_prober.py' | |||
2607 | --- lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 10:54:31 +0000 | |||
2608 | +++ lib/lp/registry/tests/test_distributionmirror_prober.py 2018-01-02 16:24:23 +0000 | |||
2609 | @@ -261,7 +261,7 @@ | |||
2610 | 261 | 261 | ||
2611 | 262 | protocol.factory = FakeFactory('http://foo.bar/') | 262 | protocol.factory = FakeFactory('http://foo.bar/') |
2612 | 263 | protocol.makeConnection(FakeTransport()) | 263 | protocol.makeConnection(FakeTransport()) |
2614 | 264 | self.assertEquals( | 264 | self.assertEqual( |
2615 | 265 | 'Launchpad Mirror Prober ( https://launchpad.net/ )', | 265 | 'Launchpad Mirror Prober ( https://launchpad.net/ )', |
2616 | 266 | headers['User-Agent']) | 266 | headers['User-Agent']) |
2617 | 267 | 267 | ||
2618 | @@ -475,10 +475,10 @@ | |||
2619 | 475 | there's no task currently running. | 475 | there's no task currently running. |
2620 | 476 | """ | 476 | """ |
2621 | 477 | self.multi_lock.run(self.callback) | 477 | self.multi_lock.run(self.callback) |
2623 | 478 | self.assertEquals(self.count, 1, "self.callback should have run.") | 478 | self.assertEqual(self.count, 1, "self.callback should have run.") |
2624 | 479 | 479 | ||
2625 | 480 | self.multi_lock.run(self.callback) | 480 | self.multi_lock.run(self.callback) |
2627 | 481 | self.assertEquals( | 481 | self.assertEqual( |
2628 | 482 | self.count, 2, "self.callback should have run twice.") | 482 | self.count, 2, "self.callback should have run twice.") |
2629 | 483 | 483 | ||
2630 | 484 | def test_run_waits_for_first_lock(self): | 484 | def test_run_waits_for_first_lock(self): |
2631 | @@ -489,7 +489,7 @@ | |||
2632 | 489 | 489 | ||
2633 | 490 | # Run self.callback when self.multi_lock is acquired. | 490 | # Run self.callback when self.multi_lock is acquired. |
2634 | 491 | self.multi_lock.run(self.callback) | 491 | self.multi_lock.run(self.callback) |
2636 | 492 | self.assertEquals( | 492 | self.assertEqual( |
2637 | 493 | self.count, 0, "self.callback should not have run yet.") | 493 | self.count, 0, "self.callback should not have run yet.") |
2638 | 494 | 494 | ||
2639 | 495 | # Release lock_one. | 495 | # Release lock_one. |
2640 | @@ -497,7 +497,7 @@ | |||
2641 | 497 | 497 | ||
2642 | 498 | # multi_lock will now have been able to acquire both semaphores, and | 498 | # multi_lock will now have been able to acquire both semaphores, and |
2643 | 499 | # so it will have run its task. | 499 | # so it will have run its task. |
2645 | 500 | self.assertEquals(self.count, 1, "self.callback should have run.") | 500 | self.assertEqual(self.count, 1, "self.callback should have run.") |
2646 | 501 | 501 | ||
2647 | 502 | def test_run_waits_for_second_lock(self): | 502 | def test_run_waits_for_second_lock(self): |
2648 | 503 | """MultiLock.run acquires the second lock before running functions.""" | 503 | """MultiLock.run acquires the second lock before running functions.""" |
2649 | @@ -507,7 +507,7 @@ | |||
2650 | 507 | 507 | ||
2651 | 508 | # Run self.callback when self.multi_lock is acquired. | 508 | # Run self.callback when self.multi_lock is acquired. |
2652 | 509 | self.multi_lock.run(self.callback) | 509 | self.multi_lock.run(self.callback) |
2654 | 510 | self.assertEquals( | 510 | self.assertEqual( |
2655 | 511 | self.count, 0, "self.callback should not have run yet.") | 511 | self.count, 0, "self.callback should not have run yet.") |
2656 | 512 | 512 | ||
2657 | 513 | # Release lock_two. | 513 | # Release lock_two. |
2658 | @@ -515,7 +515,7 @@ | |||
2659 | 515 | 515 | ||
2660 | 516 | # multi_lock will now have been able to acquire both semaphores, and | 516 | # multi_lock will now have been able to acquire both semaphores, and |
2661 | 517 | # so it will have run its task. | 517 | # so it will have run its task. |
2663 | 518 | self.assertEquals(self.count, 1, "self.callback should have run.") | 518 | self.assertEqual(self.count, 1, "self.callback should have run.") |
2664 | 519 | 519 | ||
2665 | 520 | def test_run_waits_for_current_task(self): | 520 | def test_run_waits_for_current_task(self): |
2666 | 521 | """MultiLock.run waits the end of the current task before running the | 521 | """MultiLock.run waits the end of the current task before running the |
2667 | @@ -527,7 +527,7 @@ | |||
2668 | 527 | 527 | ||
2669 | 528 | # Run self.callback when self.multi_lock is acquired. | 528 | # Run self.callback when self.multi_lock is acquired. |
2670 | 529 | self.multi_lock.run(self.callback) | 529 | self.multi_lock.run(self.callback) |
2672 | 530 | self.assertEquals( | 530 | self.assertEqual( |
2673 | 531 | self.count, 0, "self.callback should not have run yet.") | 531 | self.count, 0, "self.callback should not have run yet.") |
2674 | 532 | 532 | ||
2675 | 533 | # Release lock_one. | 533 | # Release lock_one. |
2676 | @@ -535,7 +535,7 @@ | |||
2677 | 535 | 535 | ||
2678 | 536 | # multi_lock will now have been able to acquire both semaphores, and | 536 | # multi_lock will now have been able to acquire both semaphores, and |
2679 | 537 | # so it will have run its task. | 537 | # so it will have run its task. |
2681 | 538 | self.assertEquals(self.count, 1, "self.callback should have run.") | 538 | self.assertEqual(self.count, 1, "self.callback should have run.") |
2682 | 539 | 539 | ||
2683 | 540 | 540 | ||
2684 | 541 | class TestRedirectAwareProberFactoryAndProtocol(TestCase): | 541 | class TestRedirectAwareProberFactoryAndProtocol(TestCase): |
2685 | @@ -879,28 +879,28 @@ | |||
2686 | 879 | # Since we have a single mirror to probe we need to have a single | 879 | # Since we have a single mirror to probe we need to have a single |
2687 | 880 | # DeferredSemaphore with a limit of PER_HOST_REQUESTS, to ensure we | 880 | # DeferredSemaphore with a limit of PER_HOST_REQUESTS, to ensure we |
2688 | 881 | # don't issue too many simultaneous connections on that host. | 881 | # don't issue too many simultaneous connections on that host. |
2690 | 882 | self.assertEquals(len(request_manager.host_locks), 1) | 882 | self.assertEqual(len(request_manager.host_locks), 1) |
2691 | 883 | multi_lock = request_manager.host_locks[mirror1_host] | 883 | multi_lock = request_manager.host_locks[mirror1_host] |
2693 | 884 | self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS) | 884 | self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS) |
2694 | 885 | # Note that our multi_lock contains another semaphore to control the | 885 | # Note that our multi_lock contains another semaphore to control the |
2695 | 886 | # overall number of requests. | 886 | # overall number of requests. |
2697 | 887 | self.assertEquals(multi_lock.overall_lock.limit, OVERALL_REQUESTS) | 887 | self.assertEqual(multi_lock.overall_lock.limit, OVERALL_REQUESTS) |
2698 | 888 | 888 | ||
2699 | 889 | probe_function(mirror2, StringIO(), [], logging) | 889 | probe_function(mirror2, StringIO(), [], logging) |
2700 | 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, |
2701 | 891 | # so we'll still have a single semaphore in host_semaphores. | 891 | # so we'll still have a single semaphore in host_semaphores. |
2704 | 892 | self.assertEquals(mirror2_host, mirror1_host) | 892 | self.assertEqual(mirror2_host, mirror1_host) |
2705 | 893 | self.assertEquals(len(request_manager.host_locks), 1) | 893 | self.assertEqual(len(request_manager.host_locks), 1) |
2706 | 894 | multi_lock = request_manager.host_locks[mirror2_host] | 894 | multi_lock = request_manager.host_locks[mirror2_host] |
2708 | 895 | self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS) | 895 | self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS) |
2709 | 896 | 896 | ||
2710 | 897 | probe_function(mirror3, StringIO(), [], logging) | 897 | probe_function(mirror3, StringIO(), [], logging) |
2711 | 898 | # This third mirror is on a separate host, so we'll have a second | 898 | # This third mirror is on a separate host, so we'll have a second |
2712 | 899 | # semaphore added to host_semaphores. | 899 | # semaphore added to host_semaphores. |
2715 | 900 | self.failUnless(mirror3_host != mirror1_host) | 900 | self.assertTrue(mirror3_host != mirror1_host) |
2716 | 901 | self.assertEquals(len(request_manager.host_locks), 2) | 901 | self.assertEqual(len(request_manager.host_locks), 2) |
2717 | 902 | multi_lock = request_manager.host_locks[mirror3_host] | 902 | multi_lock = request_manager.host_locks[mirror3_host] |
2719 | 903 | self.assertEquals(multi_lock.host_lock.limit, PER_HOST_REQUESTS) | 903 | self.assertEqual(multi_lock.host_lock.limit, PER_HOST_REQUESTS) |
2720 | 904 | 904 | ||
2721 | 905 | # When using an http_proxy, even though we'll actually connect to the | 905 | # When using an http_proxy, even though we'll actually connect to the |
2722 | 906 | # proxy, we'll use the mirror's host as the key to find the semaphore | 906 | # proxy, we'll use the mirror's host as the key to find the semaphore |
2723 | @@ -908,7 +908,7 @@ | |||
2724 | 908 | orig_proxy = os.getenv('http_proxy') | 908 | orig_proxy = os.getenv('http_proxy') |
2725 | 909 | os.environ['http_proxy'] = 'http://squid.internal:3128/' | 909 | os.environ['http_proxy'] = 'http://squid.internal:3128/' |
2726 | 910 | probe_function(mirror3, StringIO(), [], logging) | 910 | probe_function(mirror3, StringIO(), [], logging) |
2728 | 911 | self.assertEquals(len(request_manager.host_locks), 2) | 911 | self.assertEqual(len(request_manager.host_locks), 2) |
2729 | 912 | restore_http_proxy(orig_proxy) | 912 | restore_http_proxy(orig_proxy) |
2730 | 913 | 913 | ||
2731 | 914 | 914 | ||
2732 | 915 | 915 | ||
2733 | === modified file 'lib/lp/registry/tests/test_distroseries.py' | |||
2734 | --- lib/lp/registry/tests/test_distroseries.py 2018-01-02 10:54:31 +0000 | |||
2735 | +++ lib/lp/registry/tests/test_distroseries.py 2018-01-02 16:24:23 +0000 | |||
2736 | @@ -222,7 +222,7 @@ | |||
2737 | 222 | distroarchseries = self.factory.makeDistroArchSeries( | 222 | distroarchseries = self.factory.makeDistroArchSeries( |
2738 | 223 | distroseries=distroseries, architecturetag='i386', | 223 | distroseries=distroseries, architecturetag='i386', |
2739 | 224 | processor=processor) | 224 | processor=processor) |
2741 | 225 | self.assertEquals( | 225 | self.assertEqual( |
2742 | 226 | distroarchseries, | 226 | distroarchseries, |
2743 | 227 | distroseries.getDistroArchSeriesByProcessor(processor)) | 227 | distroseries.getDistroArchSeriesByProcessor(processor)) |
2744 | 228 | 228 | ||
2745 | @@ -236,7 +236,7 @@ | |||
2746 | 236 | 236 | ||
2747 | 237 | def test_getDerivedSeries(self): | 237 | def test_getDerivedSeries(self): |
2748 | 238 | dsp = self.factory.makeDistroSeriesParent() | 238 | dsp = self.factory.makeDistroSeriesParent() |
2750 | 239 | self.assertEquals( | 239 | self.assertEqual( |
2751 | 240 | [dsp.derived_series], dsp.parent_series.getDerivedSeries()) | 240 | [dsp.derived_series], dsp.parent_series.getDerivedSeries()) |
2752 | 241 | 241 | ||
2753 | 242 | def test_registrant_owner_differ(self): | 242 | def test_registrant_owner_differ(self): |
2754 | @@ -244,8 +244,8 @@ | |||
2755 | 244 | # distribution's owner. | 244 | # distribution's owner. |
2756 | 245 | registrant = self.factory.makePerson() | 245 | registrant = self.factory.makePerson() |
2757 | 246 | distroseries = self.factory.makeDistroSeries(registrant=registrant) | 246 | distroseries = self.factory.makeDistroSeries(registrant=registrant) |
2760 | 247 | self.assertEquals(distroseries.distribution.owner, distroseries.owner) | 247 | self.assertEqual(distroseries.distribution.owner, distroseries.owner) |
2761 | 248 | self.assertEquals(registrant, distroseries.registrant) | 248 | self.assertEqual(registrant, distroseries.registrant) |
2762 | 249 | self.assertNotEqual(distroseries.registrant, distroseries.owner) | 249 | self.assertNotEqual(distroseries.registrant, distroseries.owner) |
2763 | 250 | 250 | ||
2764 | 251 | def test_isDerivedSeries(self): | 251 | def test_isDerivedSeries(self): |
2765 | 252 | 252 | ||
2766 | === modified file 'lib/lp/registry/tests/test_distroseriesdifference.py' | |||
2767 | --- lib/lp/registry/tests/test_distroseriesdifference.py 2014-11-09 11:48:34 +0000 | |||
2768 | +++ lib/lp/registry/tests/test_distroseriesdifference.py 2018-01-02 16:24:23 +0000 | |||
2769 | @@ -436,7 +436,7 @@ | |||
2770 | 436 | packagesets = self._setupPackageSets( | 436 | packagesets = self._setupPackageSets( |
2771 | 437 | ds_diff, ds_diff.parent_series, 5) | 437 | ds_diff, ds_diff.parent_series, 5) |
2772 | 438 | parent_packagesets = ds_diff.parent_packagesets | 438 | parent_packagesets = ds_diff.parent_packagesets |
2774 | 439 | self.assertEquals( | 439 | self.assertEqual( |
2775 | 440 | sorted([packageset.name for packageset in packagesets]), | 440 | sorted([packageset.name for packageset in packagesets]), |
2776 | 441 | [packageset.name for packageset in parent_packagesets]) | 441 | [packageset.name for packageset in parent_packagesets]) |
2777 | 442 | 442 | ||
2778 | @@ -445,7 +445,7 @@ | |||
2779 | 445 | ds_diff = self.factory.makeDistroSeriesDifference() | 445 | ds_diff = self.factory.makeDistroSeriesDifference() |
2780 | 446 | packagesets = self._setupPackageSets( | 446 | packagesets = self._setupPackageSets( |
2781 | 447 | ds_diff, ds_diff.derived_series, 5) | 447 | ds_diff, ds_diff.derived_series, 5) |
2783 | 448 | self.assertEquals( | 448 | self.assertEqual( |
2784 | 449 | sorted([packageset.name for packageset in packagesets]), | 449 | sorted([packageset.name for packageset in packagesets]), |
2785 | 450 | [packageset.name for packageset in ds_diff.packagesets]) | 450 | [packageset.name for packageset in ds_diff.packagesets]) |
2786 | 451 | 451 | ||
2787 | 452 | 452 | ||
2788 | === modified file 'lib/lp/registry/tests/test_distroseriesparent.py' | |||
2789 | --- lib/lp/registry/tests/test_distroseriesparent.py 2014-07-30 23:48:56 +0000 | |||
2790 | +++ lib/lp/registry/tests/test_distroseriesparent.py 2018-01-02 16:24:23 +0000 | |||
2791 | @@ -135,7 +135,7 @@ | |||
2792 | 135 | 135 | ||
2793 | 136 | def assertCanEdit(self, dsp): | 136 | def assertCanEdit(self, dsp): |
2794 | 137 | dsp.initialized = False | 137 | dsp.initialized = False |
2796 | 138 | self.assertEquals(False, dsp.initialized) | 138 | self.assertEqual(False, dsp.initialized) |
2797 | 139 | 139 | ||
2798 | 140 | def test_distroseries_drivers_can_edit(self): | 140 | def test_distroseries_drivers_can_edit(self): |
2799 | 141 | # Test that distroseries drivers can edit the data. | 141 | # Test that distroseries drivers can edit the data. |
2800 | 142 | 142 | ||
2801 | === modified file 'lib/lp/registry/tests/test_initderiveddistroseries.py' | |||
2802 | --- lib/lp/registry/tests/test_initderiveddistroseries.py 2013-02-14 01:10:48 +0000 | |||
2803 | +++ lib/lp/registry/tests/test_initderiveddistroseries.py 2018-01-02 16:24:23 +0000 | |||
2804 | @@ -90,7 +90,7 @@ | |||
2805 | 90 | p.getBuiltBinaries()[0].binarypackagerelease.version) | 90 | p.getBuiltBinaries()[0].binarypackagerelease.version) |
2806 | 91 | for p in pub_sources]) | 91 | for p in pub_sources]) |
2807 | 92 | 92 | ||
2809 | 93 | self.assertEquals(pack_versions, binaries) | 93 | self.assertEqual(pack_versions, binaries) |
2810 | 94 | 94 | ||
2811 | 95 | def test_multiple_parents_binary_packages(self): | 95 | def test_multiple_parents_binary_packages(self): |
2812 | 96 | # An initialization from many parents (using the package copier) | 96 | # An initialization from many parents (using the package copier) |
2813 | 97 | 97 | ||
2814 | === modified file 'lib/lp/registry/tests/test_milestonetag.py' | |||
2815 | --- lib/lp/registry/tests/test_milestonetag.py 2015-01-29 14:14:01 +0000 | |||
2816 | +++ lib/lp/registry/tests/test_milestonetag.py 2018-01-02 16:24:23 +0000 | |||
2817 | @@ -38,7 +38,7 @@ | |||
2818 | 38 | 38 | ||
2819 | 39 | def test_no_tags(self): | 39 | def test_no_tags(self): |
2820 | 40 | # Ensure a newly created milestone does not have associated tags. | 40 | # Ensure a newly created milestone does not have associated tags. |
2822 | 41 | self.assertEquals([], self.milestone.getTags()) | 41 | self.assertEqual([], self.milestone.getTags()) |
2823 | 42 | 42 | ||
2824 | 43 | def test_tags_setting_and_retrieval(self): | 43 | def test_tags_setting_and_retrieval(self): |
2825 | 44 | # Ensure tags are correctly saved and retrieved from the db. | 44 | # Ensure tags are correctly saved and retrieved from the db. |
2826 | @@ -59,7 +59,7 @@ | |||
2827 | 59 | with person_logged_in(self.person): | 59 | with person_logged_in(self.person): |
2828 | 60 | self.milestone.setTags(self.tags, self.person) | 60 | self.milestone.setTags(self.tags, self.person) |
2829 | 61 | self.milestone.setTags([], self.person) | 61 | self.milestone.setTags([], self.person) |
2831 | 62 | self.assertEquals([], self.milestone.getTags()) | 62 | self.assertEqual([], self.milestone.getTags()) |
2832 | 63 | 63 | ||
2833 | 64 | def test_user_metadata(self): | 64 | def test_user_metadata(self): |
2834 | 65 | # Ensure the correct user metadata is created when tags are added. | 65 | # Ensure the correct user metadata is created when tags are added. |
2835 | 66 | 66 | ||
2836 | === modified file 'lib/lp/registry/tests/test_person.py' | |||
2837 | --- lib/lp/registry/tests/test_person.py 2018-01-02 10:54:31 +0000 | |||
2838 | +++ lib/lp/registry/tests/test_person.py 2018-01-02 16:24:23 +0000 | |||
2839 | @@ -807,7 +807,7 @@ | |||
2840 | 807 | login(user.preferredemail.email) | 807 | login(user.preferredemail.email) |
2841 | 808 | expected_error = ('This account cannot be deactivated because it owns ' | 808 | expected_error = ('This account cannot be deactivated because it owns ' |
2842 | 809 | 'the following non-public products: private') | 809 | 'the following non-public products: private') |
2844 | 810 | self.assertEquals([expected_error], user.canDeactivate()) | 810 | self.assertEqual([expected_error], user.canDeactivate()) |
2845 | 811 | 811 | ||
2846 | 812 | def test_deactivate_copes_with_names_already_in_use(self): | 812 | def test_deactivate_copes_with_names_already_in_use(self): |
2847 | 813 | """When a user deactivates their account, their name is changed. | 813 | """When a user deactivates their account, their name is changed. |
2848 | 814 | 814 | ||
2849 | === modified file 'lib/lp/registry/tests/test_person_vocabularies.py' | |||
2850 | --- lib/lp/registry/tests/test_person_vocabularies.py 2012-08-13 21:33:47 +0000 | |||
2851 | +++ lib/lp/registry/tests/test_person_vocabularies.py 2018-01-02 16:24:23 +0000 | |||
2852 | @@ -108,7 +108,7 @@ | |||
2853 | 108 | """ | 108 | """ |
2854 | 109 | if expected is not None: | 109 | if expected is not None: |
2855 | 110 | expected = expected % context.id | 110 | expected = expected % context.id |
2857 | 111 | self.assertEquals( | 111 | self.assertEqual( |
2858 | 112 | expected, | 112 | expected, |
2859 | 113 | removeSecurityProxy( | 113 | removeSecurityProxy( |
2860 | 114 | self.getVocabulary(context))._karma_context_constraint) | 114 | self.getVocabulary(context))._karma_context_constraint) |
2861 | @@ -233,7 +233,7 @@ | |||
2862 | 233 | 233 | ||
2863 | 234 | results = list(self.searchVocabulary(None, u'foobar')) | 234 | results = list(self.searchVocabulary(None, u'foobar')) |
2864 | 235 | with StormStatementRecorder() as recorder: | 235 | with StormStatementRecorder() as recorder: |
2866 | 236 | self.assertEquals(4, len(results)) | 236 | self.assertEqual(4, len(results)) |
2867 | 237 | for person in results: | 237 | for person in results: |
2868 | 238 | self.assertEqual( | 238 | self.assertEqual( |
2869 | 239 | expected_nicks[person.id], person.ircnicknames) | 239 | expected_nicks[person.id], person.ircnicknames) |
2870 | 240 | 240 | ||
2871 | === modified file 'lib/lp/registry/tests/test_personroles.py' | |||
2872 | --- lib/lp/registry/tests/test_personroles.py 2014-06-12 01:04:30 +0000 | |||
2873 | +++ lib/lp/registry/tests/test_personroles.py 2018-01-02 16:24:23 +0000 | |||
2874 | @@ -79,7 +79,7 @@ | |||
2875 | 79 | def test_inTeam(self): | 79 | def test_inTeam(self): |
2876 | 80 | # The method person.inTeam is available as the inTeam attribute. | 80 | # The method person.inTeam is available as the inTeam attribute. |
2877 | 81 | roles = IPersonRoles(self.person) | 81 | roles = IPersonRoles(self.person) |
2879 | 82 | self.assertEquals(self.person.inTeam, roles.inTeam) | 82 | self.assertEqual(self.person.inTeam, roles.inTeam) |
2880 | 83 | 83 | ||
2881 | 84 | def test_inTeam_works(self): | 84 | def test_inTeam_works(self): |
2882 | 85 | # Make sure it actually works. | 85 | # Make sure it actually works. |
2883 | 86 | 86 | ||
2884 | === modified file 'lib/lp/registry/tests/test_personset.py' | |||
2885 | --- lib/lp/registry/tests/test_personset.py 2018-01-02 10:54:31 +0000 | |||
2886 | +++ lib/lp/registry/tests/test_personset.py 2018-01-02 16:24:23 +0000 | |||
2887 | @@ -569,7 +569,7 @@ | |||
2888 | 569 | 569 | ||
2889 | 570 | ensured_person = self.person_set.ensurePerson( | 570 | ensured_person = self.person_set.ensurePerson( |
2890 | 571 | self.email_address, self.displayname, self.rationale) | 571 | self.email_address, self.displayname, self.rationale) |
2892 | 572 | self.assertEquals(testing_person.id, ensured_person.id) | 572 | self.assertEqual(testing_person.id, ensured_person.id) |
2893 | 573 | self.assertIsNot( | 573 | self.assertIsNot( |
2894 | 574 | ensured_person.displayname, self.displayname, | 574 | ensured_person.displayname, self.displayname, |
2895 | 575 | 'Person.displayname should not be overridden.') | 575 | 'Person.displayname should not be overridden.') |
2896 | @@ -655,10 +655,10 @@ | |||
2897 | 655 | u'other-openid-identifier', 'a@b.com') | 655 | u'other-openid-identifier', 'a@b.com') |
2898 | 656 | 656 | ||
2899 | 657 | self.assertEqual(other_person, person) | 657 | self.assertEqual(other_person, person) |
2904 | 658 | self.assert_( | 658 | self.assertIn( |
2905 | 659 | u'other-openid-identifier' in [ | 659 | u'other-openid-identifier', |
2906 | 660 | identifier.identifier for identifier in removeSecurityProxy( | 660 | [identifier.identifier for identifier in removeSecurityProxy( |
2907 | 661 | person.account).openid_identifiers]) | 661 | person.account).openid_identifiers]) |
2908 | 662 | 662 | ||
2909 | 663 | 663 | ||
2910 | 664 | class TestPersonSetGetOrCreateSoftwareCenterCustomer(TestCaseWithFactory): | 664 | class TestPersonSetGetOrCreateSoftwareCenterCustomer(TestCaseWithFactory): |
2911 | 665 | 665 | ||
2912 | === modified file 'lib/lp/registry/tests/test_pillar.py' | |||
2913 | --- lib/lp/registry/tests/test_pillar.py 2016-04-14 05:16:26 +0000 | |||
2914 | +++ lib/lp/registry/tests/test_pillar.py 2018-01-02 16:24:23 +0000 | |||
2915 | @@ -40,7 +40,7 @@ | |||
2916 | 40 | pillar.name for pillar in | 40 | pillar.name for pillar in |
2917 | 41 | pillar_set.search( | 41 | pillar_set.search( |
2918 | 42 | getUtility(IPersonSet).getByName('mark'), 'lz', limit=5)] | 42 | getUtility(IPersonSet).getByName('mark'), 'lz', limit=5)] |
2920 | 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']) |
2921 | 44 | 44 | ||
2922 | 45 | 45 | ||
2923 | 46 | class TestPillarPerson(TestCaseWithFactory): | 46 | class TestPillarPerson(TestCaseWithFactory): |
2924 | 47 | 47 | ||
2925 | === modified file 'lib/lp/registry/tests/test_prf_filter.py' | |||
2926 | --- lib/lp/registry/tests/test_prf_filter.py 2018-01-02 10:54:31 +0000 | |||
2927 | +++ lib/lp/registry/tests/test_prf_filter.py 2018-01-02 16:24:23 +0000 | |||
2928 | @@ -22,7 +22,7 @@ | |||
2929 | 22 | from logging import getLogger | 22 | from logging import getLogger |
2930 | 23 | parent = getLogger("foo") | 23 | parent = getLogger("foo") |
2931 | 24 | f = Filter(log_parent=parent) | 24 | f = Filter(log_parent=parent) |
2933 | 25 | self.assertEquals(f.log.parent, parent) | 25 | self.assertEqual(f.log.parent, parent) |
2934 | 26 | 26 | ||
2935 | 27 | 27 | ||
2936 | 28 | class Filter_Init(unittest.TestCase): | 28 | class Filter_Init(unittest.TestCase): |
2937 | @@ -31,15 +31,15 @@ | |||
2938 | 31 | from lp.registry.scripts.productreleasefinder.filter import ( | 31 | from lp.registry.scripts.productreleasefinder.filter import ( |
2939 | 32 | Filter) | 32 | Filter) |
2940 | 33 | f = Filter() | 33 | f = Filter() |
2942 | 34 | self.assertEquals(f.filters, []) | 34 | self.assertEqual(f.filters, []) |
2943 | 35 | 35 | ||
2944 | 36 | def testFiltersPropertyGiven(self): | 36 | def testFiltersPropertyGiven(self): |
2945 | 37 | """Filter constructor accepts argument to set filters property.""" | 37 | """Filter constructor accepts argument to set filters property.""" |
2946 | 38 | from lp.registry.scripts.productreleasefinder.filter import ( | 38 | from lp.registry.scripts.productreleasefinder.filter import ( |
2947 | 39 | Filter) | 39 | Filter) |
2948 | 40 | f = Filter(["wibble"]) | 40 | f = Filter(["wibble"]) |
2951 | 41 | self.assertEquals(len(f.filters), 1) | 41 | self.assertEqual(len(f.filters), 1) |
2952 | 42 | self.assertEquals(f.filters[0], "wibble") | 42 | self.assertEqual(f.filters[0], "wibble") |
2953 | 43 | 43 | ||
2954 | 44 | 44 | ||
2955 | 45 | class Filter_CheckUrl(unittest.TestCase): | 45 | class Filter_CheckUrl(unittest.TestCase): |
2956 | @@ -48,7 +48,7 @@ | |||
2957 | 48 | from lp.registry.scripts.productreleasefinder.filter import ( | 48 | from lp.registry.scripts.productreleasefinder.filter import ( |
2958 | 49 | Filter) | 49 | Filter) |
2959 | 50 | f = Filter() | 50 | f = Filter() |
2961 | 51 | self.assertEquals(f.check("file:///subdir/file"), None) | 51 | self.assertEqual(f.check("file:///subdir/file"), None) |
2962 | 52 | 52 | ||
2963 | 53 | def makeFilter(self, key, urlglob): | 53 | def makeFilter(self, key, urlglob): |
2964 | 54 | from lp.registry.scripts.productreleasefinder.filter import ( | 54 | from lp.registry.scripts.productreleasefinder.filter import ( |
2965 | @@ -59,27 +59,27 @@ | |||
2966 | 59 | def testNotMatching(self): | 59 | def testNotMatching(self): |
2967 | 60 | """Filter.check returns None if doesn't match a filter.""" | 60 | """Filter.check returns None if doesn't match a filter.""" |
2968 | 61 | f = self.makeFilter("foo", "file:///subdir/w*") | 61 | f = self.makeFilter("foo", "file:///subdir/w*") |
2970 | 62 | self.assertEquals(f.check("file:///subdir/file"), None) | 62 | self.assertEqual(f.check("file:///subdir/file"), None) |
2971 | 63 | 63 | ||
2972 | 64 | def testNoMatchingSlashes(self): | 64 | def testNoMatchingSlashes(self): |
2973 | 65 | """Filter.check that the glob does not match slashes.""" | 65 | """Filter.check that the glob does not match slashes.""" |
2974 | 66 | f = self.makeFilter("foo", "file:///*l*") | 66 | f = self.makeFilter("foo", "file:///*l*") |
2976 | 67 | self.assertEquals(f.check("file:///subdir/file"), None) | 67 | self.assertEqual(f.check("file:///subdir/file"), None) |
2977 | 68 | 68 | ||
2978 | 69 | def testReturnsMatching(self): | 69 | def testReturnsMatching(self): |
2979 | 70 | """Filter.check returns the matching keyword.""" | 70 | """Filter.check returns the matching keyword.""" |
2980 | 71 | f = self.makeFilter("foo", "file:///subdir/f*e") | 71 | f = self.makeFilter("foo", "file:///subdir/f*e") |
2982 | 72 | self.assertEquals(f.check("file:///subdir/file"), "foo") | 72 | self.assertEqual(f.check("file:///subdir/file"), "foo") |
2983 | 73 | 73 | ||
2984 | 74 | def testGlobSubdir(self): | 74 | def testGlobSubdir(self): |
2985 | 75 | # Filter.glob can contain slashes to match subdirs | 75 | # Filter.glob can contain slashes to match subdirs |
2986 | 76 | f = self.makeFilter("foo", "file:///sub*/f*e") | 76 | f = self.makeFilter("foo", "file:///sub*/f*e") |
2988 | 77 | self.assertEquals(f.check("file:///subdir/file"), "foo") | 77 | self.assertEqual(f.check("file:///subdir/file"), "foo") |
2989 | 78 | 78 | ||
2990 | 79 | def testReturnsNonMatchingBase(self): | 79 | def testReturnsNonMatchingBase(self): |
2991 | 80 | """Filter.check returns None if the base does not match.""" | 80 | """Filter.check returns None if the base does not match.""" |
2992 | 81 | f = self.makeFilter("foo", "http:f*e") | 81 | f = self.makeFilter("foo", "http:f*e") |
2994 | 82 | self.assertEquals(f.check("file:///subdir/file"), None) | 82 | self.assertEqual(f.check("file:///subdir/file"), None) |
2995 | 83 | 83 | ||
2996 | 84 | 84 | ||
2997 | 85 | class Filter_IsPossibleParentUrl(unittest.TestCase): | 85 | class Filter_IsPossibleParentUrl(unittest.TestCase): |
2998 | 86 | 86 | ||
2999 | === modified file 'lib/lp/registry/tests/test_prf_hose.py' | |||
3000 | --- lib/lp/registry/tests/test_prf_hose.py 2018-01-02 10:54:31 +0000 | |||
3001 | +++ lib/lp/registry/tests/test_prf_hose.py 2018-01-02 16:24:23 +0000 | |||
3002 | @@ -29,7 +29,7 @@ | |||
3003 | 29 | from logging import getLogger | 29 | from logging import getLogger |
3004 | 30 | parent = getLogger("foo") | 30 | parent = getLogger("foo") |
3005 | 31 | h = Hose(log_parent=parent) | 31 | h = Hose(log_parent=parent) |
3007 | 32 | self.assertEquals(h.log.parent, parent) | 32 | self.assertEqual(h.log.parent, parent) |
3008 | 33 | 33 | ||
3009 | 34 | 34 | ||
3010 | 35 | class Hose_Filter(unittest.TestCase): | 35 | class Hose_Filter(unittest.TestCase): |
3011 | @@ -45,7 +45,7 @@ | |||
3012 | 45 | """Hose creates Filter object with empty dictionary.""" | 45 | """Hose creates Filter object with empty dictionary.""" |
3013 | 46 | from lp.registry.scripts.productreleasefinder.hose import Hose | 46 | from lp.registry.scripts.productreleasefinder.hose import Hose |
3014 | 47 | h = Hose() | 47 | h = Hose() |
3016 | 48 | self.assertEquals(h.filter.filters, []) | 48 | self.assertEqual(h.filter.filters, []) |
3017 | 49 | 49 | ||
3018 | 50 | def testCreatesFiltersWithGiven(self): | 50 | def testCreatesFiltersWithGiven(self): |
3019 | 51 | """Hose creates Filter object with dictionary given.""" | 51 | """Hose creates Filter object with dictionary given.""" |
3020 | @@ -54,8 +54,8 @@ | |||
3021 | 54 | FilterPattern) | 54 | FilterPattern) |
3022 | 55 | pattern = FilterPattern("foo", "http:e*") | 55 | pattern = FilterPattern("foo", "http:e*") |
3023 | 56 | h = Hose([pattern]) | 56 | h = Hose([pattern]) |
3026 | 57 | self.assertEquals(len(h.filter.filters), 1) | 57 | self.assertEqual(len(h.filter.filters), 1) |
3027 | 58 | self.assertEquals(h.filter.filters[0], pattern) | 58 | self.assertEqual(h.filter.filters[0], pattern) |
3028 | 59 | 59 | ||
3029 | 60 | 60 | ||
3030 | 61 | class Hose_Urls(unittest.TestCase): | 61 | class Hose_Urls(unittest.TestCase): |
3031 | @@ -74,7 +74,7 @@ | |||
3032 | 74 | obs = Observer() | 74 | obs = Observer() |
3033 | 75 | instrument_method(obs, h, "reduceWork") | 75 | instrument_method(obs, h, "reduceWork") |
3034 | 76 | h.__init__() | 76 | h.__init__() |
3036 | 77 | self.assert_(obs.called_it) | 77 | self.assertTrue(obs.called_it) |
3037 | 78 | 78 | ||
3038 | 79 | def testPassesUrlList(self): | 79 | def testPassesUrlList(self): |
3039 | 80 | """Hose constructor passes url list to reduceWork.""" | 80 | """Hose constructor passes url list to reduceWork.""" |
3040 | @@ -94,8 +94,7 @@ | |||
3041 | 94 | obs = Observer() | 94 | obs = Observer() |
3042 | 95 | instrument_method(obs, h, "reduceWork") | 95 | instrument_method(obs, h, "reduceWork") |
3043 | 96 | h.__init__([pattern]) | 96 | h.__init__([pattern]) |
3046 | 97 | self.assertEquals(obs.args[0][0], | 97 | self.assertEqual(obs.args[0][0], ["http://archive.ubuntu.com/"]) |
3045 | 98 | ["http://archive.ubuntu.com/"]) | ||
3047 | 99 | 98 | ||
3048 | 100 | def testSetsUrlProperty(self): | 99 | def testSetsUrlProperty(self): |
3049 | 101 | """Hose constructor sets urls property to reduceWork return value.""" | 100 | """Hose constructor sets urls property to reduceWork return value.""" |
3050 | @@ -106,7 +105,7 @@ | |||
3051 | 106 | return "wibble" | 105 | return "wibble" |
3052 | 107 | 106 | ||
3053 | 108 | h = TestHose() | 107 | h = TestHose() |
3055 | 109 | self.assertEquals(h.urls, "wibble") | 108 | self.assertEqual(h.urls, "wibble") |
3056 | 110 | 109 | ||
3057 | 111 | 110 | ||
3058 | 112 | class Hose_ReduceWork(unittest.TestCase): | 111 | class Hose_ReduceWork(unittest.TestCase): |
3059 | @@ -114,24 +113,24 @@ | |||
3060 | 114 | """Hose.reduceWork returns empty list when given one.""" | 113 | """Hose.reduceWork returns empty list when given one.""" |
3061 | 115 | from lp.registry.scripts.productreleasefinder.hose import Hose | 114 | from lp.registry.scripts.productreleasefinder.hose import Hose |
3062 | 116 | h = Hose() | 115 | h = Hose() |
3064 | 117 | self.assertEquals(h.reduceWork([]), []) | 116 | self.assertEqual(h.reduceWork([]), []) |
3065 | 118 | 117 | ||
3066 | 119 | def testReducedList(self): | 118 | def testReducedList(self): |
3067 | 120 | """Hose.reduceWork returns same list when nothing to do.""" | 119 | """Hose.reduceWork returns same list when nothing to do.""" |
3068 | 121 | from lp.registry.scripts.productreleasefinder.hose import Hose | 120 | from lp.registry.scripts.productreleasefinder.hose import Hose |
3069 | 122 | h = Hose() | 121 | h = Hose() |
3072 | 123 | self.assertEquals(h.reduceWork(["http://localhost/", "file:///usr/"]), | 122 | self.assertEqual(h.reduceWork(["http://localhost/", "file:///usr/"]), |
3073 | 124 | ["http://localhost/", "file:///usr/"]) | 123 | ["http://localhost/", "file:///usr/"]) |
3074 | 125 | 124 | ||
3075 | 126 | def testReducesList(self): | 125 | def testReducesList(self): |
3076 | 127 | """Hose.reduceWork removes children elements from list.""" | 126 | """Hose.reduceWork removes children elements from list.""" |
3077 | 128 | from lp.registry.scripts.productreleasefinder.hose import Hose | 127 | from lp.registry.scripts.productreleasefinder.hose import Hose |
3078 | 129 | h = Hose() | 128 | h = Hose() |
3084 | 130 | self.assertEquals(h.reduceWork(["http://localhost/", | 129 | self.assertEqual(h.reduceWork(["http://localhost/", |
3085 | 131 | "http://localhost/foo/bar/", | 130 | "http://localhost/foo/bar/", |
3086 | 132 | "http://localhost/wibble/", | 131 | "http://localhost/wibble/", |
3087 | 133 | "file:///usr/"]), | 132 | "file:///usr/"]), |
3088 | 134 | ["http://localhost/", "file:///usr/"]) | 133 | ["http://localhost/", "file:///usr/"]) |
3089 | 135 | 134 | ||
3090 | 136 | 135 | ||
3091 | 137 | class Hose_LimitWalk(unittest.TestCase): | 136 | class Hose_LimitWalk(unittest.TestCase): |
3092 | 138 | 137 | ||
3093 | === modified file 'lib/lp/registry/tests/test_prf_log.py' | |||
3094 | --- lib/lp/registry/tests/test_prf_log.py 2018-01-02 10:54:31 +0000 | |||
3095 | +++ lib/lp/registry/tests/test_prf_log.py 2018-01-02 16:24:23 +0000 | |||
3096 | @@ -20,20 +20,20 @@ | |||
3097 | 20 | def testNoParent(self): | 20 | def testNoParent(self): |
3098 | 21 | """get_logger works if no parent is given.""" | 21 | """get_logger works if no parent is given.""" |
3099 | 22 | from lp.registry.scripts.productreleasefinder.log import get_logger | 22 | from lp.registry.scripts.productreleasefinder.log import get_logger |
3101 | 23 | self.assertEquals(get_logger("test").name, "test") | 23 | self.assertEqual(get_logger("test").name, "test") |
3102 | 24 | 24 | ||
3103 | 25 | def testRootParent(self): | 25 | def testRootParent(self): |
3104 | 26 | """get_logger works if root logger is given.""" | 26 | """get_logger works if root logger is given.""" |
3105 | 27 | from lp.registry.scripts.productreleasefinder.log import get_logger | 27 | from lp.registry.scripts.productreleasefinder.log import get_logger |
3106 | 28 | from logging import root | 28 | from logging import root |
3108 | 29 | self.assertEquals(get_logger("test", root).name, "test") | 29 | self.assertEqual(get_logger("test", root).name, "test") |
3109 | 30 | 30 | ||
3110 | 31 | def testNormalParent(self): | 31 | def testNormalParent(self): |
3111 | 32 | """get_logger works if non-root logger is given.""" | 32 | """get_logger works if non-root logger is given.""" |
3112 | 33 | from lp.registry.scripts.productreleasefinder.log import get_logger | 33 | from lp.registry.scripts.productreleasefinder.log import get_logger |
3113 | 34 | from logging import getLogger | 34 | from logging import getLogger |
3114 | 35 | parent = getLogger("foo") | 35 | parent = getLogger("foo") |
3116 | 36 | self.assertEquals(get_logger("test", parent).name, "foo.test") | 36 | self.assertEqual(get_logger("test", parent).name, "foo.test") |
3117 | 37 | 37 | ||
3118 | 38 | def testDeepParent(self): | 38 | def testDeepParent(self): |
3119 | 39 | """get_logger works if deep-level logger is given.""" | 39 | """get_logger works if deep-level logger is given.""" |
3120 | @@ -41,4 +41,4 @@ | |||
3121 | 41 | from logging import getLogger | 41 | from logging import getLogger |
3122 | 42 | getLogger("foo") | 42 | getLogger("foo") |
3123 | 43 | parent2 = getLogger("foo.bar") | 43 | parent2 = getLogger("foo.bar") |
3125 | 44 | self.assertEquals(get_logger("test", parent2).name, "foo.bar.test") | 44 | self.assertEqual(get_logger("test", parent2).name, "foo.bar.test") |
3126 | 45 | 45 | ||
3127 | === modified file 'lib/lp/registry/tests/test_prf_walker.py' | |||
3128 | --- lib/lp/registry/tests/test_prf_walker.py 2018-01-02 10:54:31 +0000 | |||
3129 | +++ lib/lp/registry/tests/test_prf_walker.py 2018-01-02 16:24:23 +0000 | |||
3130 | @@ -29,7 +29,7 @@ | |||
3131 | 29 | from logging import getLogger | 29 | from logging import getLogger |
3132 | 30 | parent = getLogger("foo") | 30 | parent = getLogger("foo") |
3133 | 31 | w = WalkerBase("/", log_parent=parent) | 31 | w = WalkerBase("/", log_parent=parent) |
3135 | 32 | self.assertEquals(w.log.parent, parent) | 32 | self.assertEqual(w.log.parent, parent) |
3136 | 33 | 33 | ||
3137 | 34 | 34 | ||
3138 | 35 | class WalkerBase_Base(TestCase): | 35 | class WalkerBase_Base(TestCase): |
3139 | @@ -37,22 +37,22 @@ | |||
3140 | 37 | def testSetsBase(self): | 37 | def testSetsBase(self): |
3141 | 38 | """WalkerBase sets the base property.""" | 38 | """WalkerBase sets the base property.""" |
3142 | 39 | w = WalkerBase("ftp://localhost/") | 39 | w = WalkerBase("ftp://localhost/") |
3144 | 40 | self.assertEquals(w.base, "ftp://localhost/") | 40 | self.assertEqual(w.base, "ftp://localhost/") |
3145 | 41 | 41 | ||
3146 | 42 | def testSetsScheme(self): | 42 | def testSetsScheme(self): |
3147 | 43 | """WalkerBase sets the scheme property.""" | 43 | """WalkerBase sets the scheme property.""" |
3148 | 44 | w = WalkerBase("ftp://localhost/") | 44 | w = WalkerBase("ftp://localhost/") |
3150 | 45 | self.assertEquals(w.scheme, "ftp") | 45 | self.assertEqual(w.scheme, "ftp") |
3151 | 46 | 46 | ||
3152 | 47 | def testSetsHost(self): | 47 | def testSetsHost(self): |
3153 | 48 | """WalkerBase sets the host property.""" | 48 | """WalkerBase sets the host property.""" |
3154 | 49 | w = WalkerBase("ftp://localhost/") | 49 | w = WalkerBase("ftp://localhost/") |
3156 | 50 | self.assertEquals(w.host, "localhost") | 50 | self.assertEqual(w.host, "localhost") |
3157 | 51 | 51 | ||
3158 | 52 | def testNoScheme(self): | 52 | def testNoScheme(self): |
3159 | 53 | """WalkerBase works when given a URL with no scheme.""" | 53 | """WalkerBase works when given a URL with no scheme.""" |
3160 | 54 | w = WalkerBase("/") | 54 | w = WalkerBase("/") |
3162 | 55 | self.assertEquals(w.host, "") | 55 | self.assertEqual(w.host, "") |
3163 | 56 | 56 | ||
3164 | 57 | def testWrongScheme(self): | 57 | def testWrongScheme(self): |
3165 | 58 | """WalkerBase raises WalkerError when given an unhandled scheme.""" | 58 | """WalkerBase raises WalkerError when given an unhandled scheme.""" |
3166 | @@ -63,75 +63,75 @@ | |||
3167 | 63 | def testUnescapesHost(self): | 63 | def testUnescapesHost(self): |
3168 | 64 | """WalkerBase unescapes the host portion.""" | 64 | """WalkerBase unescapes the host portion.""" |
3169 | 65 | w = WalkerBase("ftp://local%40host/") | 65 | w = WalkerBase("ftp://local%40host/") |
3171 | 66 | self.assertEquals(w.host, "local@host") | 66 | self.assertEqual(w.host, "local@host") |
3172 | 67 | 67 | ||
3173 | 68 | def testNoUsername(self): | 68 | def testNoUsername(self): |
3174 | 69 | """WalkerBase stores None when there is no username.""" | 69 | """WalkerBase stores None when there is no username.""" |
3175 | 70 | w = WalkerBase("ftp://localhost/") | 70 | w = WalkerBase("ftp://localhost/") |
3177 | 71 | self.assertEquals(w.user, None) | 71 | self.assertEqual(w.user, None) |
3178 | 72 | 72 | ||
3179 | 73 | def testUsername(self): | 73 | def testUsername(self): |
3180 | 74 | """WalkerBase splits out the username from the host portion.""" | 74 | """WalkerBase splits out the username from the host portion.""" |
3181 | 75 | w = WalkerBase("ftp://scott@localhost/") | 75 | w = WalkerBase("ftp://scott@localhost/") |
3184 | 76 | self.assertEquals(w.user, "scott") | 76 | self.assertEqual(w.user, "scott") |
3185 | 77 | self.assertEquals(w.host, "localhost") | 77 | self.assertEqual(w.host, "localhost") |
3186 | 78 | 78 | ||
3187 | 79 | def testUnescapesUsername(self): | 79 | def testUnescapesUsername(self): |
3188 | 80 | """WalkerBase unescapes the username portion.""" | 80 | """WalkerBase unescapes the username portion.""" |
3189 | 81 | w = WalkerBase("ftp://scott%3awibble@localhost/") | 81 | w = WalkerBase("ftp://scott%3awibble@localhost/") |
3192 | 82 | self.assertEquals(w.user, "scott:wibble") | 82 | self.assertEqual(w.user, "scott:wibble") |
3193 | 83 | self.assertEquals(w.host, "localhost") | 83 | self.assertEqual(w.host, "localhost") |
3194 | 84 | 84 | ||
3195 | 85 | def testNoPassword(self): | 85 | def testNoPassword(self): |
3196 | 86 | """WalkerBase stores None when there is no password.""" | 86 | """WalkerBase stores None when there is no password.""" |
3197 | 87 | w = WalkerBase("ftp://scott@localhost/") | 87 | w = WalkerBase("ftp://scott@localhost/") |
3199 | 88 | self.assertEquals(w.passwd, None) | 88 | self.assertEqual(w.passwd, None) |
3200 | 89 | 89 | ||
3201 | 90 | def testPassword(self): | 90 | def testPassword(self): |
3202 | 91 | """WalkerBase splits out the password from the username.""" | 91 | """WalkerBase splits out the password from the username.""" |
3203 | 92 | w = WalkerBase("ftp://scott:wibble@localhost/") | 92 | w = WalkerBase("ftp://scott:wibble@localhost/") |
3207 | 93 | self.assertEquals(w.user, "scott") | 93 | self.assertEqual(w.user, "scott") |
3208 | 94 | self.assertEquals(w.passwd, "wibble") | 94 | self.assertEqual(w.passwd, "wibble") |
3209 | 95 | self.assertEquals(w.host, "localhost") | 95 | self.assertEqual(w.host, "localhost") |
3210 | 96 | 96 | ||
3211 | 97 | def testUnescapesPassword(self): | 97 | def testUnescapesPassword(self): |
3212 | 98 | """WalkerBase unescapes the password portion.""" | 98 | """WalkerBase unescapes the password portion.""" |
3213 | 99 | w = WalkerBase("ftp://scott:wibble%20wobble@localhost/") | 99 | w = WalkerBase("ftp://scott:wibble%20wobble@localhost/") |
3217 | 100 | self.assertEquals(w.user, "scott") | 100 | self.assertEqual(w.user, "scott") |
3218 | 101 | self.assertEquals(w.passwd, "wibble wobble") | 101 | self.assertEqual(w.passwd, "wibble wobble") |
3219 | 102 | self.assertEquals(w.host, "localhost") | 102 | self.assertEqual(w.host, "localhost") |
3220 | 103 | 103 | ||
3221 | 104 | def testPathOnly(self): | 104 | def testPathOnly(self): |
3222 | 105 | """WalkerBase stores the path if that's all there is.""" | 105 | """WalkerBase stores the path if that's all there is.""" |
3223 | 106 | w = WalkerBase("/path/to/something/") | 106 | w = WalkerBase("/path/to/something/") |
3225 | 107 | self.assertEquals(w.path, "/path/to/something/") | 107 | self.assertEqual(w.path, "/path/to/something/") |
3226 | 108 | 108 | ||
3227 | 109 | def testPathInUrl(self): | 109 | def testPathInUrl(self): |
3228 | 110 | """WalkerBase stores the path portion of a complete URL.""" | 110 | """WalkerBase stores the path portion of a complete URL.""" |
3229 | 111 | w = WalkerBase("ftp://localhost/path/to/something/") | 111 | w = WalkerBase("ftp://localhost/path/to/something/") |
3231 | 112 | self.assertEquals(w.path, "/path/to/something/") | 112 | self.assertEqual(w.path, "/path/to/something/") |
3232 | 113 | 113 | ||
3233 | 114 | def testAddsSlashToPath(self): | 114 | def testAddsSlashToPath(self): |
3234 | 115 | """WalkerBase adds a trailing slash to path if ommitted.""" | 115 | """WalkerBase adds a trailing slash to path if ommitted.""" |
3235 | 116 | w = WalkerBase("ftp://localhost/path/to/something") | 116 | w = WalkerBase("ftp://localhost/path/to/something") |
3237 | 117 | self.assertEquals(w.path, "/path/to/something/") | 117 | self.assertEqual(w.path, "/path/to/something/") |
3238 | 118 | 118 | ||
3239 | 119 | def testUnescapesPath(self): | 119 | def testUnescapesPath(self): |
3240 | 120 | """WalkerBase leaves the path escaped.""" | 120 | """WalkerBase leaves the path escaped.""" |
3241 | 121 | w = WalkerBase("ftp://localhost/some%20thing/") | 121 | w = WalkerBase("ftp://localhost/some%20thing/") |
3243 | 122 | self.assertEquals(w.path, "/some%20thing/") | 122 | self.assertEqual(w.path, "/some%20thing/") |
3244 | 123 | 123 | ||
3245 | 124 | def testStoresQuery(self): | 124 | def testStoresQuery(self): |
3246 | 125 | """WalkerBase stores the query portion of a supporting URL.""" | 125 | """WalkerBase stores the query portion of a supporting URL.""" |
3247 | 126 | w = WalkerBase("http://localhost/?foo") | 126 | w = WalkerBase("http://localhost/?foo") |
3249 | 127 | self.assertEquals(w.query, "foo") | 127 | self.assertEqual(w.query, "foo") |
3250 | 128 | 128 | ||
3251 | 129 | def testStoresFragment(self): | 129 | def testStoresFragment(self): |
3252 | 130 | """WalkerBase stores the fragment portion of a supporting URL.""" | 130 | """WalkerBase stores the fragment portion of a supporting URL.""" |
3253 | 131 | WalkerBase.FRAGMENTS = True | 131 | WalkerBase.FRAGMENTS = True |
3254 | 132 | try: | 132 | try: |
3255 | 133 | w = WalkerBase("http://localhost/#foo") | 133 | w = WalkerBase("http://localhost/#foo") |
3257 | 134 | self.assertEquals(w.fragment, "foo") | 134 | self.assertEqual(w.fragment, "foo") |
3258 | 135 | finally: | 135 | finally: |
3259 | 136 | WalkerBase.FRAGMENTS = False | 136 | WalkerBase.FRAGMENTS = False |
3260 | 137 | 137 | ||
3261 | @@ -204,14 +204,14 @@ | |||
3262 | 204 | from lp.registry.scripts.productreleasefinder.walker import ( | 204 | from lp.registry.scripts.productreleasefinder.walker import ( |
3263 | 205 | FTPWalker) | 205 | FTPWalker) |
3264 | 206 | w = FTPWalker("ftp://localhost/") | 206 | w = FTPWalker("ftp://localhost/") |
3266 | 207 | self.assertEquals(w.host, "localhost") | 207 | self.assertEqual(w.host, "localhost") |
3267 | 208 | 208 | ||
3268 | 209 | def testNoScheme(self): | 209 | def testNoScheme(self): |
3269 | 210 | """FTPWalker works when given a URL with no scheme.""" | 210 | """FTPWalker works when given a URL with no scheme.""" |
3270 | 211 | from lp.registry.scripts.productreleasefinder.walker import ( | 211 | from lp.registry.scripts.productreleasefinder.walker import ( |
3271 | 212 | FTPWalker) | 212 | FTPWalker) |
3272 | 213 | w = FTPWalker("/") | 213 | w = FTPWalker("/") |
3274 | 214 | self.assertEquals(w.host, "") | 214 | self.assertEqual(w.host, "") |
3275 | 215 | 215 | ||
3276 | 216 | def testWrongScheme(self): | 216 | def testWrongScheme(self): |
3277 | 217 | """FTPWalker raises WalkerError when given an unhandled scheme.""" | 217 | """FTPWalker raises WalkerError when given an unhandled scheme.""" |
3278 | @@ -224,14 +224,14 @@ | |||
3279 | 224 | from lp.registry.scripts.productreleasefinder.walker import ( | 224 | from lp.registry.scripts.productreleasefinder.walker import ( |
3280 | 225 | FTPWalker) | 225 | FTPWalker) |
3281 | 226 | w = FTPWalker("ftp://localhost/") | 226 | w = FTPWalker("ftp://localhost/") |
3283 | 227 | self.assertEquals(w.user, "anonymous") | 227 | self.assertEqual(w.user, "anonymous") |
3284 | 228 | 228 | ||
3285 | 229 | def testNoPassword(self): | 229 | def testNoPassword(self): |
3286 | 230 | """FTPWalker stores empty string when there is no password.""" | 230 | """FTPWalker stores empty string when there is no password.""" |
3287 | 231 | from lp.registry.scripts.productreleasefinder.walker import ( | 231 | from lp.registry.scripts.productreleasefinder.walker import ( |
3288 | 232 | FTPWalker) | 232 | FTPWalker) |
3289 | 233 | w = FTPWalker("ftp://scott@localhost/") | 233 | w = FTPWalker("ftp://scott@localhost/") |
3291 | 234 | self.assertEquals(w.passwd, "") | 234 | self.assertEqual(w.passwd, "") |
3292 | 235 | 235 | ||
3293 | 236 | 236 | ||
3294 | 237 | class HTTPWalker_Base(TestCase): | 237 | class HTTPWalker_Base(TestCase): |
3295 | @@ -241,21 +241,21 @@ | |||
3296 | 241 | from lp.registry.scripts.productreleasefinder.walker import ( | 241 | from lp.registry.scripts.productreleasefinder.walker import ( |
3297 | 242 | HTTPWalker) | 242 | HTTPWalker) |
3298 | 243 | w = HTTPWalker("http://localhost/") | 243 | w = HTTPWalker("http://localhost/") |
3300 | 244 | self.assertEquals(w.host, "localhost") | 244 | self.assertEqual(w.host, "localhost") |
3301 | 245 | 245 | ||
3302 | 246 | def testHttpsScheme(self): | 246 | def testHttpsScheme(self): |
3303 | 247 | """HTTPWalker works when initialized with an https-scheme URL.""" | 247 | """HTTPWalker works when initialized with an https-scheme URL.""" |
3304 | 248 | from lp.registry.scripts.productreleasefinder.walker import ( | 248 | from lp.registry.scripts.productreleasefinder.walker import ( |
3305 | 249 | HTTPWalker) | 249 | HTTPWalker) |
3306 | 250 | w = HTTPWalker("https://localhost/") | 250 | w = HTTPWalker("https://localhost/") |
3308 | 251 | self.assertEquals(w.host, "localhost") | 251 | self.assertEqual(w.host, "localhost") |
3309 | 252 | 252 | ||
3310 | 253 | def testNoScheme(self): | 253 | def testNoScheme(self): |
3311 | 254 | """HTTPWalker works when given a URL with no scheme.""" | 254 | """HTTPWalker works when given a URL with no scheme.""" |
3312 | 255 | from lp.registry.scripts.productreleasefinder.walker import ( | 255 | from lp.registry.scripts.productreleasefinder.walker import ( |
3313 | 256 | HTTPWalker) | 256 | HTTPWalker) |
3314 | 257 | w = HTTPWalker("/") | 257 | w = HTTPWalker("/") |
3316 | 258 | self.assertEquals(w.host, "") | 258 | self.assertEqual(w.host, "") |
3317 | 259 | 259 | ||
3318 | 260 | def testWrongScheme(self): | 260 | def testWrongScheme(self): |
3319 | 261 | """HTTPWalker raises WalkerError when given an unhandled scheme.""" | 261 | """HTTPWalker raises WalkerError when given an unhandled scheme.""" |
3320 | @@ -274,13 +274,13 @@ | |||
3321 | 274 | self.walker = HTTPWalker("http://localhost/") | 274 | self.walker = HTTPWalker("http://localhost/") |
3322 | 275 | 275 | ||
3323 | 276 | def verify_url_scheme_and_handler(self, scheme, handler): | 276 | def verify_url_scheme_and_handler(self, scheme, handler): |
3326 | 277 | self.assert_(scheme in self.walker.URL_SCHEMES) | 277 | self.assertIn(scheme, self.walker.URL_SCHEMES) |
3327 | 278 | self.assert_(handler in self.walker.handlers) | 278 | self.assertIn(handler, self.walker.handlers) |
3328 | 279 | # urllib2 uses a naming convention to select the handler for | 279 | # urllib2 uses a naming convention to select the handler for |
3329 | 280 | # a URL scheme. This test is sanity to check to ensure that the | 280 | # a URL scheme. This test is sanity to check to ensure that the |
3330 | 281 | # HTTPWalker's configuration of the OpenerDirector is will work. | 281 | # HTTPWalker's configuration of the OpenerDirector is will work. |
3331 | 282 | method_name = '%s_open' % scheme | 282 | method_name = '%s_open' % scheme |
3333 | 283 | self.assert_(safe_hasattr(handler, method_name)) | 283 | self.assertTrue(safe_hasattr(handler, method_name)) |
3334 | 284 | 284 | ||
3335 | 285 | def test_http_request(self): | 285 | def test_http_request(self): |
3336 | 286 | import urllib2 | 286 | import urllib2 |
3337 | @@ -503,7 +503,7 @@ | |||
3338 | 503 | """combine_url constructs the URL correctly.""" | 503 | """combine_url constructs the URL correctly.""" |
3339 | 504 | from lp.registry.scripts.productreleasefinder.walker import ( | 504 | from lp.registry.scripts.productreleasefinder.walker import ( |
3340 | 505 | combine_url) | 505 | combine_url) |
3345 | 506 | self.assertEquals(combine_url("file:///base", "/subdir/", "file"), | 506 | self.assertEqual(combine_url("file:///base", "/subdir/", "file"), |
3346 | 507 | "file:///subdir/file") | 507 | "file:///subdir/file") |
3347 | 508 | self.assertEquals(combine_url("file:///base", "/subdir", "file"), | 508 | self.assertEqual(combine_url("file:///base", "/subdir", "file"), |
3348 | 509 | "file:///subdir/file") | 509 | "file:///subdir/file") |
3349 | 510 | 510 | ||
3350 | === modified file 'lib/lp/registry/tests/test_project_milestone.py' | |||
3351 | --- lib/lp/registry/tests/test_project_milestone.py 2015-01-29 16:28:30 +0000 | |||
3352 | +++ lib/lp/registry/tests/test_project_milestone.py 2018-01-02 16:24:23 +0000 | |||
3353 | @@ -331,7 +331,7 @@ | |||
3354 | 331 | try: | 331 | try: |
3355 | 332 | milestone.createProductRelease(1, now) | 332 | milestone.createProductRelease(1, now) |
3356 | 333 | except MultipleProductReleases as e: | 333 | except MultipleProductReleases as e: |
3358 | 334 | self.assert_( | 334 | self.assertTrue( |
3359 | 335 | str(e), 'A milestone can only have one ProductRelease.') | 335 | str(e), 'A milestone can only have one ProductRelease.') |
3360 | 336 | 336 | ||
3361 | 337 | def test_inappropriate_deactivation_does_not_cause_an_OOPS(self): | 337 | def test_inappropriate_deactivation_does_not_cause_an_OOPS(self): |
3362 | 338 | 338 | ||
3363 | === modified file 'lib/lp/registry/tests/test_teammembership.py' | |||
3364 | --- lib/lp/registry/tests/test_teammembership.py 2018-01-02 10:54:31 +0000 | |||
3365 | +++ lib/lp/registry/tests/test_teammembership.py 2018-01-02 16:24:23 +0000 | |||
3366 | @@ -277,7 +277,7 @@ | |||
3367 | 277 | def assertParticipantsEquals(self, participant_names, team): | 277 | def assertParticipantsEquals(self, participant_names, team): |
3368 | 278 | """Assert that the participants names in team are the expected ones. | 278 | """Assert that the participants names in team are the expected ones. |
3369 | 279 | """ | 279 | """ |
3371 | 280 | self.assertEquals( | 280 | self.assertEqual( |
3372 | 281 | sorted(participant_names), | 281 | sorted(participant_names), |
3373 | 282 | sorted([participant.name for participant in team.allmembers])) | 282 | sorted([participant.name for participant in team.allmembers])) |
3374 | 283 | 283 | ||
3375 | 284 | 284 | ||
3376 | === modified file 'lib/lp/scripts/tests/test_runlaunchpad.py' | |||
3377 | --- lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 10:54:31 +0000 | |||
3378 | +++ lib/lp/scripts/tests/test_runlaunchpad.py 2018-01-02 16:24:23 +0000 | |||
3379 | @@ -113,11 +113,11 @@ | |||
3380 | 113 | instance_config_dir = os.path.join(self.config_root, 'test') | 113 | instance_config_dir = os.path.join(self.config_root, 'test') |
3381 | 114 | os.mkdir(instance_config_dir) | 114 | os.mkdir(instance_config_dir) |
3382 | 115 | open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close() | 115 | open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close() |
3384 | 116 | self.assertEquals( | 116 | self.assertEqual( |
3385 | 117 | ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir], | 117 | ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir], |
3386 | 118 | process_config_arguments( | 118 | process_config_arguments( |
3387 | 119 | ['-i', 'test', '-o', 'foo'])) | 119 | ['-i', 'test', '-o', 'foo'])) |
3389 | 120 | self.assertEquals('test', config.instance_name) | 120 | self.assertEqual('test', config.instance_name) |
3390 | 121 | 121 | ||
3391 | 122 | 122 | ||
3392 | 123 | class ServersToStart(testtools.TestCase): | 123 | class ServersToStart(testtools.TestCase): |
3393 | 124 | 124 | ||
3394 | === modified file 'lib/lp/scripts/utilities/js/tests/test_combo.py' | |||
3395 | --- lib/lp/scripts/utilities/js/tests/test_combo.py 2016-01-26 15:47:37 +0000 | |||
3396 | +++ lib/lp/scripts/utilities/js/tests/test_combo.py 2018-01-02 16:24:23 +0000 | |||
3397 | @@ -90,7 +90,7 @@ | |||
3398 | 90 | 90 | ||
3399 | 91 | def test_parse_url_keeps_order(self): | 91 | def test_parse_url_keeps_order(self): |
3400 | 92 | """Parsing a combo loader URL returns an ordered list of filenames.""" | 92 | """Parsing a combo loader URL returns an ordered list of filenames.""" |
3402 | 93 | self.assertEquals( | 93 | self.assertEqual( |
3403 | 94 | parse_url(("http://yui.yahooapis.com/combo?" | 94 | parse_url(("http://yui.yahooapis.com/combo?" |
3404 | 95 | "3.0.0/build/yui/yui-min.js&" | 95 | "3.0.0/build/yui/yui-min.js&" |
3405 | 96 | "3.0.0/build/oop/oop-min.js&" | 96 | "3.0.0/build/oop/oop-min.js&" |
3406 | @@ -124,7 +124,7 @@ | |||
3407 | 124 | "** oop-min **", | 124 | "** oop-min **", |
3408 | 125 | "// event-custom/event-custom-min.js", | 125 | "// event-custom/event-custom-min.js", |
3409 | 126 | "** event-custom-min **")) | 126 | "** event-custom-min **")) |
3411 | 127 | self.assertEquals( | 127 | self.assertEqual( |
3412 | 128 | "".join(combine_files(["yui/yui-min.js", | 128 | "".join(combine_files(["yui/yui-min.js", |
3413 | 129 | "oop/oop-min.js", | 129 | "oop/oop-min.js", |
3414 | 130 | "event-custom/event-custom-min.js"], | 130 | "event-custom/event-custom-min.js"], |
3415 | @@ -163,7 +163,7 @@ | |||
3416 | 163 | "/* editor/assets/skins/sam/editor.css */", | 163 | "/* editor/assets/skins/sam/editor.css */", |
3417 | 164 | ".yui-editor{background:url(editor/assets/skins/sam/img/bg.png)}", | 164 | ".yui-editor{background:url(editor/assets/skins/sam/img/bg.png)}", |
3418 | 165 | )) | 165 | )) |
3420 | 166 | self.assertEquals( | 166 | self.assertEqual( |
3421 | 167 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 167 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3422 | 168 | "editor/assets/skins/sam/editor.css"], | 168 | "editor/assets/skins/sam/editor.css"], |
3423 | 169 | root=test_dir)).strip(), | 169 | root=test_dir)).strip(), |
3424 | @@ -225,7 +225,7 @@ | |||
3425 | 225 | "/* editor/assets/skins/sam/editor.css */", | 225 | "/* editor/assets/skins/sam/editor.css */", |
3426 | 226 | ".yui-editor{background:url(http://foo/static/img/bg.png)}", | 226 | ".yui-editor{background:url(http://foo/static/img/bg.png)}", |
3427 | 227 | )) | 227 | )) |
3429 | 228 | self.assertEquals( | 228 | self.assertEqual( |
3430 | 229 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 229 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3431 | 230 | "editor/assets/skins/sam/editor.css"], | 230 | "editor/assets/skins/sam/editor.css"], |
3432 | 231 | root=test_dir)).strip(), | 231 | root=test_dir)).strip(), |
3433 | @@ -263,7 +263,7 @@ | |||
3434 | 263 | '/* editor/assets/skins/sam/editor.css */', | 263 | '/* editor/assets/skins/sam/editor.css */', |
3435 | 264 | '.yui-editor{background:url("data:image/gif;base64,base64-data")}', | 264 | '.yui-editor{background:url("data:image/gif;base64,base64-data")}', |
3436 | 265 | )) | 265 | )) |
3438 | 266 | self.assertEquals( | 266 | self.assertEqual( |
3439 | 267 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 267 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3440 | 268 | "editor/assets/skins/sam/editor.css"], | 268 | "editor/assets/skins/sam/editor.css"], |
3441 | 269 | root=test_dir)).strip(), | 269 | root=test_dir)).strip(), |
3442 | @@ -306,7 +306,7 @@ | |||
3443 | 306 | " background: url(editor/assets/skins/sam/img/bg.png);", | 306 | " background: url(editor/assets/skins/sam/img/bg.png);", |
3444 | 307 | "}", | 307 | "}", |
3445 | 308 | )) | 308 | )) |
3447 | 309 | self.assertEquals( | 309 | self.assertEqual( |
3448 | 310 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 310 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3449 | 311 | "editor/assets/skins/sam/editor.css"], | 311 | "editor/assets/skins/sam/editor.css"], |
3450 | 312 | root=test_dir, minify_css=False)).strip(), | 312 | root=test_dir, minify_css=False)).strip(), |
3451 | @@ -344,7 +344,7 @@ | |||
3452 | 344 | "/* editor/assets/skins/sam/editor.css */", | 344 | "/* editor/assets/skins/sam/editor.css */", |
3453 | 345 | ".yui-editor{background:url(img/bg.png)}", | 345 | ".yui-editor{background:url(img/bg.png)}", |
3454 | 346 | )) | 346 | )) |
3456 | 347 | self.assertEquals( | 347 | self.assertEqual( |
3457 | 348 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 348 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3458 | 349 | "editor/assets/skins/sam/editor.css"], | 349 | "editor/assets/skins/sam/editor.css"], |
3459 | 350 | root=test_dir, rewrite_urls=False)).strip(), | 350 | root=test_dir, rewrite_urls=False)).strip(), |
3460 | @@ -388,7 +388,7 @@ | |||
3461 | 388 | ' background: url("img/bg.png");', | 388 | ' background: url("img/bg.png");', |
3462 | 389 | '}', | 389 | '}', |
3463 | 390 | )) | 390 | )) |
3465 | 391 | self.assertEquals( | 391 | self.assertEqual( |
3466 | 392 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 392 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3467 | 393 | "editor/assets/skins/sam/editor.css"], | 393 | "editor/assets/skins/sam/editor.css"], |
3468 | 394 | root=test_dir, | 394 | root=test_dir, |
3469 | @@ -431,7 +431,7 @@ | |||
3470 | 431 | ".yui-editor{background:url(" + | 431 | ".yui-editor{background:url(" + |
3471 | 432 | "/static/editor/assets/skins/sam/img/bg.png)}", | 432 | "/static/editor/assets/skins/sam/img/bg.png)}", |
3472 | 433 | )) | 433 | )) |
3474 | 434 | self.assertEquals( | 434 | self.assertEqual( |
3475 | 435 | "".join(combine_files(["widget/assets/skins/sam/widget.css", | 435 | "".join(combine_files(["widget/assets/skins/sam/widget.css", |
3476 | 436 | "editor/assets/skins/sam/editor.css"], | 436 | "editor/assets/skins/sam/editor.css"], |
3477 | 437 | root=test_dir, | 437 | root=test_dir, |
3478 | @@ -459,7 +459,7 @@ | |||
3479 | 459 | "// [missing]", | 459 | "// [missing]", |
3480 | 460 | "// event-custom/event-custom-min.js", | 460 | "// event-custom/event-custom-min.js", |
3481 | 461 | "** event-custom-min **")) | 461 | "** event-custom-min **")) |
3483 | 462 | self.assertEquals( | 462 | self.assertEqual( |
3484 | 463 | "".join(combine_files(["yui/yui-min.js", | 463 | "".join(combine_files(["yui/yui-min.js", |
3485 | 464 | "oop/oop-min.js", | 464 | "oop/oop-min.js", |
3486 | 465 | "event-custom/event-custom-min.js"], | 465 | "event-custom/event-custom-min.js"], |
3487 | @@ -482,7 +482,7 @@ | |||
3488 | 482 | 482 | ||
3489 | 483 | expected = "\n".join(("// ../../oop/oop-min.js", | 483 | expected = "\n".join(("// ../../oop/oop-min.js", |
3490 | 484 | "// [missing]")) | 484 | "// [missing]")) |
3492 | 485 | self.assertEquals( | 485 | self.assertEqual( |
3493 | 486 | "".join(combine_files([hack], root=root)).strip(), | 486 | "".join(combine_files([hack], root=root)).strip(), |
3494 | 487 | expected) | 487 | expected) |
3495 | 488 | 488 | ||
3496 | @@ -498,7 +498,7 @@ | |||
3497 | 498 | 498 | ||
3498 | 499 | expected = "\n".join(("/* yui/base/base.css */", | 499 | expected = "\n".join(("/* yui/base/base.css */", |
3499 | 500 | ".foo{background-image:url(img.png)}")) | 500 | ".foo{background-image:url(img.png)}")) |
3501 | 501 | self.assertEquals( | 501 | self.assertEqual( |
3502 | 502 | "".join(combine_files(files, root=test_dir)).strip(), | 502 | "".join(combine_files(files, root=test_dir)).strip(), |
3503 | 503 | expected) | 503 | expected) |
3504 | 504 | 504 | ||
3505 | @@ -510,7 +510,7 @@ | |||
3506 | 510 | self.assertTrue(os.path.exists("/etc/passwd")) | 510 | self.assertTrue(os.path.exists("/etc/passwd")) |
3507 | 511 | 511 | ||
3508 | 512 | expected = "" | 512 | expected = "" |
3510 | 513 | self.assertEquals( | 513 | self.assertEqual( |
3511 | 514 | "".join(combine_files([hack], root=test_dir)).strip(), | 514 | "".join(combine_files([hack], root=test_dir)).strip(), |
3512 | 515 | expected) | 515 | expected) |
3513 | 516 | 516 | ||
3514 | @@ -548,8 +548,8 @@ | |||
3515 | 548 | ["yui/yui-min.js", | 548 | ["yui/yui-min.js", |
3516 | 549 | "oop/oop-min.js", | 549 | "oop/oop-min.js", |
3517 | 550 | "event-custom/event-custom-min.js"]), status=200) | 550 | "event-custom/event-custom-min.js"]), status=200) |
3520 | 551 | self.assertEquals(res.headers, [("Content-Type", "text/javascript")]) | 551 | self.assertEqual(res.headers, [("Content-Type", "text/javascript")]) |
3521 | 552 | self.assertEquals(res.body.strip(), expected) | 552 | self.assertEqual(res.body.strip(), expected) |
3522 | 553 | 553 | ||
3523 | 554 | def test_combo_app_sets_content_type_for_css(self): | 554 | def test_combo_app_sets_content_type_for_css(self): |
3524 | 555 | """The WSGI App should set a proper Content-Type for CSS.""" | 555 | """The WSGI App should set a proper Content-Type for CSS.""" |
3525 | @@ -562,11 +562,11 @@ | |||
3526 | 562 | 562 | ||
3527 | 563 | res = self.app.get("/?" + "&".join( | 563 | res = self.app.get("/?" + "&".join( |
3528 | 564 | ["widget/skin/sam/widget.css"]), status=200) | 564 | ["widget/skin/sam/widget.css"]), status=200) |
3531 | 565 | self.assertEquals(res.headers, [("Content-Type", "text/css")]) | 565 | self.assertEqual(res.headers, [("Content-Type", "text/css")]) |
3532 | 566 | self.assertEquals(res.body.strip(), expected) | 566 | self.assertEqual(res.body.strip(), expected) |
3533 | 567 | 567 | ||
3534 | 568 | def test_no_filename_gives_404(self): | 568 | def test_no_filename_gives_404(self): |
3535 | 569 | """If no filename is included, a 404 should be returned.""" | 569 | """If no filename is included, a 404 should be returned.""" |
3536 | 570 | res = self.app.get("/", status=404) | 570 | res = self.app.get("/", status=404) |
3539 | 571 | self.assertEquals(res.headers, [("Content-Type", "text/plain")]) | 571 | self.assertEqual(res.headers, [("Content-Type", "text/plain")]) |
3540 | 572 | self.assertEquals(res.body, "Not Found") | 572 | self.assertEqual(res.body, "Not Found") |
3541 | 573 | 573 | ||
3542 | === modified file 'lib/lp/services/config/tests/test_config_lookup.py' | |||
3543 | --- lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 15:23:24 +0000 | |||
3544 | +++ lib/lp/services/config/tests/test_config_lookup.py 2018-01-02 16:24:23 +0000 | |||
3545 | @@ -113,7 +113,7 @@ | |||
3546 | 113 | 113 | ||
3547 | 114 | def test_find_config_dir(self): | 114 | def test_find_config_dir(self): |
3548 | 115 | instance_config_dir = self.setUpInstanceConfig('an_instance') | 115 | instance_config_dir = self.setUpInstanceConfig('an_instance') |
3550 | 116 | self.assertEquals( | 116 | self.assertEqual( |
3551 | 117 | instance_config_dir, config.find_config_dir('an_instance')) | 117 | instance_config_dir, config.find_config_dir('an_instance')) |
3552 | 118 | 118 | ||
3553 | 119 | def test_Config_uses_find_config_dir(self): | 119 | def test_Config_uses_find_config_dir(self): |
3554 | @@ -127,7 +127,7 @@ | |||
3555 | 127 | 127 | ||
3556 | 128 | # We don't care about ZConfig... | 128 | # We don't care about ZConfig... |
3557 | 129 | cfg._setZConfig = lambda: None | 129 | cfg._setZConfig = lambda: None |
3559 | 130 | self.assertEquals(2323, cfg.launchpad.default_batch_size) | 130 | self.assertEqual(2323, cfg.launchpad.default_batch_size) |
3560 | 131 | 131 | ||
3561 | 132 | 132 | ||
3562 | 133 | class TestGenerateOverrides(ConfigTestCase): | 133 | class TestGenerateOverrides(ConfigTestCase): |
3563 | 134 | 134 | ||
3564 | === modified file 'lib/lp/services/database/tests/test_storm.py' | |||
3565 | --- lib/lp/services/database/tests/test_storm.py 2014-01-30 15:04:06 +0000 | |||
3566 | +++ lib/lp/services/database/tests/test_storm.py 2018-01-02 16:24:23 +0000 | |||
3567 | @@ -13,6 +13,6 @@ | |||
3568 | 13 | class TestStorm(TestCase): | 13 | class TestStorm(TestCase): |
3569 | 14 | def test_has_cextensions(self): | 14 | def test_has_cextensions(self): |
3570 | 15 | """Ensure Storm C extensions are being used.""" | 15 | """Ensure Storm C extensions are being used.""" |
3572 | 16 | self.assert_( | 16 | self.assertTrue( |
3573 | 17 | storm.has_cextensions, | 17 | storm.has_cextensions, |
3574 | 18 | 'Storm not running with C extensions') | 18 | 'Storm not running with C extensions') |
3575 | 19 | 19 | ||
3576 | === modified file 'lib/lp/services/features/tests/test_flags.py' | |||
3577 | --- lib/lp/services/features/tests/test_flags.py 2014-02-26 00:25:03 +0000 | |||
3578 | +++ lib/lp/services/features/tests/test_flags.py 2018-01-02 16:24:23 +0000 | |||
3579 | @@ -188,7 +188,7 @@ | |||
3580 | 188 | # no scopes need to be checked because it's just not in the database | 188 | # no scopes need to be checked because it's just not in the database |
3581 | 189 | # and there's no point checking | 189 | # and there's no point checking |
3582 | 190 | self.assertEqual({}, f._known_scopes._known) | 190 | self.assertEqual({}, f._known_scopes._known) |
3584 | 191 | self.assertEquals([], call_log) | 191 | self.assertEqual([], call_log) |
3585 | 192 | # however, this we have now negative-cached the flag | 192 | # however, this we have now negative-cached the flag |
3586 | 193 | self.assertEqual(dict(unknown=None), f.usedFlags()) | 193 | self.assertEqual(dict(unknown=None), f.usedFlags()) |
3587 | 194 | self.assertEqual(dict(), f.usedScopes()) | 194 | self.assertEqual(dict(), f.usedScopes()) |
3588 | @@ -215,14 +215,14 @@ | |||
3589 | 215 | def test_getAllRulesAsTuples(self): | 215 | def test_getAllRulesAsTuples(self): |
3590 | 216 | source = self.makeSource() | 216 | source = self.makeSource() |
3591 | 217 | source.setAllRules(test_rules_list) | 217 | source.setAllRules(test_rules_list) |
3593 | 218 | self.assertEquals( | 218 | self.assertEqual( |
3594 | 219 | test_rules_list, | 219 | test_rules_list, |
3595 | 220 | list(source.getAllRulesAsTuples())) | 220 | list(source.getAllRulesAsTuples())) |
3596 | 221 | 221 | ||
3597 | 222 | def test_getAllRulesAsText(self): | 222 | def test_getAllRulesAsText(self): |
3598 | 223 | source = self.makeSource() | 223 | source = self.makeSource() |
3599 | 224 | source.setAllRules(test_rules_list) | 224 | source.setAllRules(test_rules_list) |
3601 | 225 | self.assertEquals( | 225 | self.assertEqual( |
3602 | 226 | """\ | 226 | """\ |
3603 | 227 | %s\tbeta_user\t100\t%s | 227 | %s\tbeta_user\t100\t%s |
3604 | 228 | ui.icing\tnormal_user\t500\t5.0 | 228 | ui.icing\tnormal_user\t500\t5.0 |
3605 | @@ -241,7 +241,7 @@ | |||
3606 | 241 | flag1 default 100 gamma with spaces | 241 | flag1 default 100 gamma with spaces |
3607 | 242 | flag2 default 0\ton | 242 | flag2 default 0\ton |
3608 | 243 | """) | 243 | """) |
3610 | 244 | self.assertEquals({ | 244 | self.assertEqual({ |
3611 | 245 | 'flag1': [ | 245 | 'flag1': [ |
3612 | 246 | ('beta_user', 200, 'alpha'), | 246 | ('beta_user', 200, 'alpha'), |
3613 | 247 | ('default', 100, 'gamma with spaces'), | 247 | ('default', 100, 'gamma with spaces'), |
3614 | 248 | 248 | ||
3615 | === modified file 'lib/lp/services/features/tests/test_scopes.py' | |||
3616 | --- lib/lp/services/features/tests/test_scopes.py 2012-01-01 02:58:52 +0000 | |||
3617 | +++ lib/lp/services/features/tests/test_scopes.py 2018-01-02 16:24:23 +0000 | |||
3618 | @@ -100,7 +100,7 @@ | |||
3619 | 100 | name = 'userslice:%d,%d' % (i, checks) | 100 | name = 'userslice:%d,%d' % (i, checks) |
3620 | 101 | if scope.lookup(name): | 101 | if scope.lookup(name): |
3621 | 102 | matches.append(name) | 102 | matches.append(name) |
3623 | 103 | self.assertEquals(len(matches), 1, matches) | 103 | self.assertEqual(len(matches), 1, matches) |
3624 | 104 | 104 | ||
3625 | 105 | 105 | ||
3626 | 106 | class TestUserSliceScopeIntegration(TestCaseWithFactory): | 106 | class TestUserSliceScopeIntegration(TestCaseWithFactory): |
3627 | @@ -123,5 +123,5 @@ | |||
3628 | 123 | value=u'not_value'), | 123 | value=u'not_value'), |
3629 | 124 | ]): | 124 | ]): |
3630 | 125 | with person_logged_in(person): | 125 | with person_logged_in(person): |
3633 | 126 | self.assertEquals(getFeatureFlag('test_feature'), 'on') | 126 | self.assertEqual(getFeatureFlag('test_feature'), 'on') |
3634 | 127 | self.assertEquals(getFeatureFlag('test_not'), None) | 127 | self.assertEqual(getFeatureFlag('test_not'), None) |
3635 | 128 | 128 | ||
3636 | === modified file 'lib/lp/services/features/tests/test_webapp.py' | |||
3637 | --- lib/lp/services/features/tests/test_webapp.py 2012-01-01 02:58:52 +0000 | |||
3638 | +++ lib/lp/services/features/tests/test_webapp.py 2018-01-02 16:24:23 +0000 | |||
3639 | @@ -114,7 +114,7 @@ | |||
3640 | 114 | with CaptureOops() as capture: | 114 | with CaptureOops() as capture: |
3641 | 115 | request = LaunchpadTestRequest() | 115 | request = LaunchpadTestRequest() |
3642 | 116 | 116 | ||
3644 | 117 | self.assertEquals(getFeatureFlag('feature_name'), 'value') | 117 | self.assertEqual(getFeatureFlag('feature_name'), 'value') |
3645 | 118 | 118 | ||
3646 | 119 | # Simulate an oops here. | 119 | # Simulate an oops here. |
3647 | 120 | globalErrorUtility.raising(None, request=request) | 120 | globalErrorUtility.raising(None, request=request) |
3648 | @@ -122,5 +122,5 @@ | |||
3649 | 122 | oops = capture.oopses[0] | 122 | oops = capture.oopses[0] |
3650 | 123 | self.assertTrue('features.usedScopes' in oops) | 123 | self.assertTrue('features.usedScopes' in oops) |
3651 | 124 | self.assertTrue('features.usedFlags' in oops) | 124 | self.assertTrue('features.usedFlags' in oops) |
3654 | 125 | self.assertEquals(oops['features.usedFlags'], | 125 | self.assertEqual( |
3655 | 126 | u"{'feature_name': u'value'}") | 126 | oops['features.usedFlags'], u"{'feature_name': u'value'}") |
3656 | 127 | 127 | ||
3657 | === modified file 'lib/lp/services/librarian/tests/test_libraryfilealias.py' | |||
3658 | --- lib/lp/services/librarian/tests/test_libraryfilealias.py 2012-01-01 02:58:52 +0000 | |||
3659 | +++ lib/lp/services/librarian/tests/test_libraryfilealias.py 2018-01-02 16:24:23 +0000 | |||
3660 | @@ -38,10 +38,10 @@ | |||
3661 | 38 | def test_file_is_closed_at_the_end_of_transaction(self): | 38 | def test_file_is_closed_at_the_end_of_transaction(self): |
3662 | 39 | """Non-DB instance state should be reset on transaction boundaries.""" | 39 | """Non-DB instance state should be reset on transaction boundaries.""" |
3663 | 40 | self.file_alias.open() | 40 | self.file_alias.open() |
3665 | 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)) |
3666 | 42 | # This should reset the file pointer. | 42 | # This should reset the file pointer. |
3667 | 43 | transaction.commit() | 43 | transaction.commit() |
3668 | 44 | # If the file pointer isn't reset, the next call to read() will return | 44 | # If the file pointer isn't reset, the next call to read() will return |
3669 | 45 | # the remaining content. If it's reset, the file will be auto-opened | 45 | # the remaining content. If it's reset, the file will be auto-opened |
3670 | 46 | # and its whole content will be returned. | 46 | # and its whole content will be returned. |
3672 | 47 | self.assertEquals(self.text_content, self.file_alias.read()) | 47 | self.assertEqual(self.text_content, self.file_alias.read()) |
3673 | 48 | 48 | ||
3674 | === modified file 'lib/lp/services/librarian/tests/test_smoketest.py' | |||
3675 | --- lib/lp/services/librarian/tests/test_smoketest.py 2015-10-14 15:22:01 +0000 | |||
3676 | +++ lib/lp/services/librarian/tests/test_smoketest.py 2018-01-02 16:24:23 +0000 | |||
3677 | @@ -78,7 +78,7 @@ | |||
3678 | 78 | # the main function will return 0 (which will be used as the processes | 78 | # the main function will return 0 (which will be used as the processes |
3679 | 79 | # exit code to signal success). | 79 | # exit code to signal success). |
3680 | 80 | with fake_urllib(GoodUrllib()): | 80 | with fake_urllib(GoodUrllib()): |
3682 | 81 | self.assertEquals( | 81 | self.assertEqual( |
3683 | 82 | do_smoketest(self.fake_librarian, self.fake_librarian, | 82 | do_smoketest(self.fake_librarian, self.fake_librarian, |
3684 | 83 | output=StringIO()), | 83 | output=StringIO()), |
3685 | 84 | 0) | 84 | 0) |
3686 | @@ -87,7 +87,7 @@ | |||
3687 | 87 | # If incorrect data is retrieved, the main function will return 1 | 87 | # If incorrect data is retrieved, the main function will return 1 |
3688 | 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). |
3689 | 89 | with fake_urllib(BadUrllib()): | 89 | with fake_urllib(BadUrllib()): |
3691 | 90 | self.assertEquals( | 90 | self.assertEqual( |
3692 | 91 | do_smoketest(self.fake_librarian, self.fake_librarian, | 91 | do_smoketest(self.fake_librarian, self.fake_librarian, |
3693 | 92 | output=StringIO()), | 92 | output=StringIO()), |
3694 | 93 | 1) | 93 | 1) |
3695 | @@ -97,7 +97,7 @@ | |||
3696 | 97 | # function will return 1 (which will be used as the processes exit | 97 | # function will return 1 (which will be used as the processes exit |
3697 | 98 | # code to signal an error). | 98 | # code to signal an error). |
3698 | 99 | with fake_urllib(ErrorUrllib()): | 99 | with fake_urllib(ErrorUrllib()): |
3700 | 100 | self.assertEquals( | 100 | self.assertEqual( |
3701 | 101 | do_smoketest(self.fake_librarian, self.fake_librarian, | 101 | do_smoketest(self.fake_librarian, self.fake_librarian, |
3702 | 102 | output=StringIO()), | 102 | output=StringIO()), |
3703 | 103 | 1) | 103 | 1) |
3704 | 104 | 104 | ||
3705 | === modified file 'lib/lp/services/librarianserver/tests/test_gc.py' | |||
3706 | --- lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 10:54:31 +0000 | |||
3707 | +++ lib/lp/services/librarianserver/tests/test_gc.py 2018-01-02 16:24:23 +0000 | |||
3708 | @@ -299,10 +299,10 @@ | |||
3709 | 299 | self.ztm.begin() | 299 | self.ztm.begin() |
3710 | 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. |
3711 | 301 | f1 = LibraryFileAlias.get(self.f1_id) | 301 | f1 = LibraryFileAlias.get(self.f1_id) |
3713 | 302 | self.assert_(f1.content is None) | 302 | self.assertIsNone(f1.content) |
3714 | 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. |
3715 | 304 | f2 = LibraryFileAlias.get(self.f2_id) | 304 | f2 = LibraryFileAlias.get(self.f2_id) |
3717 | 305 | self.assert_(f2.content is not None) | 305 | self.assertIsNotNone(f2.content) |
3718 | 306 | 306 | ||
3719 | 307 | def test_ignoreRecentlyExpiredAliases(self): | 307 | def test_ignoreRecentlyExpiredAliases(self): |
3720 | 308 | # LibraryFileAlias records that have expired recently are not | 308 | # LibraryFileAlias records that have expired recently are not |
3721 | @@ -323,10 +323,10 @@ | |||
3722 | 323 | # Make sure f1 is still there and has content. This ensures that | 323 | # Make sure f1 is still there and has content. This ensures that |
3723 | 324 | # our stay of execution is still working. | 324 | # our stay of execution is still working. |
3724 | 325 | f1 = LibraryFileAlias.get(self.f1_id) | 325 | f1 = LibraryFileAlias.get(self.f1_id) |
3726 | 326 | self.assert_(f1.content is not None) | 326 | self.assertIsNotNone(f1.content) |
3727 | 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. |
3728 | 328 | f2 = LibraryFileAlias.get(self.f2_id) | 328 | f2 = LibraryFileAlias.get(self.f2_id) |
3730 | 329 | self.assert_(f2.content is not None) | 329 | self.assertIsNotNone(f2.content) |
3731 | 330 | 330 | ||
3732 | 331 | def test_DeleteUnreferencedContent(self): | 331 | def test_DeleteUnreferencedContent(self): |
3733 | 332 | # Merge the duplicates. This creates an | 332 | # Merge the duplicates. This creates an |
3734 | @@ -677,13 +677,13 @@ | |||
3735 | 677 | librariangc.delete_unwanted_files(self.con) | 677 | librariangc.delete_unwanted_files(self.con) |
3736 | 678 | 678 | ||
3737 | 679 | # None of the rubbish we created has been touched. | 679 | # None of the rubbish we created has been touched. |
3745 | 680 | self.assert_(os.path.isdir(noisedir1_path)) | 680 | self.assertTrue(os.path.isdir(noisedir1_path)) |
3746 | 681 | self.assert_(os.path.isdir(noisedir2_path)) | 681 | self.assertTrue(os.path.isdir(noisedir2_path)) |
3747 | 682 | self.assert_(os.path.isdir(noisedir3_path)) | 682 | self.assertTrue(os.path.isdir(noisedir3_path)) |
3748 | 683 | self.assert_(os.path.exists(noisefile1_path)) | 683 | self.assertTrue(os.path.exists(noisefile1_path)) |
3749 | 684 | self.assert_(os.path.exists(noisefile2_path)) | 684 | self.assertTrue(os.path.exists(noisefile2_path)) |
3750 | 685 | self.assert_(os.path.exists(noisefile3_path)) | 685 | self.assertTrue(os.path.exists(noisefile3_path)) |
3751 | 686 | self.assert_(os.path.exists(migrated_path)) | 686 | self.assertTrue(os.path.exists(migrated_path)) |
3752 | 687 | finally: | 687 | finally: |
3753 | 688 | # We need to clean this up ourselves, as the standard librarian | 688 | # We need to clean this up ourselves, as the standard librarian |
3754 | 689 | # cleanup only removes files it knows where valid to avoid | 689 | # cleanup only removes files it knows where valid to avoid |
3755 | 690 | 690 | ||
3756 | === modified file 'lib/lp/services/librarianserver/tests/test_swift.py' | |||
3757 | --- lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 10:54:31 +0000 | |||
3758 | +++ lib/lp/services/librarianserver/tests/test_swift.py 2018-01-02 16:24:23 +0000 | |||
3759 | @@ -82,7 +82,7 @@ | |||
3760 | 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. |
3761 | 83 | for lfc in self.lfcs: | 83 | for lfc in self.lfcs: |
3762 | 84 | path = swift.filesystem_path(lfc.id) | 84 | path = swift.filesystem_path(lfc.id) |
3764 | 85 | self.assert_(os.path.exists(path)) | 85 | self.assertTrue(os.path.exists(path)) |
3765 | 86 | 86 | ||
3766 | 87 | # Copy all the files into Swift. | 87 | # Copy all the files into Swift. |
3767 | 88 | swift.to_swift(log, remove_func=None) | 88 | swift.to_swift(log, remove_func=None) |
3768 | @@ -90,7 +90,7 @@ | |||
3769 | 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. |
3770 | 91 | for lfc in self.lfcs: | 91 | for lfc in self.lfcs: |
3771 | 92 | path = swift.filesystem_path(lfc.id) | 92 | path = swift.filesystem_path(lfc.id) |
3773 | 93 | self.assert_(os.path.exists(path)) | 93 | self.assertTrue(os.path.exists(path)) |
3774 | 94 | 94 | ||
3775 | 95 | # Confirm all the files are also in Swift. | 95 | # Confirm all the files are also in Swift. |
3776 | 96 | swift_client = self.swift_fixture.connect() | 96 | swift_client = self.swift_fixture.connect() |
3777 | @@ -113,7 +113,7 @@ | |||
3778 | 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. |
3779 | 114 | for lfc in self.lfcs: | 114 | for lfc in self.lfcs: |
3780 | 115 | path = swift.filesystem_path(lfc.id) | 115 | path = swift.filesystem_path(lfc.id) |
3782 | 116 | self.assert_(os.path.exists(path)) | 116 | self.assertTrue(os.path.exists(path)) |
3783 | 117 | 117 | ||
3784 | 118 | # Copy all the files into Swift. | 118 | # Copy all the files into Swift. |
3785 | 119 | swift.to_swift(log, remove_func=swift.rename) | 119 | swift.to_swift(log, remove_func=swift.rename) |
3786 | @@ -121,7 +121,7 @@ | |||
3787 | 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. |
3788 | 122 | for lfc in self.lfcs: | 122 | for lfc in self.lfcs: |
3789 | 123 | path = swift.filesystem_path(lfc.id) + '.migrated' | 123 | path = swift.filesystem_path(lfc.id) + '.migrated' |
3791 | 124 | self.assert_(os.path.exists(path)) | 124 | self.assertTrue(os.path.exists(path)) |
3792 | 125 | 125 | ||
3793 | 126 | # Confirm all the files are also in Swift. | 126 | # Confirm all the files are also in Swift. |
3794 | 127 | swift_client = self.swift_fixture.connect() | 127 | swift_client = self.swift_fixture.connect() |
3795 | @@ -144,7 +144,7 @@ | |||
3796 | 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. |
3797 | 145 | for lfc in self.lfcs: | 145 | for lfc in self.lfcs: |
3798 | 146 | path = swift.filesystem_path(lfc.id) | 146 | path = swift.filesystem_path(lfc.id) |
3800 | 147 | self.assert_(os.path.exists(path)) | 147 | self.assertTrue(os.path.exists(path)) |
3801 | 148 | 148 | ||
3802 | 149 | # Migrate all the files into Swift. | 149 | # Migrate all the files into Swift. |
3803 | 150 | swift.to_swift(log, remove_func=os.unlink) | 150 | swift.to_swift(log, remove_func=os.unlink) |
3804 | @@ -200,7 +200,7 @@ | |||
3805 | 200 | # to be done in multiple chunks, but small enough that it is | 200 | # to be done in multiple chunks, but small enough that it is |
3806 | 201 | # stored in Swift as a single object. | 201 | # stored in Swift as a single object. |
3807 | 202 | size = LibrarianStorage.CHUNK_SIZE * 50 | 202 | size = LibrarianStorage.CHUNK_SIZE * 50 |
3809 | 203 | self.assert_(size > 1024 * 1024) | 203 | self.assertTrue(size > 1024 * 1024) |
3810 | 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)) |
3811 | 205 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) | 205 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) |
3812 | 206 | lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content | 206 | lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content |
3813 | @@ -222,7 +222,7 @@ | |||
3814 | 222 | # to be done in multiple chunks, but small enough that it is | 222 | # to be done in multiple chunks, but small enough that it is |
3815 | 223 | # stored in Swift as a single object. | 223 | # stored in Swift as a single object. |
3816 | 224 | size = LibrarianStorage.CHUNK_SIZE * 50 + 1 | 224 | size = LibrarianStorage.CHUNK_SIZE * 50 + 1 |
3818 | 225 | self.assert_(size > 1024 * 1024) | 225 | self.assertTrue(size > 1024 * 1024) |
3819 | 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)) |
3820 | 227 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) | 227 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) |
3821 | 228 | lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content | 228 | lfc = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id).content |
3822 | @@ -241,7 +241,7 @@ | |||
3823 | 241 | # Generate a blob large enough that Swift requires us to store | 241 | # Generate a blob large enough that Swift requires us to store |
3824 | 242 | # it as multiple objects plus a manifest. | 242 | # it as multiple objects plus a manifest. |
3825 | 243 | size = LibrarianStorage.CHUNK_SIZE * 50 | 243 | size = LibrarianStorage.CHUNK_SIZE * 50 |
3827 | 244 | self.assert_(size > 1024 * 1024) | 244 | self.assertTrue(size > 1024 * 1024) |
3828 | 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)) |
3829 | 246 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) | 246 | lfa_id = self.add_file('hello_bigboy.xls', expected_content) |
3830 | 247 | lfa = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id) | 247 | lfa = IStore(LibraryFileAlias).get(LibraryFileAlias, lfa_id) |
3831 | 248 | 248 | ||
3832 | === modified file 'lib/lp/services/mail/tests/test_sendmail.py' | |||
3833 | --- lib/lp/services/mail/tests/test_sendmail.py 2015-07-08 16:05:11 +0000 | |||
3834 | +++ lib/lp/services/mail/tests/test_sendmail.py 2018-01-02 16:24:23 +0000 | |||
3835 | @@ -270,8 +270,8 @@ | |||
3836 | 270 | 'from@example.com', to_addresses, | 270 | 'from@example.com', to_addresses, |
3837 | 271 | subject, 'body', {'key': 'value'}) | 271 | subject, 'body', {'key': 'value'}) |
3838 | 272 | ctrl.send() | 272 | ctrl.send() |
3841 | 273 | self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com') | 273 | self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com') |
3842 | 274 | self.assertEquals(fake_mailer.to_addr, to_addresses) | 274 | self.assertEqual(fake_mailer.to_addr, to_addresses) |
3843 | 275 | self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject) | 275 | self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject) |
3844 | 276 | 276 | ||
3845 | 277 | def test_sendmail_with_email_header(self): | 277 | def test_sendmail_with_email_header(self): |
3846 | @@ -290,16 +290,16 @@ | |||
3847 | 290 | message.add_header('To', 'dest@example.com') | 290 | message.add_header('To', 'dest@example.com') |
3848 | 291 | with CaptureTimeline() as ctl: | 291 | with CaptureTimeline() as ctl: |
3849 | 292 | sendmail.sendmail(message) | 292 | sendmail.sendmail(message) |
3852 | 293 | self.assertEquals(fake_mailer.from_addr, 'bounces@canonical.com') | 293 | self.assertEqual(fake_mailer.from_addr, 'bounces@canonical.com') |
3853 | 294 | self.assertEquals(fake_mailer.to_addr, ['dest@example.com']) | 294 | self.assertEqual(fake_mailer.to_addr, ['dest@example.com']) |
3854 | 295 | self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject_str) | 295 | self.checkTimelineHasOneMailAction(ctl.timeline, subject=subject_str) |
3855 | 296 | 296 | ||
3856 | 297 | def checkTimelineHasOneMailAction(self, timeline, subject): | 297 | def checkTimelineHasOneMailAction(self, timeline, subject): |
3857 | 298 | actions = timeline.actions | 298 | actions = timeline.actions |
3859 | 299 | self.assertEquals(len(actions), 1) | 299 | self.assertEqual(len(actions), 1) |
3860 | 300 | a0 = actions[0] | 300 | a0 = actions[0] |
3863 | 301 | self.assertEquals(a0.category, 'sendmail') | 301 | self.assertEqual(a0.category, 'sendmail') |
3864 | 302 | self.assertEquals(a0.detail, subject) | 302 | self.assertEqual(a0.detail, subject) |
3865 | 303 | self.assertIsInstance(a0.detail, basestring) | 303 | self.assertIsInstance(a0.detail, basestring) |
3866 | 304 | 304 | ||
3867 | 305 | 305 | ||
3868 | 306 | 306 | ||
3869 | === modified file 'lib/lp/services/oauth/tests/test_oauth.py' | |||
3870 | --- lib/lp/services/oauth/tests/test_oauth.py 2016-01-26 15:14:01 +0000 | |||
3871 | +++ lib/lp/services/oauth/tests/test_oauth.py 2018-01-02 16:24:23 +0000 | |||
3872 | @@ -33,7 +33,7 @@ | |||
3873 | 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. |
3874 | 34 | """ | 34 | """ |
3875 | 35 | zstorm = getUtility(IZStorm) | 35 | zstorm = getUtility(IZStorm) |
3877 | 36 | self.assertEquals( | 36 | self.assertEqual( |
3878 | 37 | '%s-%s' % (MAIN_STORE, MASTER_FLAVOR), | 37 | '%s-%s' % (MAIN_STORE, MASTER_FLAVOR), |
3879 | 38 | zstorm.get_name(self.class_._getStore())) | 38 | zstorm.get_name(self.class_._getStore())) |
3880 | 39 | 39 | ||
3881 | 40 | 40 | ||
3882 | === modified file 'lib/lp/services/oauth/tests/test_tokens.py' | |||
3883 | --- lib/lp/services/oauth/tests/test_tokens.py 2016-01-26 15:14:01 +0000 | |||
3884 | +++ lib/lp/services/oauth/tests/test_tokens.py 2018-01-02 16:24:23 +0000 | |||
3885 | @@ -95,10 +95,10 @@ | |||
3886 | 95 | 95 | ||
3887 | 96 | def test_getByKey(self): | 96 | def test_getByKey(self): |
3888 | 97 | token, _ = self.consumer.newRequestToken() | 97 | token, _ = self.consumer.newRequestToken() |
3890 | 98 | self.assertEquals(token, self.tokens.getByKey(token.key)) | 98 | self.assertEqual(token, self.tokens.getByKey(token.key)) |
3891 | 99 | 99 | ||
3892 | 100 | def test_getByKey_returns_none_for_unused_key(self): | 100 | def test_getByKey_returns_none_for_unused_key(self): |
3894 | 101 | self.assertEquals(None, self.tokens.getByKey(u"no-such-token")) | 101 | self.assertIsNone(self.tokens.getByKey(u"no-such-token")) |
3895 | 102 | 102 | ||
3896 | 103 | 103 | ||
3897 | 104 | class TestRequestTokens(TestOAuth): | 104 | class TestRequestTokens(TestOAuth): |
3898 | @@ -142,12 +142,10 @@ | |||
3899 | 142 | def test_getRequestToken_for_wrong_consumer_returns_none(self): | 142 | def test_getRequestToken_for_wrong_consumer_returns_none(self): |
3900 | 143 | token_1, _ = self.consumer.newRequestToken() | 143 | token_1, _ = self.consumer.newRequestToken() |
3901 | 144 | consumer_2 = self.factory.makeOAuthConsumer() | 144 | consumer_2 = self.factory.makeOAuthConsumer() |
3904 | 145 | self.assertEquals( | 145 | self.assertIsNone(consumer_2.getRequestToken(token_1.key)) |
3903 | 146 | None, consumer_2.getRequestToken(token_1.key)) | ||
3905 | 147 | 146 | ||
3906 | 148 | def test_getRequestToken_for_nonexistent_key_returns_none(self): | 147 | def test_getRequestToken_for_nonexistent_key_returns_none(self): |
3909 | 149 | self.assertEquals( | 148 | self.assertIsNone(self.consumer.getRequestToken(u"no-such-token")) |
3908 | 150 | None, self.consumer.getRequestToken(u"no-such-token")) | ||
3910 | 151 | 149 | ||
3911 | 152 | def test_isSecretValid(self): | 150 | def test_isSecretValid(self): |
3912 | 153 | token, secret = self.consumer.newRequestToken() | 151 | token, secret = self.consumer.newRequestToken() |
3913 | @@ -161,16 +159,16 @@ | |||
3914 | 161 | now = datetime.now(pytz.timezone('UTC')) | 159 | now = datetime.now(pytz.timezone('UTC')) |
3915 | 162 | 160 | ||
3916 | 163 | self.assertTrue(request_token.is_reviewed) | 161 | self.assertTrue(request_token.is_reviewed) |
3920 | 164 | self.assertEquals(request_token.person, self.person) | 162 | self.assertEqual(request_token.person, self.person) |
3921 | 165 | self.assertEquals(request_token.permission, | 163 | self.assertEqual(request_token.permission, |
3922 | 166 | OAuthPermission.WRITE_PUBLIC) | 164 | OAuthPermission.WRITE_PUBLIC) |
3923 | 167 | 165 | ||
3924 | 168 | self.assertTrue(request_token.date_created <= now) | 166 | self.assertTrue(request_token.date_created <= now) |
3925 | 169 | 167 | ||
3926 | 170 | # By default, reviewing a token does not set a context or | 168 | # By default, reviewing a token does not set a context or |
3927 | 171 | # expiration date. | 169 | # expiration date. |
3930 | 172 | self.assertEquals(request_token.context, None) | 170 | self.assertIsNone(request_token.context) |
3931 | 173 | self.assertEquals(request_token.date_expires, None) | 171 | self.assertIsNone(request_token.date_expires) |
3932 | 174 | 172 | ||
3933 | 175 | def test_token_review_as_unauthorized(self): | 173 | def test_token_review_as_unauthorized(self): |
3934 | 176 | request_token, _ = self.consumer.newRequestToken() | 174 | request_token, _ = self.consumer.newRequestToken() |
3935 | @@ -179,8 +177,8 @@ | |||
3936 | 179 | # This token has been reviewed, but it may not be used for any | 177 | # This token has been reviewed, but it may not be used for any |
3937 | 180 | # purpose. | 178 | # purpose. |
3938 | 181 | self.assertTrue(request_token.is_reviewed) | 179 | self.assertTrue(request_token.is_reviewed) |
3941 | 182 | self.assertEquals(request_token.permission, | 180 | self.assertEqual(request_token.permission, |
3942 | 183 | OAuthPermission.UNAUTHORIZED) | 181 | OAuthPermission.UNAUTHORIZED) |
3943 | 184 | 182 | ||
3944 | 185 | def test_review_with_expiration_date(self): | 183 | def test_review_with_expiration_date(self): |
3945 | 186 | # A request token may be associated with an expiration date | 184 | # A request token may be associated with an expiration date |
3946 | @@ -189,7 +187,7 @@ | |||
3947 | 189 | request_token.review( | 187 | request_token.review( |
3948 | 190 | self.person, OAuthPermission.WRITE_PUBLIC, | 188 | self.person, OAuthPermission.WRITE_PUBLIC, |
3949 | 191 | date_expires=self.in_a_while) | 189 | date_expires=self.in_a_while) |
3951 | 192 | self.assertEquals(request_token.date_expires, self.in_a_while) | 190 | self.assertEqual(request_token.date_expires, self.in_a_while) |
3952 | 193 | 191 | ||
3953 | 194 | def test_review_with_expiration_date_in_the_past(self): | 192 | def test_review_with_expiration_date_in_the_past(self): |
3954 | 195 | # The expiration date, like the permission and context, is | 193 | # The expiration date, like the permission and context, is |
3955 | @@ -203,7 +201,7 @@ | |||
3956 | 203 | request_token.review( | 201 | request_token.review( |
3957 | 204 | self.person, OAuthPermission.WRITE_PUBLIC, | 202 | self.person, OAuthPermission.WRITE_PUBLIC, |
3958 | 205 | date_expires=self.a_long_time_ago) | 203 | date_expires=self.a_long_time_ago) |
3960 | 206 | self.assertEquals(request_token.date_expires, self.a_long_time_ago) | 204 | self.assertEqual(request_token.date_expires, self.a_long_time_ago) |
3961 | 207 | self.assertFalse(request_token.is_expired) | 205 | self.assertFalse(request_token.is_expired) |
3962 | 208 | 206 | ||
3963 | 209 | def _reviewed_token_for_context(self, context_factory): | 207 | def _reviewed_token_for_context(self, context_factory): |
3964 | @@ -220,21 +218,21 @@ | |||
3965 | 220 | # product. | 218 | # product. |
3966 | 221 | token, name = self._reviewed_token_for_context( | 219 | token, name = self._reviewed_token_for_context( |
3967 | 222 | self.factory.makeProduct) | 220 | self.factory.makeProduct) |
3969 | 223 | self.assertEquals(token.context.name, name) | 221 | self.assertEqual(token.context.name, name) |
3970 | 224 | 222 | ||
3971 | 225 | def test_review_with_project_group_context(self): | 223 | def test_review_with_project_group_context(self): |
3972 | 226 | # When reviewing a request token, the context may be set to a | 224 | # When reviewing a request token, the context may be set to a |
3973 | 227 | # project group. | 225 | # project group. |
3974 | 228 | token, name = self._reviewed_token_for_context( | 226 | token, name = self._reviewed_token_for_context( |
3975 | 229 | self.factory.makeProject) | 227 | self.factory.makeProject) |
3977 | 230 | self.assertEquals(token.context.name, name) | 228 | self.assertEqual(token.context.name, name) |
3978 | 231 | 229 | ||
3979 | 232 | def test_review_with_distrosourcepackage_context(self): | 230 | def test_review_with_distrosourcepackage_context(self): |
3980 | 233 | # When reviewing a request token, the context may be set to a | 231 | # When reviewing a request token, the context may be set to a |
3981 | 234 | # distribution source package. | 232 | # distribution source package. |
3982 | 235 | token, name = self._reviewed_token_for_context( | 233 | token, name = self._reviewed_token_for_context( |
3983 | 236 | self.factory.makeDistributionSourcePackage) | 234 | self.factory.makeDistributionSourcePackage) |
3985 | 237 | self.assertEquals(token.context.name, name) | 235 | self.assertEqual(token.context.name, name) |
3986 | 238 | 236 | ||
3987 | 239 | def test_expired_request_token_cant_be_reviewed(self): | 237 | def test_expired_request_token_cant_be_reviewed(self): |
3988 | 240 | """An expired request token can't be reviewed.""" | 238 | """An expired request token can't be reviewed.""" |
3989 | @@ -247,21 +245,21 @@ | |||
3990 | 247 | def test_get_request_tokens_for_person(self): | 245 | def test_get_request_tokens_for_person(self): |
3991 | 248 | """It's possible to get a person's request tokens.""" | 246 | """It's possible to get a person's request tokens.""" |
3992 | 249 | person = self.factory.makePerson() | 247 | person = self.factory.makePerson() |
3994 | 250 | self.assertEquals(person.oauth_request_tokens.count(), 0) | 248 | self.assertEqual(person.oauth_request_tokens.count(), 0) |
3995 | 251 | for i in range(0, 3): | 249 | for i in range(0, 3): |
3996 | 252 | self.factory.makeOAuthRequestToken(reviewed_by=person) | 250 | self.factory.makeOAuthRequestToken(reviewed_by=person) |
3998 | 253 | self.assertEquals(person.oauth_request_tokens.count(), 3) | 251 | self.assertEqual(person.oauth_request_tokens.count(), 3) |
3999 | 254 | 252 | ||
4000 | 255 | def test_expired_request_token_disappears_from_list(self): | 253 | def test_expired_request_token_disappears_from_list(self): |
4001 | 256 | person = self.factory.makePerson() | 254 | person = self.factory.makePerson() |
4003 | 257 | self.assertEquals(person.oauth_request_tokens.count(), 0) | 255 | self.assertEqual(person.oauth_request_tokens.count(), 0) |
4004 | 258 | request_token = self.factory.makeOAuthRequestToken(reviewed_by=person) | 256 | request_token = self.factory.makeOAuthRequestToken(reviewed_by=person) |
4006 | 259 | self.assertEquals(person.oauth_request_tokens.count(), 1) | 257 | self.assertEqual(person.oauth_request_tokens.count(), 1) |
4007 | 260 | 258 | ||
4008 | 261 | login_person(person) | 259 | login_person(person) |
4009 | 262 | request_token.date_expires = self.a_long_time_ago | 260 | request_token.date_expires = self.a_long_time_ago |
4010 | 263 | 261 | ||
4012 | 264 | self.assertEquals(person.oauth_request_tokens.count(), 0) | 262 | self.assertEqual(person.oauth_request_tokens.count(), 0) |
4013 | 265 | 263 | ||
4014 | 266 | 264 | ||
4015 | 267 | class TestAccessTokens(TestOAuth): | 265 | class TestAccessTokens(TestOAuth): |
4016 | @@ -292,18 +290,17 @@ | |||
4017 | 292 | request_token, access_token, _ = ( | 290 | request_token, access_token, _ = ( |
4018 | 293 | self._exchange_request_token_for_access_token()) | 291 | self._exchange_request_token_for_access_token()) |
4019 | 294 | 292 | ||
4021 | 295 | self.assertEquals(request_token.consumer, access_token.consumer) | 293 | self.assertEqual(request_token.consumer, access_token.consumer) |
4022 | 296 | 294 | ||
4023 | 297 | # An access token inherits its permission from the request | 295 | # An access token inherits its permission from the request |
4024 | 298 | # token that created it. But an access token's .permission is | 296 | # token that created it. But an access token's .permission is |
4025 | 299 | # an AccessLevel object, not an OAuthPermission. The only real | 297 | # an AccessLevel object, not an OAuthPermission. The only real |
4026 | 300 | # difference is that there's no AccessLevel corresponding to | 298 | # difference is that there's no AccessLevel corresponding to |
4027 | 301 | # OAuthPermission.UNAUTHORIZED. | 299 | # OAuthPermission.UNAUTHORIZED. |
4030 | 302 | self.assertEquals( | 300 | self.assertEqual(access_token.permission, AccessLevel.WRITE_PRIVATE) |
4029 | 303 | access_token.permission, AccessLevel.WRITE_PRIVATE) | ||
4031 | 304 | 301 | ||
4034 | 305 | self.assertEquals(None, access_token.context) | 302 | self.assertIsNone(access_token.context) |
4035 | 306 | self.assertEquals(None, access_token.date_expires) | 303 | self.assertIsNone(access_token.date_expires) |
4036 | 307 | 304 | ||
4037 | 308 | def test_access_token_field_inheritance(self): | 305 | def test_access_token_field_inheritance(self): |
4038 | 309 | # Make sure that specific fields like context and expiration | 306 | # Make sure that specific fields like context and expiration |
4039 | @@ -314,15 +311,13 @@ | |||
4040 | 314 | self.person, OAuthPermission.WRITE_PRIVATE, | 311 | self.person, OAuthPermission.WRITE_PRIVATE, |
4041 | 315 | context=context, date_expires=self.in_a_while) | 312 | context=context, date_expires=self.in_a_while) |
4042 | 316 | access_token, _ = request_token.createAccessToken() | 313 | access_token, _ = request_token.createAccessToken() |
4046 | 317 | self.assertEquals(request_token.context, access_token.context) | 314 | self.assertEqual(request_token.context, access_token.context) |
4047 | 318 | self.assertEquals( | 315 | self.assertEqual(request_token.date_expires, access_token.date_expires) |
4045 | 319 | request_token.date_expires, access_token.date_expires) | ||
4048 | 320 | 316 | ||
4049 | 321 | def test_request_token_disappears_when_exchanged(self): | 317 | def test_request_token_disappears_when_exchanged(self): |
4050 | 322 | request_token, access_token, _ = ( | 318 | request_token, access_token, _ = ( |
4051 | 323 | self._exchange_request_token_for_access_token()) | 319 | self._exchange_request_token_for_access_token()) |
4054 | 324 | self.assertEquals( | 320 | self.assertIsNone(self.consumer.getRequestToken(request_token.key)) |
4053 | 325 | None, self.consumer.getRequestToken(request_token.key)) | ||
4055 | 326 | 321 | ||
4056 | 327 | def test_cant_exchange_unreviewed_request_token(self): | 322 | def test_cant_exchange_unreviewed_request_token(self): |
4057 | 328 | # An unreviewed request token cannot be exchanged for an access token. | 323 | # An unreviewed request token cannot be exchanged for an access token. |
4058 | @@ -367,21 +362,21 @@ | |||
4059 | 367 | def test_get_access_tokens_for_person(self): | 362 | def test_get_access_tokens_for_person(self): |
4060 | 368 | """It's possible to get a person's access tokens.""" | 363 | """It's possible to get a person's access tokens.""" |
4061 | 369 | person = self.factory.makePerson() | 364 | person = self.factory.makePerson() |
4063 | 370 | self.assertEquals(person.oauth_access_tokens.count(), 0) | 365 | self.assertEqual(person.oauth_access_tokens.count(), 0) |
4064 | 371 | for i in range(0, 3): | 366 | for i in range(0, 3): |
4065 | 372 | self.factory.makeOAuthAccessToken(self.consumer, person) | 367 | self.factory.makeOAuthAccessToken(self.consumer, person) |
4067 | 373 | self.assertEquals(person.oauth_access_tokens.count(), 3) | 368 | self.assertEqual(person.oauth_access_tokens.count(), 3) |
4068 | 374 | 369 | ||
4069 | 375 | def test_expired_access_token_disappears_from_list(self): | 370 | def test_expired_access_token_disappears_from_list(self): |
4070 | 376 | person = self.factory.makePerson() | 371 | person = self.factory.makePerson() |
4072 | 377 | self.assertEquals(person.oauth_access_tokens.count(), 0) | 372 | self.assertEqual(person.oauth_access_tokens.count(), 0) |
4073 | 378 | access_token, _ = self.factory.makeOAuthAccessToken( | 373 | access_token, _ = self.factory.makeOAuthAccessToken( |
4074 | 379 | self.consumer, person) | 374 | self.consumer, person) |
4076 | 380 | self.assertEquals(person.oauth_access_tokens.count(), 1) | 375 | self.assertEqual(person.oauth_access_tokens.count(), 1) |
4077 | 381 | 376 | ||
4078 | 382 | login_person(access_token.person) | 377 | login_person(access_token.person) |
4079 | 383 | access_token.date_expires = self.a_long_time_ago | 378 | access_token.date_expires = self.a_long_time_ago |
4081 | 384 | self.assertEquals(person.oauth_access_tokens.count(), 0) | 379 | self.assertEqual(person.oauth_access_tokens.count(), 0) |
4082 | 385 | 380 | ||
4083 | 386 | 381 | ||
4084 | 387 | class TestHelperFunctions(TestOAuth): | 382 | class TestHelperFunctions(TestOAuth): |
4085 | @@ -394,11 +389,11 @@ | |||
4086 | 394 | # If there's no token for user/consumer key/permission/context, | 389 | # If there's no token for user/consumer key/permission/context, |
4087 | 395 | # one is created. | 390 | # one is created. |
4088 | 396 | person = self.factory.makePerson() | 391 | person = self.factory.makePerson() |
4090 | 397 | self.assertEquals(person.oauth_access_tokens.count(), 0) | 392 | self.assertEqual(person.oauth_access_tokens.count(), 0) |
4091 | 398 | oauth_access_token_for( | 393 | oauth_access_token_for( |
4092 | 399 | self.consumer.key, person, OAuthPermission.WRITE_PUBLIC, | 394 | self.consumer.key, person, OAuthPermission.WRITE_PUBLIC, |
4093 | 400 | self.context) | 395 | self.context) |
4095 | 401 | self.assertEquals(person.oauth_access_tokens.count(), 1) | 396 | self.assertEqual(person.oauth_access_tokens.count(), 1) |
4096 | 402 | 397 | ||
4097 | 403 | def test_oauth_access_token_string_permission(self): | 398 | def test_oauth_access_token_string_permission(self): |
4098 | 404 | """You can pass in a string instead of an OAuthPermission.""" | 399 | """You can pass in a string instead of an OAuthPermission.""" |
4099 | 405 | 400 | ||
4100 | === modified file 'lib/lp/services/openid/tests/test_baseopenidstore.py' | |||
4101 | --- lib/lp/services/openid/tests/test_baseopenidstore.py 2013-06-20 05:50:00 +0000 | |||
4102 | +++ lib/lp/services/openid/tests/test_baseopenidstore.py 2018-01-02 16:24:23 +0000 | |||
4103 | @@ -29,12 +29,12 @@ | |||
4104 | 29 | 'handle', 'secret', 42, 600, 'HMAC-SHA1')) | 29 | 'handle', 'secret', 42, 600, 'HMAC-SHA1')) |
4105 | 30 | db_assoc = IMasterStore(self.store.Association).get( | 30 | db_assoc = IMasterStore(self.store.Association).get( |
4106 | 31 | self.store.Association, (u'server-url\xA9', u'handle')) | 31 | self.store.Association, (u'server-url\xA9', u'handle')) |
4113 | 32 | self.assertEquals(db_assoc.server_url, u'server-url\xA9') | 32 | self.assertEqual(db_assoc.server_url, u'server-url\xA9') |
4114 | 33 | self.assertEquals(db_assoc.handle, u'handle') | 33 | self.assertEqual(db_assoc.handle, u'handle') |
4115 | 34 | self.assertEquals(db_assoc.secret, 'secret') | 34 | self.assertEqual(db_assoc.secret, 'secret') |
4116 | 35 | self.assertEquals(db_assoc.issued, 42) | 35 | self.assertEqual(db_assoc.issued, 42) |
4117 | 36 | self.assertEquals(db_assoc.lifetime, 600) | 36 | self.assertEqual(db_assoc.lifetime, 600) |
4118 | 37 | self.assertEquals(db_assoc.assoc_type, u'HMAC-SHA1') | 37 | self.assertEqual(db_assoc.assoc_type, u'HMAC-SHA1') |
4119 | 38 | 38 | ||
4120 | 39 | def test_storeAssociation_update_existing(self): | 39 | def test_storeAssociation_update_existing(self): |
4121 | 40 | self.store.storeAssociation('server-url', Association( | 40 | self.store.storeAssociation('server-url', Association( |
4122 | @@ -58,15 +58,15 @@ | |||
4123 | 58 | 58 | ||
4124 | 59 | assoc = self.store.getAssociation('server-url', 'handle') | 59 | assoc = self.store.getAssociation('server-url', 'handle') |
4125 | 60 | self.assertIsInstance(assoc, Association) | 60 | self.assertIsInstance(assoc, Association) |
4131 | 61 | self.assertEquals(assoc.handle, 'handle') | 61 | self.assertEqual(assoc.handle, 'handle') |
4132 | 62 | self.assertEquals(assoc.secret, 'secret') | 62 | self.assertEqual(assoc.secret, 'secret') |
4133 | 63 | self.assertEquals(assoc.issued, timestamp) | 63 | self.assertEqual(assoc.issued, timestamp) |
4134 | 64 | self.assertEquals(assoc.lifetime, 600) | 64 | self.assertEqual(assoc.lifetime, 600) |
4135 | 65 | self.assertEquals(assoc.assoc_type, 'HMAC-SHA1') | 65 | self.assertEqual(assoc.assoc_type, 'HMAC-SHA1') |
4136 | 66 | 66 | ||
4137 | 67 | def test_getAssociation_unknown(self): | 67 | def test_getAssociation_unknown(self): |
4138 | 68 | assoc = self.store.getAssociation('server-url', 'unknown') | 68 | assoc = self.store.getAssociation('server-url', 'unknown') |
4140 | 69 | self.assertEquals(assoc, None) | 69 | self.assertEqual(assoc, None) |
4141 | 70 | 70 | ||
4142 | 71 | def test_getAssociation_expired(self): | 71 | def test_getAssociation_expired(self): |
4143 | 72 | lifetime = 600 | 72 | lifetime = 600 |
4144 | @@ -76,7 +76,7 @@ | |||
4145 | 76 | # The association is not returned because it is out of date. | 76 | # The association is not returned because it is out of date. |
4146 | 77 | # Further more, it is removed from the database. | 77 | # Further more, it is removed from the database. |
4147 | 78 | assoc = self.store.getAssociation('server-url', 'handle') | 78 | assoc = self.store.getAssociation('server-url', 'handle') |
4149 | 79 | self.assertEquals(assoc, None) | 79 | self.assertEqual(assoc, None) |
4150 | 80 | 80 | ||
4151 | 81 | store = IMasterStore(self.store.Association) | 81 | store = IMasterStore(self.store.Association) |
4152 | 82 | db_assoc = store.get( | 82 | db_assoc = store.get( |
4153 | @@ -99,13 +99,13 @@ | |||
4154 | 99 | timestamp = int(time.time()) | 99 | timestamp = int(time.time()) |
4155 | 100 | self.store.storeAssociation('server-url', Association( | 100 | self.store.storeAssociation('server-url', Association( |
4156 | 101 | 'handle', 'secret', timestamp, 600, 'HMAC-SHA1')) | 101 | 'handle', 'secret', timestamp, 600, 'HMAC-SHA1')) |
4158 | 102 | self.assertEquals( | 102 | self.assertEqual( |
4159 | 103 | self.store.removeAssociation('server-url', 'handle'), True) | 103 | self.store.removeAssociation('server-url', 'handle'), True) |
4161 | 104 | self.assertEquals( | 104 | self.assertEqual( |
4162 | 105 | self.store.getAssociation('server-url', 'handle'), None) | 105 | self.store.getAssociation('server-url', 'handle'), None) |
4163 | 106 | 106 | ||
4164 | 107 | def test_removeAssociation_unknown(self): | 107 | def test_removeAssociation_unknown(self): |
4166 | 108 | self.assertEquals( | 108 | self.assertEqual( |
4167 | 109 | self.store.removeAssociation('server-url', 'unknown'), | 109 | self.store.removeAssociation('server-url', 'unknown'), |
4168 | 110 | False) | 110 | False) |
4169 | 111 | 111 | ||
4170 | @@ -141,7 +141,7 @@ | |||
4171 | 141 | self.store.storeAssociation('server-url', Association( | 141 | self.store.storeAssociation('server-url', Association( |
4172 | 142 | 'handle2', 'secret', timestamp, 200, 'HMAC-SHA1')) | 142 | 'handle2', 'secret', timestamp, 200, 'HMAC-SHA1')) |
4173 | 143 | 143 | ||
4175 | 144 | self.assertEquals(self.store.cleanupAssociations(), 1) | 144 | self.assertEqual(self.store.cleanupAssociations(), 1) |
4176 | 145 | 145 | ||
4177 | 146 | # The second (non-expired) association is left behind. | 146 | # The second (non-expired) association is left behind. |
4178 | 147 | self.assertNotEqual( | 147 | self.assertNotEqual( |
4179 | 148 | 148 | ||
4180 | === modified file 'lib/lp/services/profile/tests.py' | |||
4181 | --- lib/lp/services/profile/tests.py 2013-04-10 09:12:32 +0000 | |||
4182 | +++ lib/lp/services/profile/tests.py 2018-01-02 16:24:23 +0000 | |||
4183 | @@ -209,7 +209,7 @@ | |||
4184 | 209 | self.pushProfilingConfig(profiling_allowed='True') | 209 | self.pushProfilingConfig(profiling_allowed='True') |
4185 | 210 | profile.start_request(self._get_start_event('/++profile++show/')) | 210 | profile.start_request(self._get_start_event('/++profile++show/')) |
4186 | 211 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 211 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4188 | 212 | self.assertEquals(set(profile._profilers.actions), set(('show', ))) | 212 | self.assertEqual(set(profile._profilers.actions), set(('show', ))) |
4189 | 213 | 213 | ||
4190 | 214 | def test_optional_profiling_with_callgrind_request_starts_profiling(self): | 214 | def test_optional_profiling_with_callgrind_request_starts_profiling(self): |
4191 | 215 | # If profiling is allowed and a request with the "callgrind" marker | 215 | # If profiling is allowed and a request with the "callgrind" marker |
4192 | @@ -217,7 +217,7 @@ | |||
4193 | 217 | self.pushProfilingConfig(profiling_allowed='True') | 217 | self.pushProfilingConfig(profiling_allowed='True') |
4194 | 218 | profile.start_request(self._get_start_event('/++profile++callgrind/')) | 218 | profile.start_request(self._get_start_event('/++profile++callgrind/')) |
4195 | 219 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 219 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4197 | 220 | self.assertEquals( | 220 | self.assertEqual( |
4198 | 221 | set(profile._profilers.actions), set(('callgrind', ))) | 221 | set(profile._profilers.actions), set(('callgrind', ))) |
4199 | 222 | 222 | ||
4200 | 223 | def test_optional_profiling_with_log_request_starts_profiling(self): | 223 | def test_optional_profiling_with_log_request_starts_profiling(self): |
4201 | @@ -226,7 +226,7 @@ | |||
4202 | 226 | self.pushProfilingConfig(profiling_allowed='True') | 226 | self.pushProfilingConfig(profiling_allowed='True') |
4203 | 227 | profile.start_request(self._get_start_event('/++profile++log/')) | 227 | profile.start_request(self._get_start_event('/++profile++log/')) |
4204 | 228 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 228 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4206 | 229 | self.assertEquals( | 229 | self.assertEqual( |
4207 | 230 | set(profile._profilers.actions), set(('callgrind', ))) | 230 | set(profile._profilers.actions), set(('callgrind', ))) |
4208 | 231 | 231 | ||
4209 | 232 | def test_optional_profiling_with_combined_request_starts_profiling(self): | 232 | def test_optional_profiling_with_combined_request_starts_profiling(self): |
4210 | @@ -236,7 +236,7 @@ | |||
4211 | 236 | profile.start_request( | 236 | profile.start_request( |
4212 | 237 | self._get_start_event('/++profile++callgrind&show/')) | 237 | self._get_start_event('/++profile++callgrind&show/')) |
4213 | 238 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 238 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4215 | 239 | self.assertEquals( | 239 | self.assertEqual( |
4216 | 240 | set(profile._profilers.actions), set(('callgrind', 'show'))) | 240 | set(profile._profilers.actions), set(('callgrind', 'show'))) |
4217 | 241 | 241 | ||
4218 | 242 | def test_optional_profiling_with_reversed_request_starts_profiling(self): | 242 | def test_optional_profiling_with_reversed_request_starts_profiling(self): |
4219 | @@ -249,7 +249,7 @@ | |||
4220 | 249 | profile.start_request( | 249 | profile.start_request( |
4221 | 250 | self._get_start_event('/++profile++show&callgrind')) | 250 | self._get_start_event('/++profile++show&callgrind')) |
4222 | 251 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 251 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4224 | 252 | self.assertEquals( | 252 | self.assertEqual( |
4225 | 253 | set(profile._profilers.actions), set(('callgrind', 'show'))) | 253 | set(profile._profilers.actions), set(('callgrind', 'show'))) |
4226 | 254 | 254 | ||
4227 | 255 | def test_optional_profiling_with_pstats_request_starts_profiling(self): | 255 | def test_optional_profiling_with_pstats_request_starts_profiling(self): |
4228 | @@ -260,7 +260,7 @@ | |||
4229 | 260 | self._get_start_event('/++profile++pstats/')) | 260 | self._get_start_event('/++profile++pstats/')) |
4230 | 261 | self.assertIsInstance(profile._profilers.profiler, | 261 | self.assertIsInstance(profile._profilers.profiler, |
4231 | 262 | profile.Profiler) | 262 | profile.Profiler) |
4233 | 263 | self.assertEquals(set(profile._profilers.actions), set(('pstats',))) | 263 | self.assertEqual(set(profile._profilers.actions), set(('pstats',))) |
4234 | 264 | 264 | ||
4235 | 265 | def test_optional_profiling_with_log_pstats(self): | 265 | def test_optional_profiling_with_log_pstats(self): |
4236 | 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" |
4237 | @@ -270,7 +270,7 @@ | |||
4238 | 270 | profile.start_request( | 270 | profile.start_request( |
4239 | 271 | self._get_start_event('/++profile++log&pstats/')) | 271 | self._get_start_event('/++profile++log&pstats/')) |
4240 | 272 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 272 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4242 | 273 | self.assertEquals( | 273 | self.assertEqual( |
4243 | 274 | set(profile._profilers.actions), set(('callgrind', 'pstats',))) | 274 | set(profile._profilers.actions), set(('callgrind', 'pstats',))) |
4244 | 275 | 275 | ||
4245 | 276 | def test_optional_profiling_with_callgrind_pstats(self): | 276 | def test_optional_profiling_with_callgrind_pstats(self): |
4246 | @@ -282,7 +282,7 @@ | |||
4247 | 282 | self._get_start_event('/++profile++pstats&callgrind/')) | 282 | self._get_start_event('/++profile++pstats&callgrind/')) |
4248 | 283 | self.assertIsInstance(profile._profilers.profiler, | 283 | self.assertIsInstance(profile._profilers.profiler, |
4249 | 284 | profile.Profiler) | 284 | profile.Profiler) |
4251 | 285 | self.assertEquals( | 285 | self.assertEqual( |
4252 | 286 | set(profile._profilers.actions), set(('pstats', 'callgrind'))) | 286 | set(profile._profilers.actions), set(('pstats', 'callgrind'))) |
4253 | 287 | 287 | ||
4254 | 288 | def test_forced_profiling_registers_action(self): | 288 | def test_forced_profiling_registers_action(self): |
4255 | @@ -291,7 +291,7 @@ | |||
4256 | 291 | profiling_allowed='True', profile_all_requests='True') | 291 | profiling_allowed='True', profile_all_requests='True') |
4257 | 292 | profile.start_request(self._get_start_event('/')) | 292 | profile.start_request(self._get_start_event('/')) |
4258 | 293 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 293 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4260 | 294 | self.assertEquals( | 294 | self.assertEqual( |
4261 | 295 | set(profile._profilers.actions), set(('callgrind', ))) | 295 | set(profile._profilers.actions), set(('callgrind', ))) |
4262 | 296 | 296 | ||
4263 | 297 | def test_optional_profiling_with_wrong_request_helps(self): | 297 | def test_optional_profiling_with_wrong_request_helps(self): |
4264 | @@ -300,7 +300,7 @@ | |||
4265 | 300 | self.pushProfilingConfig(profiling_allowed='True') | 300 | self.pushProfilingConfig(profiling_allowed='True') |
4266 | 301 | profile.start_request(self._get_start_event('/++profile++/')) | 301 | profile.start_request(self._get_start_event('/++profile++/')) |
4267 | 302 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) | 302 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) |
4269 | 303 | self.assertEquals(set(profile._profilers.actions), set(('help', ))) | 303 | self.assertEqual(set(profile._profilers.actions), set(('help', ))) |
4270 | 304 | 304 | ||
4271 | 305 | def test_forced_profiling_with_wrong_request_helps(self): | 305 | def test_forced_profiling_with_wrong_request_helps(self): |
4272 | 306 | # If profiling is forced and a request with the marker URL segment | 306 | # If profiling is forced and a request with the marker URL segment |
4273 | @@ -309,7 +309,7 @@ | |||
4274 | 309 | profiling_allowed='True', profile_all_requests='True') | 309 | profiling_allowed='True', profile_all_requests='True') |
4275 | 310 | profile.start_request(self._get_start_event('/++profile++/')) | 310 | profile.start_request(self._get_start_event('/++profile++/')) |
4276 | 311 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) | 311 | self.assertIsInstance(profile._profilers.profiler, profile.Profiler) |
4278 | 312 | self.assertEquals( | 312 | self.assertEqual( |
4279 | 313 | set(profile._profilers.actions), set(('help', 'callgrind'))) | 313 | set(profile._profilers.actions), set(('help', 'callgrind'))) |
4280 | 314 | 314 | ||
4281 | 315 | def test_memory_profile_start(self): | 315 | def test_memory_profile_start(self): |
4282 | @@ -336,14 +336,14 @@ | |||
4283 | 336 | self.pushProfilingConfig(profiling_allowed='True') | 336 | self.pushProfilingConfig(profiling_allowed='True') |
4284 | 337 | profile.start_request(self._get_start_event('/++profile++sqltrace/')) | 337 | profile.start_request(self._get_start_event('/++profile++sqltrace/')) |
4285 | 338 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) | 338 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) |
4287 | 339 | self.assertEquals(profile._profilers.actions, dict(sql=True)) | 339 | self.assertEqual(profile._profilers.actions, dict(sql=True)) |
4288 | 340 | self.assertEqual([], da.stop_sql_logging()) | 340 | self.assertEqual([], da.stop_sql_logging()) |
4289 | 341 | 341 | ||
4290 | 342 | def test_sql_start(self): | 342 | def test_sql_start(self): |
4291 | 343 | self.pushProfilingConfig(profiling_allowed='True') | 343 | self.pushProfilingConfig(profiling_allowed='True') |
4292 | 344 | profile.start_request(self._get_start_event('/++profile++sql/')) | 344 | profile.start_request(self._get_start_event('/++profile++sql/')) |
4293 | 345 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) | 345 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) |
4295 | 346 | self.assertEquals(profile._profilers.actions, dict(sql=False)) | 346 | self.assertEqual(profile._profilers.actions, dict(sql=False)) |
4296 | 347 | self.assertEqual([], da.stop_sql_logging()) | 347 | self.assertEqual([], da.stop_sql_logging()) |
4297 | 348 | 348 | ||
4298 | 349 | def test_sqltrace_filtered_start(self): | 349 | def test_sqltrace_filtered_start(self): |
4299 | @@ -351,7 +351,7 @@ | |||
4300 | 351 | profile.start_request(self._get_start_event( | 351 | profile.start_request(self._get_start_event( |
4301 | 352 | '/++profile++sqltrace:includes bugsubscription/')) | 352 | '/++profile++sqltrace:includes bugsubscription/')) |
4302 | 353 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) | 353 | self.assertIs(getattr(profile._profilers, 'profiler', None), None) |
4304 | 354 | self.assertEquals(set(profile._profilers.actions), set(('sql', ))) | 354 | self.assertEqual(set(profile._profilers.actions), set(('sql', ))) |
4305 | 355 | data = profile._profilers.actions['sql'] | 355 | data = profile._profilers.actions['sql'] |
4306 | 356 | self.assertTrue(data['condition']('SELECT BUGSUBSCRIPTION FROM FOO')) | 356 | self.assertTrue(data['condition']('SELECT BUGSUBSCRIPTION FROM FOO')) |
4307 | 357 | self.assertEqual([], da.stop_sql_logging()) | 357 | self.assertEqual([], da.stop_sql_logging()) |
4308 | @@ -665,7 +665,7 @@ | |||
4309 | 665 | self.pushProfilingConfig(profiling_allowed='True') | 665 | self.pushProfilingConfig(profiling_allowed='True') |
4310 | 666 | request = self.endRequest('/++profile++show/no-such-file', | 666 | request = self.endRequest('/++profile++show/no-such-file', |
4311 | 667 | KeyError('foo')) | 667 | KeyError('foo')) |
4313 | 668 | self.assertEquals(request.oops['type'], 'KeyError') | 668 | self.assertEqual(request.oops['type'], 'KeyError') |
4314 | 669 | response = self.getAddedResponse(request) | 669 | response = self.getAddedResponse(request) |
4315 | 670 | self.assertIn('Exception-Type: KeyError', response) | 670 | self.assertIn('Exception-Type: KeyError', response) |
4316 | 671 | self.assertCleanProfilerState() | 671 | self.assertCleanProfilerState() |
4317 | @@ -696,7 +696,7 @@ | |||
4318 | 696 | self.assertTrue(profile._profilers.profiling) | 696 | self.assertTrue(profile._profilers.profiling) |
4319 | 697 | self.assertIsInstance( | 697 | self.assertIsInstance( |
4320 | 698 | profile._profilers.profiler, profile.Profiler) | 698 | profile._profilers.profiler, profile.Profiler) |
4322 | 699 | self.assertEquals( | 699 | self.assertEqual( |
4323 | 700 | set(('show', 'callgrind', 'memory_profile_start')), | 700 | set(('show', 'callgrind', 'memory_profile_start')), |
4324 | 701 | set(profile._profilers.actions)) | 701 | set(profile._profilers.actions)) |
4325 | 702 | 702 | ||
4326 | 703 | 703 | ||
4327 | === modified file 'lib/lp/services/session/tests/test_session.py' | |||
4328 | --- lib/lp/services/session/tests/test_session.py 2013-06-20 05:50:00 +0000 | |||
4329 | +++ lib/lp/services/session/tests/test_session.py 2018-01-02 16:24:23 +0000 | |||
4330 | @@ -26,7 +26,7 @@ | |||
4331 | 26 | for cls in [SessionData, SessionPkgData]: | 26 | for cls in [SessionData, SessionPkgData]: |
4332 | 27 | for obj in [cls, cls()]: | 27 | for obj in [cls, cls()]: |
4333 | 28 | store = adapter(obj) | 28 | store = adapter(obj) |
4335 | 29 | self.assert_( | 29 | self.assertTrue( |
4336 | 30 | 'session' in store.get_database()._dsn, | 30 | 'session' in store.get_database()._dsn, |
4337 | 31 | 'Unknown store returned adapting %r to %r' | 31 | 'Unknown store returned adapting %r to %r' |
4338 | 32 | % (obj, adapter)) | 32 | % (obj, adapter)) |
4339 | 33 | 33 | ||
4340 | === modified file 'lib/lp/services/tests/test_utils.py' | |||
4341 | --- lib/lp/services/tests/test_utils.py 2014-08-29 01:34:04 +0000 | |||
4342 | +++ lib/lp/services/tests/test_utils.py 2018-01-02 16:24:23 +0000 | |||
4343 | @@ -200,7 +200,7 @@ | |||
4344 | 200 | def function(): | 200 | def function(): |
4345 | 201 | pass | 201 | pass |
4346 | 202 | function() | 202 | function() |
4348 | 203 | self.assertEquals(['before', 'after'], calls) | 203 | self.assertEqual(['before', 'after'], calls) |
4349 | 204 | 204 | ||
4350 | 205 | def test_decorate_with_function(self): | 205 | def test_decorate_with_function(self): |
4351 | 206 | # The original function is actually called when we call the result of | 206 | # The original function is actually called when we call the result of |
4352 | @@ -211,7 +211,7 @@ | |||
4353 | 211 | def function(): | 211 | def function(): |
4354 | 212 | calls.append('foo') | 212 | calls.append('foo') |
4355 | 213 | function() | 213 | function() |
4357 | 214 | self.assertEquals(['foo'], calls) | 214 | self.assertEqual(['foo'], calls) |
4358 | 215 | 215 | ||
4359 | 216 | def test_decorate_with_call_twice(self): | 216 | def test_decorate_with_call_twice(self): |
4360 | 217 | # A function decorated with decorate_with can be called twice. | 217 | # A function decorated with decorate_with can be called twice. |
4361 | @@ -222,7 +222,7 @@ | |||
4362 | 222 | calls.append('foo') | 222 | calls.append('foo') |
4363 | 223 | function() | 223 | function() |
4364 | 224 | function() | 224 | function() |
4366 | 225 | self.assertEquals(['foo', 'foo'], calls) | 225 | self.assertEqual(['foo', 'foo'], calls) |
4367 | 226 | 226 | ||
4368 | 227 | def test_decorate_with_arguments(self): | 227 | def test_decorate_with_arguments(self): |
4369 | 228 | # decorate_with passes through arguments. | 228 | # decorate_with passes through arguments. |
4370 | @@ -232,7 +232,7 @@ | |||
4371 | 232 | def function(*args, **kwargs): | 232 | def function(*args, **kwargs): |
4372 | 233 | calls.append((args, kwargs)) | 233 | calls.append((args, kwargs)) |
4373 | 234 | function('foo', 'bar', qux=4) | 234 | function('foo', 'bar', qux=4) |
4375 | 235 | self.assertEquals([(('foo', 'bar'), {'qux': 4})], calls) | 235 | self.assertEqual([(('foo', 'bar'), {'qux': 4})], calls) |
4376 | 236 | 236 | ||
4377 | 237 | def test_decorate_with_name_and_docstring(self): | 237 | def test_decorate_with_name_and_docstring(self): |
4378 | 238 | # decorate_with preserves function names and docstrings. | 238 | # decorate_with preserves function names and docstrings. |
4379 | 239 | 239 | ||
4380 | === modified file 'lib/lp/services/twistedsupport/tests/test_processmonitor.py' | |||
4381 | --- lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 10:54:31 +0000 | |||
4382 | +++ lib/lp/services/twistedsupport/tests/test_processmonitor.py 2018-01-02 16:24:23 +0000 | |||
4383 | @@ -370,7 +370,7 @@ | |||
4384 | 370 | d = run_process_with_timeout(('true',)) | 370 | d = run_process_with_timeout(('true',)) |
4385 | 371 | 371 | ||
4386 | 372 | def check_success_result(result): | 372 | def check_success_result(result): |
4388 | 373 | self.assertEquals(result, None, "Success result is not None.") | 373 | self.assertEqual(result, None, "Success result is not None.") |
4389 | 374 | 374 | ||
4390 | 375 | d.addCallback(check_success_result) | 375 | d.addCallback(check_success_result) |
4391 | 376 | return d | 376 | return d |
4392 | 377 | 377 | ||
4393 | === modified file 'lib/lp/services/verification/browser/tests/test_logintoken.py' | |||
4394 | --- lib/lp/services/verification/browser/tests/test_logintoken.py 2016-11-03 15:07:36 +0000 | |||
4395 | +++ lib/lp/services/verification/browser/tests/test_logintoken.py 2018-01-02 16:24:23 +0000 | |||
4396 | @@ -70,9 +70,9 @@ | |||
4397 | 70 | harness.submit('cancel', {}) | 70 | harness.submit('cancel', {}) |
4398 | 71 | actions = harness.view.actions.byname | 71 | actions = harness.view.actions.byname |
4399 | 72 | self.assertIn('field.actions.cancel', actions) | 72 | self.assertIn('field.actions.cancel', actions) |
4403 | 73 | self.assertEquals(actions['field.actions.cancel'].submitted(), True) | 73 | self.assertEqual(actions['field.actions.cancel'].submitted(), True) |
4404 | 74 | self.assertEquals(harness.view.errors, []) | 74 | self.assertEqual(harness.view.errors, []) |
4405 | 75 | self.assertEquals(harness.view.next_url, self.expected_next_url) | 75 | self.assertEqual(harness.view.next_url, self.expected_next_url) |
4406 | 76 | 76 | ||
4407 | 77 | 77 | ||
4408 | 78 | class TestClaimTeamView(TestCaseWithFactory): | 78 | class TestClaimTeamView(TestCaseWithFactory): |
4409 | @@ -101,9 +101,9 @@ | |||
4410 | 101 | requester=self.claimer, requesteremail=None, | 101 | requester=self.claimer, requesteremail=None, |
4411 | 102 | email=self.claimee_email, tokentype=LoginTokenType.TEAMCLAIM) | 102 | email=self.claimee_email, tokentype=LoginTokenType.TEAMCLAIM) |
4412 | 103 | msgs = self._claimToken(token1) | 103 | msgs = self._claimToken(token1) |
4414 | 104 | self.assertEquals([u'Team claimed successfully'], msgs) | 104 | self.assertEqual([u'Team claimed successfully'], msgs) |
4415 | 105 | msgs = self._claimToken(token2) | 105 | msgs = self._claimToken(token2) |
4417 | 106 | self.assertEquals( | 106 | self.assertEqual( |
4418 | 107 | [u'claimee has already been converted to a team.'], msgs) | 107 | [u'claimee has already been converted to a team.'], msgs) |
4419 | 108 | 108 | ||
4420 | 109 | 109 | ||
4421 | 110 | 110 | ||
4422 | === modified file 'lib/lp/services/verification/tests/test_token_creation.py' | |||
4423 | --- lib/lp/services/verification/tests/test_token_creation.py 2014-09-01 10:20:01 +0000 | |||
4424 | +++ lib/lp/services/verification/tests/test_token_creation.py 2018-01-02 16:24:23 +0000 | |||
4425 | @@ -12,4 +12,4 @@ | |||
4426 | 12 | 12 | ||
4427 | 13 | def test_length(self): | 13 | def test_length(self): |
4428 | 14 | token = create_token(99) | 14 | token = create_token(99) |
4430 | 15 | self.assertEquals(len(token), 99) | 15 | self.assertEqual(len(token), 99) |
4431 | 16 | 16 | ||
4432 | === modified file 'lib/lp/services/webapp/tests/test_authentication.py' | |||
4433 | --- lib/lp/services/webapp/tests/test_authentication.py 2014-06-27 07:58:42 +0000 | |||
4434 | +++ lib/lp/services/webapp/tests/test_authentication.py 2018-01-02 16:24:23 +0000 | |||
4435 | @@ -38,15 +38,15 @@ | |||
4436 | 38 | # included in the OAuth calculations. | 38 | # included in the OAuth calculations. |
4437 | 39 | headers = OAuthRequest._split_header( | 39 | headers = OAuthRequest._split_header( |
4438 | 40 | 'OAuth realm="foo", oauth_consumer_key="justtesting"') | 40 | 'OAuth realm="foo", oauth_consumer_key="justtesting"') |
4440 | 41 | self.assertEquals(headers, | 41 | self.assertEqual(headers, |
4441 | 42 | {'oauth_consumer_key': 'justtesting'}) | 42 | {'oauth_consumer_key': 'justtesting'}) |
4442 | 43 | headers = OAuthRequest._split_header( | 43 | headers = OAuthRequest._split_header( |
4443 | 44 | 'OAuth oauth_consumer_key="justtesting"') | 44 | 'OAuth oauth_consumer_key="justtesting"') |
4445 | 45 | self.assertEquals(headers, | 45 | self.assertEqual(headers, |
4446 | 46 | {'oauth_consumer_key': 'justtesting'}) | 46 | {'oauth_consumer_key': 'justtesting'}) |
4447 | 47 | headers = OAuthRequest._split_header( | 47 | headers = OAuthRequest._split_header( |
4448 | 48 | 'OAuth oauth_consumer_key="justtesting", realm="realm"') | 48 | 'OAuth oauth_consumer_key="justtesting", realm="realm"') |
4450 | 49 | self.assertEquals(headers, | 49 | self.assertEqual(headers, |
4451 | 50 | {'oauth_consumer_key': 'justtesting'}) | 50 | {'oauth_consumer_key': 'justtesting'}) |
4452 | 51 | 51 | ||
4453 | 52 | 52 | ||
4454 | 53 | 53 | ||
4455 | === modified file 'lib/lp/services/webapp/tests/test_authutility.py' | |||
4456 | --- lib/lp/services/webapp/tests/test_authutility.py 2016-09-21 02:50:41 +0000 | |||
4457 | +++ lib/lp/services/webapp/tests/test_authutility.py 2018-01-02 16:24:23 +0000 | |||
4458 | @@ -91,8 +91,8 @@ | |||
4459 | 91 | 91 | ||
4460 | 92 | def test_unauthenticatedPrincipal(self): | 92 | def test_unauthenticatedPrincipal(self): |
4461 | 93 | authsvc, request = self._make(None, None) | 93 | authsvc, request = self._make(None, None) |
4464 | 94 | self.assert_(isinstance(authsvc.unauthenticatedPrincipal(), | 94 | self.assertTrue(isinstance(authsvc.unauthenticatedPrincipal(), |
4465 | 95 | UnauthenticatedPrincipal)) | 95 | UnauthenticatedPrincipal)) |
4466 | 96 | 96 | ||
4467 | 97 | def test_unauthorized(self): | 97 | def test_unauthorized(self): |
4468 | 98 | authsvc, request = self._make('bruce', 'test') | 98 | authsvc, request = self._make('bruce', 'test') |
4469 | @@ -127,7 +127,7 @@ | |||
4470 | 127 | exception = self.assertRaises( | 127 | exception = self.assertRaises( |
4471 | 128 | AssertionError, authsvc._authenticateUsingBasicAuth, | 128 | AssertionError, authsvc._authenticateUsingBasicAuth, |
4472 | 129 | credentials, request) | 129 | credentials, request) |
4474 | 130 | self.assertEquals( | 130 | self.assertEqual( |
4475 | 131 | "Attempted to use basic auth when it is disabled", | 131 | "Attempted to use basic auth when it is disabled", |
4476 | 132 | str(exception)) | 132 | str(exception)) |
4477 | 133 | finally: | 133 | finally: |
4478 | 134 | 134 | ||
4479 | === modified file 'lib/lp/services/webapp/tests/test_batching.py' | |||
4480 | --- lib/lp/services/webapp/tests/test_batching.py 2016-02-05 16:51:12 +0000 | |||
4481 | +++ lib/lp/services/webapp/tests/test_batching.py 2018-01-02 16:24:23 +0000 | |||
4482 | @@ -459,7 +459,7 @@ | |||
4483 | 459 | resultset = self.makeStormResultSet() | 459 | resultset = self.makeStormResultSet() |
4484 | 460 | range_factory = StormRangeFactory(resultset, self.logError) | 460 | range_factory = StormRangeFactory(resultset, self.logError) |
4485 | 461 | [where_clause] = range_factory.whereExpressions([Person.id], [1]) | 461 | [where_clause] = range_factory.whereExpressions([Person.id], [1]) |
4487 | 462 | self.assertEquals('(Person.id) > (1)', compile(where_clause)) | 462 | self.assertEqual('(Person.id) > (1)', compile(where_clause)) |
4488 | 463 | 463 | ||
4489 | 464 | def test_whereExpressions_desc(self): | 464 | def test_whereExpressions_desc(self): |
4490 | 465 | """For descending sort order, whereExpressions() returns the | 465 | """For descending sort order, whereExpressions() returns the |
4491 | @@ -469,7 +469,7 @@ | |||
4492 | 469 | range_factory = StormRangeFactory(resultset, self.logError) | 469 | range_factory = StormRangeFactory(resultset, self.logError) |
4493 | 470 | [where_clause] = range_factory.whereExpressions( | 470 | [where_clause] = range_factory.whereExpressions( |
4494 | 471 | [Desc(Person.id)], [1]) | 471 | [Desc(Person.id)], [1]) |
4496 | 472 | self.assertEquals('(Person.id) < (1)', compile(where_clause)) | 472 | self.assertEqual('(Person.id) < (1)', compile(where_clause)) |
4497 | 473 | 473 | ||
4498 | 474 | def test_whereExpressions__two_sort_columns_asc_asc(self): | 474 | def test_whereExpressions__two_sort_columns_asc_asc(self): |
4499 | 475 | """If the ascending sort columns c1, c2 and the memo values | 475 | """If the ascending sort columns c1, c2 and the memo values |
4500 | @@ -483,7 +483,7 @@ | |||
4501 | 483 | range_factory = StormRangeFactory(resultset, self.logError) | 483 | range_factory = StormRangeFactory(resultset, self.logError) |
4502 | 484 | [where_clause] = range_factory.whereExpressions( | 484 | [where_clause] = range_factory.whereExpressions( |
4503 | 485 | [Person.id, Person.name], [1, 'foo']) | 485 | [Person.id, Person.name], [1, 'foo']) |
4505 | 486 | self.assertEquals( | 486 | self.assertEqual( |
4506 | 487 | "(Person.id, Person.name) > (1, E'foo')", compile(where_clause)) | 487 | "(Person.id, Person.name) > (1, E'foo')", compile(where_clause)) |
4507 | 488 | 488 | ||
4508 | 489 | def test_whereExpressions__two_sort_columns_desc_desc(self): | 489 | def test_whereExpressions__two_sort_columns_desc_desc(self): |
4509 | @@ -498,7 +498,7 @@ | |||
4510 | 498 | range_factory = StormRangeFactory(resultset, self.logError) | 498 | range_factory = StormRangeFactory(resultset, self.logError) |
4511 | 499 | [where_clause] = range_factory.whereExpressions( | 499 | [where_clause] = range_factory.whereExpressions( |
4512 | 500 | [Desc(Person.id), Desc(Person.name)], [1, 'foo']) | 500 | [Desc(Person.id), Desc(Person.name)], [1, 'foo']) |
4514 | 501 | self.assertEquals( | 501 | self.assertEqual( |
4515 | 502 | "(Person.id, Person.name) < (1, E'foo')", compile(where_clause)) | 502 | "(Person.id, Person.name) < (1, E'foo')", compile(where_clause)) |
4516 | 503 | 503 | ||
4517 | 504 | def test_whereExpressions__two_sort_columns_asc_desc(self): | 504 | def test_whereExpressions__two_sort_columns_asc_desc(self): |
4518 | @@ -516,10 +516,10 @@ | |||
4519 | 516 | range_factory = StormRangeFactory(resultset, self.logError) | 516 | range_factory = StormRangeFactory(resultset, self.logError) |
4520 | 517 | [where_clause_1, where_clause_2] = range_factory.whereExpressions( | 517 | [where_clause_1, where_clause_2] = range_factory.whereExpressions( |
4521 | 518 | [Person.id, Desc(Person.name)], [1, 'foo']) | 518 | [Person.id, Desc(Person.name)], [1, 'foo']) |
4523 | 519 | self.assertEquals( | 519 | self.assertEqual( |
4524 | 520 | "Person.id = ? AND ((Person.name) < (E'foo'))", | 520 | "Person.id = ? AND ((Person.name) < (E'foo'))", |
4525 | 521 | compile(where_clause_1)) | 521 | compile(where_clause_1)) |
4527 | 522 | self.assertEquals('(Person.id) > (1)', compile(where_clause_2)) | 522 | self.assertEqual('(Person.id) > (1)', compile(where_clause_2)) |
4528 | 523 | 523 | ||
4529 | 524 | def test_getSlice__forward_without_memo(self): | 524 | def test_getSlice__forward_without_memo(self): |
4530 | 525 | resultset = self.makeStormResultSet() | 525 | resultset = self.makeStormResultSet() |
4531 | 526 | 526 | ||
4532 | === modified file 'lib/lp/services/webapp/tests/test_breadcrumbs.py' | |||
4533 | --- lib/lp/services/webapp/tests/test_breadcrumbs.py 2015-08-04 11:17:11 +0000 | |||
4534 | +++ lib/lp/services/webapp/tests/test_breadcrumbs.py 2018-01-02 16:24:23 +0000 | |||
4535 | @@ -67,14 +67,14 @@ | |||
4536 | 67 | # Breadcrumb adapter will use 'mainsite' as the rootsite. | 67 | # Breadcrumb adapter will use 'mainsite' as the rootsite. |
4537 | 68 | cookbook = Cookbook() | 68 | cookbook = Cookbook() |
4538 | 69 | self.assertIs(cookbook.rootsite, None) | 69 | self.assertIs(cookbook.rootsite, None) |
4540 | 70 | self.assertEquals(Breadcrumb(cookbook).rootsite, 'mainsite') | 70 | self.assertEqual(Breadcrumb(cookbook).rootsite, 'mainsite') |
4541 | 71 | 71 | ||
4542 | 72 | def test_urldata_rootsite_is_honored(self): | 72 | def test_urldata_rootsite_is_honored(self): |
4543 | 73 | # When a class' ICanonicalUrlData defines a rootsite, our Breadcrumb | 73 | # When a class' ICanonicalUrlData defines a rootsite, our Breadcrumb |
4544 | 74 | # adapter will use it. | 74 | # adapter will use it. |
4545 | 75 | cookbook = Cookbook() | 75 | cookbook = Cookbook() |
4546 | 76 | cookbook.rootsite = 'cooking' | 76 | cookbook.rootsite = 'cooking' |
4548 | 77 | self.assertEquals(Breadcrumb(cookbook).rootsite, 'cooking') | 77 | self.assertEqual(Breadcrumb(cookbook).rootsite, 'cooking') |
4549 | 78 | 78 | ||
4550 | 79 | 79 | ||
4551 | 80 | class TestExtraBreadcrumbForLeafPageOnHierarchyView(BaseBreadcrumbTestCase): | 80 | class TestExtraBreadcrumbForLeafPageOnHierarchyView(BaseBreadcrumbTestCase): |
4552 | @@ -94,20 +94,20 @@ | |||
4553 | 94 | def test_non_default_page(self): | 94 | def test_non_default_page(self): |
4554 | 95 | crumbs = self.getBreadcrumbsForObject(self.product, '+download') | 95 | crumbs = self.getBreadcrumbsForObject(self.product, '+download') |
4555 | 96 | downloads_url = "%s/+download" % self.product_url | 96 | downloads_url = "%s/+download" % self.product_url |
4557 | 97 | self.assertEquals( | 97 | self.assertEqual( |
4558 | 98 | [self.product_url, downloads_url], | 98 | [self.product_url, downloads_url], |
4559 | 99 | [crumb.url for crumb in crumbs]) | 99 | [crumb.url for crumb in crumbs]) |
4561 | 100 | self.assertEquals( | 100 | self.assertEqual( |
4562 | 101 | '%s project files' % self.product.displayname, | 101 | '%s project files' % self.product.displayname, |
4563 | 102 | crumbs[-1].text) | 102 | crumbs[-1].text) |
4564 | 103 | 103 | ||
4565 | 104 | def test_facet_default_page(self): | 104 | def test_facet_default_page(self): |
4566 | 105 | crumbs = self.getBreadcrumbsForObject(self.product, '+bugs') | 105 | crumbs = self.getBreadcrumbsForObject(self.product, '+bugs') |
4567 | 106 | bugs_url = self.product_url.replace('launchpad', 'bugs.launchpad') | 106 | bugs_url = self.product_url.replace('launchpad', 'bugs.launchpad') |
4569 | 107 | self.assertEquals( | 107 | self.assertEqual( |
4570 | 108 | [self.product_url, bugs_url], | 108 | [self.product_url, bugs_url], |
4571 | 109 | [crumb.url for crumb in crumbs]) | 109 | [crumb.url for crumb in crumbs]) |
4573 | 110 | self.assertEquals('Bugs', crumbs[-1].text) | 110 | self.assertEqual('Bugs', crumbs[-1].text) |
4574 | 111 | 111 | ||
4575 | 112 | def test_zope_i18n_Messages_are_interpolated(self): | 112 | def test_zope_i18n_Messages_are_interpolated(self): |
4576 | 113 | # Views can use zope.i18nmessageid.Message as their title when they | 113 | # Views can use zope.i18nmessageid.Message as their title when they |
4577 | @@ -124,7 +124,7 @@ | |||
4578 | 124 | request.traversed_objects = [self.product, test_view] | 124 | request.traversed_objects = [self.product, test_view] |
4579 | 125 | hierarchy_view = Hierarchy(test_view, request) | 125 | hierarchy_view = Hierarchy(test_view, request) |
4580 | 126 | [breadcrumb] = hierarchy_view.makeBreadcrumbsForRequestedPage() | 126 | [breadcrumb] = hierarchy_view.makeBreadcrumbsForRequestedPage() |
4582 | 127 | self.assertEquals(breadcrumb.text, 'breadcrumb test') | 127 | self.assertEqual(breadcrumb.text, 'breadcrumb test') |
4583 | 128 | 128 | ||
4584 | 129 | 129 | ||
4585 | 130 | class TestExtraFacetBreadcrumbsOnHierarchyView(BaseBreadcrumbTestCase): | 130 | class TestExtraFacetBreadcrumbsOnHierarchyView(BaseBreadcrumbTestCase): |
4586 | @@ -151,14 +151,14 @@ | |||
4587 | 151 | 151 | ||
4588 | 152 | def test_root_on_mainsite(self): | 152 | def test_root_on_mainsite(self): |
4589 | 153 | crumbs = self.getBreadcrumbsForUrl('http://launchpad.dev/') | 153 | crumbs = self.getBreadcrumbsForUrl('http://launchpad.dev/') |
4591 | 154 | self.assertEquals(crumbs, []) | 154 | self.assertEqual(crumbs, []) |
4592 | 155 | 155 | ||
4593 | 156 | def test_product_on_mainsite(self): | 156 | def test_product_on_mainsite(self): |
4594 | 157 | self.assertBreadcrumbUrls([self.product_url], self.product) | 157 | self.assertBreadcrumbUrls([self.product_url], self.product) |
4595 | 158 | 158 | ||
4596 | 159 | def test_root_on_vhost(self): | 159 | def test_root_on_vhost(self): |
4597 | 160 | crumbs = self.getBreadcrumbsForUrl('http://bugs.launchpad.dev/') | 160 | crumbs = self.getBreadcrumbsForUrl('http://bugs.launchpad.dev/') |
4599 | 161 | self.assertEquals(crumbs, []) | 161 | self.assertEqual(crumbs, []) |
4600 | 162 | 162 | ||
4601 | 163 | def test_product_on_vhost(self): | 163 | def test_product_on_vhost(self): |
4602 | 164 | self.assertBreadcrumbUrls( | 164 | self.assertBreadcrumbUrls( |
4603 | 165 | 165 | ||
4604 | === modified file 'lib/lp/services/webapp/tests/test_error.py' | |||
4605 | --- lib/lp/services/webapp/tests/test_error.py 2017-01-13 13:35:31 +0000 | |||
4606 | +++ lib/lp/services/webapp/tests/test_error.py 2018-01-02 16:24:23 +0000 | |||
4607 | @@ -56,17 +56,16 @@ | |||
4608 | 56 | def test_without_oops_id(self): | 56 | def test_without_oops_id(self): |
4609 | 57 | request = LaunchpadTestRequest() | 57 | request = LaunchpadTestRequest() |
4610 | 58 | SystemErrorView(Exception(), request) | 58 | SystemErrorView(Exception(), request) |
4614 | 59 | self.assertEquals(500, request.response.getStatus()) | 59 | self.assertEqual(500, request.response.getStatus()) |
4615 | 60 | self.assertEquals( | 60 | self.assertIsNone( |
4613 | 61 | None, | ||
4616 | 62 | request.response.getHeader('X-Lazr-OopsId', literal=True)) | 61 | request.response.getHeader('X-Lazr-OopsId', literal=True)) |
4617 | 63 | 62 | ||
4618 | 64 | def test_with_oops_id(self): | 63 | def test_with_oops_id(self): |
4619 | 65 | request = LaunchpadTestRequest() | 64 | request = LaunchpadTestRequest() |
4620 | 66 | request.oopsid = 'OOPS-1X1' | 65 | request.oopsid = 'OOPS-1X1' |
4621 | 67 | SystemErrorView(Exception(), request) | 66 | SystemErrorView(Exception(), request) |
4624 | 68 | self.assertEquals(500, request.response.getStatus()) | 67 | self.assertEqual(500, request.response.getStatus()) |
4625 | 69 | self.assertEquals( | 68 | self.assertEqual( |
4626 | 70 | 'OOPS-1X1', | 69 | 'OOPS-1X1', |
4627 | 71 | request.response.getHeader('X-Lazr-OopsId', literal=True)) | 70 | request.response.getHeader('X-Lazr-OopsId', literal=True)) |
4628 | 72 | 71 | ||
4629 | @@ -224,7 +223,7 @@ | |||
4630 | 224 | def test_disconnectionerror_view(self): | 223 | def test_disconnectionerror_view(self): |
4631 | 225 | request = LaunchpadTestRequest() | 224 | request = LaunchpadTestRequest() |
4632 | 226 | DisconnectionErrorView(DisconnectionError(), request) | 225 | DisconnectionErrorView(DisconnectionError(), request) |
4634 | 227 | self.assertEquals(503, request.response.getStatus()) | 226 | self.assertEqual(503, request.response.getStatus()) |
4635 | 228 | 227 | ||
4636 | 229 | def test_operationalerror_view_integration(self): | 228 | def test_operationalerror_view_integration(self): |
4637 | 230 | # Test setup. | 229 | # Test setup. |
4638 | @@ -246,4 +245,4 @@ | |||
4639 | 246 | def test_operationalerror_view(self): | 245 | def test_operationalerror_view(self): |
4640 | 247 | request = LaunchpadTestRequest() | 246 | request = LaunchpadTestRequest() |
4641 | 248 | OperationalErrorView(OperationalError(), request) | 247 | OperationalErrorView(OperationalError(), request) |
4643 | 249 | self.assertEquals(503, request.response.getStatus()) | 248 | self.assertEqual(503, request.response.getStatus()) |
4644 | 250 | 249 | ||
4645 | === modified file 'lib/lp/services/webapp/tests/test_haproxy.py' | |||
4646 | --- lib/lp/services/webapp/tests/test_haproxy.py 2012-09-28 06:01:02 +0000 | |||
4647 | +++ lib/lp/services/webapp/tests/test_haproxy.py 2018-01-02 16:24:23 +0000 | |||
4648 | @@ -32,7 +32,7 @@ | |||
4649 | 32 | 32 | ||
4650 | 33 | def test_HAProxyStatusView_all_good_returns_200(self): | 33 | def test_HAProxyStatusView_all_good_returns_200(self): |
4651 | 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) |
4653 | 35 | self.assertEquals(200, result.getStatus()) | 35 | self.assertEqual(200, result.getStatus()) |
4654 | 36 | 36 | ||
4655 | 37 | def test_authenticated_HAProxyStatusView_works(self): | 37 | def test_authenticated_HAProxyStatusView_works(self): |
4656 | 38 | # We don't use authenticated requests, but this keeps us from | 38 | # We don't use authenticated requests, but this keeps us from |
4657 | @@ -41,12 +41,12 @@ | |||
4658 | 41 | u'GET /+haproxy HTTP/1.0\n' | 41 | u'GET /+haproxy HTTP/1.0\n' |
4659 | 42 | u'Authorization: Basic Zm9vLmJhckBjYW5vbmljYWwuY29tOnRlc3Q=\n', | 42 | u'Authorization: Basic Zm9vLmJhckBjYW5vbmljYWwuY29tOnRlc3Q=\n', |
4660 | 43 | handle_errors=False) | 43 | handle_errors=False) |
4662 | 44 | self.assertEquals(200, result.getStatus()) | 44 | self.assertEqual(200, result.getStatus()) |
4663 | 45 | 45 | ||
4664 | 46 | def test_HAProxyStatusView_going_down_returns_500(self): | 46 | def test_HAProxyStatusView_going_down_returns_500(self): |
4665 | 47 | haproxy.set_going_down_flag(True) | 47 | haproxy.set_going_down_flag(True) |
4666 | 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) |
4668 | 49 | self.assertEquals(500, result.getStatus()) | 49 | self.assertEqual(500, result.getStatus()) |
4669 | 50 | 50 | ||
4670 | 51 | def test_haproxy_url_uses_DatabaseBlocked_policy(self): | 51 | def test_haproxy_url_uses_DatabaseBlocked_policy(self): |
4671 | 52 | request = LaunchpadTestRequest(environ={'PATH_INFO': '/+haproxy'}) | 52 | request = LaunchpadTestRequest(environ={'PATH_INFO': '/+haproxy'}) |
4672 | @@ -56,9 +56,9 @@ | |||
4673 | 56 | def test_switch_going_down_flag(self): | 56 | def test_switch_going_down_flag(self): |
4674 | 57 | haproxy.set_going_down_flag(True) | 57 | haproxy.set_going_down_flag(True) |
4675 | 58 | haproxy.switch_going_down_flag() | 58 | haproxy.switch_going_down_flag() |
4677 | 59 | self.assertEquals(False, haproxy.going_down_flag) | 59 | self.assertEqual(False, haproxy.going_down_flag) |
4678 | 60 | haproxy.switch_going_down_flag() | 60 | haproxy.switch_going_down_flag() |
4680 | 61 | self.assertEquals(True, haproxy.going_down_flag) | 61 | self.assertEqual(True, haproxy.going_down_flag) |
4681 | 62 | 62 | ||
4682 | 63 | def test_HAProxyStatusView_status_code_is_configurable(self): | 63 | def test_HAProxyStatusView_status_code_is_configurable(self): |
4683 | 64 | config.push('change_haproxy_status_code', dedent(''' | 64 | config.push('change_haproxy_status_code', dedent(''' |
4684 | @@ -68,4 +68,4 @@ | |||
4685 | 68 | self.addCleanup(config.pop, 'change_haproxy_status_code') | 68 | self.addCleanup(config.pop, 'change_haproxy_status_code') |
4686 | 69 | haproxy.set_going_down_flag(True) | 69 | haproxy.set_going_down_flag(True) |
4687 | 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) |
4689 | 71 | self.assertEquals(499, result.getStatus()) | 71 | self.assertEqual(499, result.getStatus()) |
4690 | 72 | 72 | ||
4691 | === modified file 'lib/lp/services/webapp/tests/test_login.py' | |||
4692 | --- lib/lp/services/webapp/tests/test_login.py 2016-05-27 09:57:43 +0000 | |||
4693 | +++ lib/lp/services/webapp/tests/test_login.py 2018-01-02 16:24:23 +0000 | |||
4694 | @@ -242,9 +242,9 @@ | |||
4695 | 242 | person.account, email=test_email) | 242 | person.account, email=test_email) |
4696 | 243 | self.assertTrue(view.login_called) | 243 | self.assertTrue(view.login_called) |
4697 | 244 | response = view.request.response | 244 | response = view.request.response |
4701 | 245 | self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus()) | 245 | self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus()) |
4702 | 246 | self.assertEquals(view.request.form['starting_url'], | 246 | self.assertEqual(view.request.form['starting_url'], |
4703 | 247 | response.getHeader('Location')) | 247 | response.getHeader('Location')) |
4704 | 248 | # The 'last_write' flag was not updated (unlike in the other test | 248 | # The 'last_write' flag was not updated (unlike in the other test |
4705 | 249 | # methods) because in this case we didn't have to create a | 249 | # methods) because in this case we didn't have to create a |
4706 | 250 | # Person/Account entry, so it's ok for further requests to hit the | 250 | # Person/Account entry, so it's ok for further requests to hit the |
4707 | @@ -267,7 +267,7 @@ | |||
4708 | 267 | 'starting_url': 'http://launchpad.dev/after-login', | 267 | 'starting_url': 'http://launchpad.dev/after-login', |
4709 | 268 | 'foo': 'bar', | 268 | 'foo': 'bar', |
4710 | 269 | } | 269 | } |
4712 | 270 | self.assertEquals(params, expected_params) | 270 | self.assertEqual(params, expected_params) |
4713 | 271 | 271 | ||
4714 | 272 | def test_gather_params_with_unicode_data(self): | 272 | def test_gather_params_with_unicode_data(self): |
4715 | 273 | # If the currently requested URL includes a query string, the | 273 | # If the currently requested URL includes a query string, the |
4716 | @@ -281,7 +281,7 @@ | |||
4717 | 281 | environ={'PATH_INFO': '/'}) | 281 | environ={'PATH_INFO': '/'}) |
4718 | 282 | view = OpenIDCallbackView(context=None, request=None) | 282 | view = OpenIDCallbackView(context=None, request=None) |
4719 | 283 | params = view._gather_params(request) | 283 | params = view._gather_params(request) |
4721 | 284 | self.assertEquals(params['foo'], u'\u16dd') | 284 | self.assertEqual(params['foo'], u'\u16dd') |
4722 | 285 | 285 | ||
4723 | 286 | def test_unexpected_multivalue_fields(self): | 286 | def test_unexpected_multivalue_fields(self): |
4724 | 287 | # The parameter gatering doesn't expect to find multi-valued form | 287 | # The parameter gatering doesn't expect to find multi-valued form |
4725 | @@ -303,7 +303,7 @@ | |||
4726 | 303 | form={'starting_url': 'http://launchpad.dev/after-login'}) | 303 | form={'starting_url': 'http://launchpad.dev/after-login'}) |
4727 | 304 | view = OpenIDCallbackView(context=None, request=None) | 304 | view = OpenIDCallbackView(context=None, request=None) |
4728 | 305 | url = view._get_requested_url(request) | 305 | url = view._get_requested_url(request) |
4730 | 306 | self.assertEquals(url, 'http://example.com?foo=bar') | 306 | self.assertEqual(url, 'http://example.com?foo=bar') |
4731 | 307 | 307 | ||
4732 | 308 | def test_open_id_callback_handles_query_string(self): | 308 | def test_open_id_callback_handles_query_string(self): |
4733 | 309 | # If the currently requested URL includes a query string, the | 309 | # If the currently requested URL includes a query string, the |
4734 | @@ -317,13 +317,13 @@ | |||
4735 | 317 | environ={'PATH_INFO': '/'}) | 317 | environ={'PATH_INFO': '/'}) |
4736 | 318 | view = FakeConsumerOpenIDCallbackView(object(), request) | 318 | view = FakeConsumerOpenIDCallbackView(object(), request) |
4737 | 319 | view.initialize() | 319 | view.initialize() |
4739 | 320 | self.assertEquals( | 320 | self.assertEqual( |
4740 | 321 | view.fake_consumer.params, | 321 | view.fake_consumer.params, |
4741 | 322 | { | 322 | { |
4742 | 323 | 'starting_url': 'http://launchpad.dev/after-login', | 323 | 'starting_url': 'http://launchpad.dev/after-login', |
4743 | 324 | 'foo': 'bar', | 324 | 'foo': 'bar', |
4744 | 325 | }) | 325 | }) |
4746 | 326 | self.assertEquals( | 326 | self.assertEqual( |
4747 | 327 | view.fake_consumer.requested_url, 'http://example.com?foo=bar') | 327 | view.fake_consumer.requested_url, 'http://example.com?foo=bar') |
4748 | 328 | 328 | ||
4749 | 329 | def test_unseen_identity(self): | 329 | def test_unseen_identity(self): |
4750 | @@ -343,12 +343,12 @@ | |||
4751 | 343 | self.assertTrue(view.login_called) | 343 | self.assertTrue(view.login_called) |
4752 | 344 | account = account_set.getByOpenIDIdentifier(identifier) | 344 | account = account_set.getByOpenIDIdentifier(identifier) |
4753 | 345 | self.assertIsNot(None, account) | 345 | self.assertIsNot(None, account) |
4755 | 346 | self.assertEquals(AccountStatus.ACTIVE, account.status) | 346 | self.assertEqual(AccountStatus.ACTIVE, account.status) |
4756 | 347 | person = IPerson(account, None) | 347 | person = IPerson(account, None) |
4757 | 348 | self.assertIsNot(None, person) | 348 | self.assertIsNot(None, person) |
4761 | 349 | self.assertEquals('Foo User', person.displayname) | 349 | self.assertEqual('Foo User', person.displayname) |
4762 | 350 | self.assertEquals('non-existent@example.com', | 350 | self.assertEqual('non-existent@example.com', |
4763 | 351 | removeSecurityProxy(person.preferredemail).email) | 351 | removeSecurityProxy(person.preferredemail).email) |
4764 | 352 | 352 | ||
4765 | 353 | # We also update the last_write flag in the session, to make sure | 353 | # We also update the last_write flag in the session, to make sure |
4766 | 354 | # further requests use the master DB and thus see the newly created | 354 | # further requests use the master DB and thus see the newly created |
4767 | @@ -382,12 +382,12 @@ | |||
4768 | 382 | identifiers = [i.identifier for i in account.openid_identifiers] | 382 | identifiers = [i.identifier for i in account.openid_identifiers] |
4769 | 383 | self.assertIn(identifier, identifiers) | 383 | self.assertIn(identifier, identifiers) |
4770 | 384 | 384 | ||
4773 | 385 | self.assertEquals(AccountStatus.ACTIVE, account.status) | 385 | self.assertEqual(AccountStatus.ACTIVE, account.status) |
4774 | 386 | self.assertEquals( | 386 | self.assertEqual( |
4775 | 387 | email, removeSecurityProxy(person.preferredemail).email) | 387 | email, removeSecurityProxy(person.preferredemail).email) |
4776 | 388 | person = IPerson(account, None) | 388 | person = IPerson(account, None) |
4777 | 389 | self.assertIsNot(None, person) | 389 | self.assertIsNot(None, person) |
4779 | 390 | self.assertEquals('Test account', person.displayname) | 390 | self.assertEqual('Test account', person.displayname) |
4780 | 391 | 391 | ||
4781 | 392 | # We also update the last_write flag in the session, to make sure | 392 | # We also update the last_write flag in the session, to make sure |
4782 | 393 | # further requests use the master DB and thus see the newly created | 393 | # further requests use the master DB and thus see the newly created |
4783 | @@ -411,11 +411,11 @@ | |||
4784 | 411 | view, html = self._createAndRenderView(openid_response) | 411 | view, html = self._createAndRenderView(openid_response) |
4785 | 412 | self.assertTrue(view.login_called) | 412 | self.assertTrue(view.login_called) |
4786 | 413 | response = view.request.response | 413 | response = view.request.response |
4792 | 414 | self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus()) | 414 | self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus()) |
4793 | 415 | self.assertEquals(view.request.form['starting_url'], | 415 | self.assertEqual(view.request.form['starting_url'], |
4794 | 416 | response.getHeader('Location')) | 416 | response.getHeader('Location')) |
4795 | 417 | self.assertEquals(AccountStatus.ACTIVE, person.account.status) | 417 | self.assertEqual(AccountStatus.ACTIVE, person.account.status) |
4796 | 418 | self.assertEquals(email, person.preferredemail.email) | 418 | self.assertEqual(email, person.preferredemail.email) |
4797 | 419 | # We also update the last_write flag in the session, to make sure | 419 | # We also update the last_write flag in the session, to make sure |
4798 | 420 | # further requests use the master DB and thus see the newly created | 420 | # further requests use the master DB and thus see the newly created |
4799 | 421 | # stuff. | 421 | # stuff. |
4800 | @@ -440,8 +440,8 @@ | |||
4801 | 440 | with SRegResponse_fromSuccessResponse_stubbed(): | 440 | with SRegResponse_fromSuccessResponse_stubbed(): |
4802 | 441 | view, html = self._createAndRenderView(openid_response) | 441 | view, html = self._createAndRenderView(openid_response) |
4803 | 442 | self.assertTrue(view.login_called) | 442 | self.assertTrue(view.login_called) |
4806 | 443 | self.assertEquals(AccountStatus.ACTIVE, person.account.status) | 443 | self.assertEqual(AccountStatus.ACTIVE, person.account.status) |
4807 | 444 | self.assertEquals(email, person.preferredemail.email) | 444 | self.assertEqual(email, person.preferredemail.email) |
4808 | 445 | # We also update the last_write flag in the session, to make sure | 445 | # We also update the last_write flag in the session, to make sure |
4809 | 446 | # further requests use the master DB and thus see the newly created | 446 | # further requests use the master DB and thus see the newly created |
4810 | 447 | # stuff. | 447 | # stuff. |
4811 | @@ -579,9 +579,9 @@ | |||
4812 | 579 | view_class=StubbedOpenIDCallbackViewLoggedIn) | 579 | view_class=StubbedOpenIDCallbackViewLoggedIn) |
4813 | 580 | self.assertFalse(view.login_called) | 580 | self.assertFalse(view.login_called) |
4814 | 581 | response = view.request.response | 581 | response = view.request.response |
4818 | 582 | self.assertEquals(httplib.TEMPORARY_REDIRECT, response.getStatus()) | 582 | self.assertEqual(httplib.TEMPORARY_REDIRECT, response.getStatus()) |
4819 | 583 | self.assertEquals(view.request.form['starting_url'], | 583 | self.assertEqual(view.request.form['starting_url'], |
4820 | 584 | response.getHeader('Location')) | 584 | response.getHeader('Location')) |
4821 | 585 | notification_msg = view.request.response.notifications[0].message | 585 | notification_msg = view.request.response.notifications[0].message |
4822 | 586 | expected_msg = ('Your authentication failed but you were already ' | 586 | expected_msg = ('Your authentication failed but you were already ' |
4823 | 587 | 'logged into Launchpad') | 587 | 'logged into Launchpad') |
4824 | @@ -626,9 +626,9 @@ | |||
4825 | 626 | form={'starting_url': self.STARTING_URL}) | 626 | form={'starting_url': self.STARTING_URL}) |
4826 | 627 | view.initialize() | 627 | view.initialize() |
4827 | 628 | view._redirect() | 628 | view._redirect() |
4829 | 629 | self.assertEquals( | 629 | self.assertEqual( |
4830 | 630 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) | 630 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) |
4832 | 631 | self.assertEquals( | 631 | self.assertEqual( |
4833 | 632 | view.request.response.getHeader('Location'), self.STARTING_URL) | 632 | view.request.response.getHeader('Location'), self.STARTING_URL) |
4834 | 633 | 633 | ||
4835 | 634 | def test_open_id_callback_redirect_from_post(self): | 634 | def test_open_id_callback_redirect_from_post(self): |
4836 | @@ -640,9 +640,9 @@ | |||
4837 | 640 | QUERY_STRING='starting_url=' + self.STARTING_URL) | 640 | QUERY_STRING='starting_url=' + self.STARTING_URL) |
4838 | 641 | view.initialize() | 641 | view.initialize() |
4839 | 642 | view._redirect() | 642 | view._redirect() |
4841 | 643 | self.assertEquals( | 643 | self.assertEqual( |
4842 | 644 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) | 644 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) |
4844 | 645 | self.assertEquals( | 645 | self.assertEqual( |
4845 | 646 | view.request.response.getHeader('Location'), self.STARTING_URL) | 646 | view.request.response.getHeader('Location'), self.STARTING_URL) |
4846 | 647 | 647 | ||
4847 | 648 | def test_openid_callback_redirect_fallback(self): | 648 | def test_openid_callback_redirect_fallback(self): |
4848 | @@ -652,9 +652,9 @@ | |||
4849 | 652 | view.request = LaunchpadTestRequest(SERVER_URL=self.APPLICATION_URL) | 652 | view.request = LaunchpadTestRequest(SERVER_URL=self.APPLICATION_URL) |
4850 | 653 | view.initialize() | 653 | view.initialize() |
4851 | 654 | view._redirect() | 654 | view._redirect() |
4853 | 655 | self.assertEquals( | 655 | self.assertEqual( |
4854 | 656 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) | 656 | httplib.TEMPORARY_REDIRECT, view.request.response.getStatus()) |
4856 | 657 | self.assertEquals( | 657 | self.assertEqual( |
4857 | 658 | view.request.response.getHeader('Location'), self.APPLICATION_URL) | 658 | view.request.response.getHeader('Location'), self.APPLICATION_URL) |
4858 | 659 | 659 | ||
4859 | 660 | 660 | ||
4860 | @@ -694,7 +694,7 @@ | |||
4861 | 694 | self.assertIn('body onload', browser.contents) | 694 | self.assertIn('body onload', browser.contents) |
4862 | 695 | browser.getControl('Continue').click() | 695 | browser.getControl('Continue').click() |
4863 | 696 | 696 | ||
4865 | 697 | self.assertEquals('Login', browser.title) | 697 | self.assertEqual('Login', browser.title) |
4866 | 698 | fill_login_form_and_submit(browser, 'test@canonical.com') | 698 | fill_login_form_and_submit(browser, 'test@canonical.com') |
4867 | 699 | login_status = extract_text( | 699 | login_status = extract_text( |
4868 | 700 | find_tag_by_id(browser.contents, 'logincontrol')) | 700 | find_tag_by_id(browser.contents, 'logincontrol')) |
4869 | @@ -710,10 +710,10 @@ | |||
4870 | 710 | replay_browser.open(callback_url) | 710 | replay_browser.open(callback_url) |
4871 | 711 | login_status = extract_text( | 711 | login_status = extract_text( |
4872 | 712 | find_tag_by_id(replay_browser.contents, 'logincontrol')) | 712 | find_tag_by_id(replay_browser.contents, 'logincontrol')) |
4874 | 713 | self.assertEquals('Log in / Register', login_status) | 713 | self.assertEqual('Log in / Register', login_status) |
4875 | 714 | error_msg = find_tags_by_class(replay_browser.contents, 'error')[0] | 714 | error_msg = find_tags_by_class(replay_browser.contents, 'error')[0] |
4878 | 715 | self.assertEquals('Nonce already used or out of range', | 715 | self.assertEqual('Nonce already used or out of range', |
4879 | 716 | extract_text(error_msg)) | 716 | extract_text(error_msg)) |
4880 | 717 | 717 | ||
4881 | 718 | 718 | ||
4882 | 719 | class FakeHTTPResponse: | 719 | class FakeHTTPResponse: |
4883 | @@ -743,8 +743,8 @@ | |||
4884 | 743 | browser = TestBrowser() | 743 | browser = TestBrowser() |
4885 | 744 | self.assertRaises(urllib2.HTTPError, | 744 | self.assertRaises(urllib2.HTTPError, |
4886 | 745 | browser.open, 'http://launchpad.dev/+login') | 745 | browser.open, 'http://launchpad.dev/+login') |
4889 | 746 | self.assertEquals('503 Service Unavailable', | 746 | self.assertEqual('503 Service Unavailable', |
4890 | 747 | browser.headers.get('status')) | 747 | browser.headers.get('status')) |
4891 | 748 | self.assertTrue( | 748 | self.assertTrue( |
4892 | 749 | 'OpenID Provider Is Unavailable at This Time' in browser.contents) | 749 | 'OpenID Provider Is Unavailable at This Time' in browser.contents) |
4893 | 750 | 750 | ||
4894 | @@ -845,10 +845,10 @@ | |||
4895 | 845 | self.assertIsNot(None, extensions) | 845 | self.assertIsNot(None, extensions) |
4896 | 846 | sreg_extension = extensions[0] | 846 | sreg_extension = extensions[0] |
4897 | 847 | self.assertIsInstance(sreg_extension, sreg.SRegRequest) | 847 | self.assertIsInstance(sreg_extension, sreg.SRegRequest) |
4902 | 848 | self.assertEquals(['email', 'fullname'], | 848 | self.assertEqual(['email', 'fullname'], |
4903 | 849 | sorted(sreg_extension.allRequestedFields())) | 849 | sorted(sreg_extension.allRequestedFields())) |
4904 | 850 | self.assertEquals(sorted(sreg_extension.required), | 850 | self.assertEqual(sorted(sreg_extension.required), |
4905 | 851 | sorted(sreg_extension.allRequestedFields())) | 851 | sorted(sreg_extension.allRequestedFields())) |
4906 | 852 | 852 | ||
4907 | 853 | def test_pape_extension_added_with_reauth_query(self): | 853 | def test_pape_extension_added_with_reauth_query(self): |
4908 | 854 | # We can signal that a request should be reauthenticated via | 854 | # We can signal that a request should be reauthenticated via |
4909 | @@ -928,8 +928,8 @@ | |||
4910 | 928 | # At this point browser.contents contains a hidden form which would've | 928 | # At this point browser.contents contains a hidden form which would've |
4911 | 929 | # been auto-submitted if we had in-browser JS support, but since we | 929 | # been auto-submitted if we had in-browser JS support, but since we |
4912 | 930 | # don't we can easily inspect what's in the form. | 930 | # don't we can easily inspect what's in the form. |
4915 | 931 | self.assertEquals('%s/' % browser.rooturl, | 931 | self.assertEqual('%s/' % browser.rooturl, |
4916 | 932 | browser.getControl(name='openid.realm').value) | 932 | browser.getControl(name='openid.realm').value) |
4917 | 933 | 933 | ||
4918 | 934 | def test_realm_for_vhosts(self): | 934 | def test_realm_for_vhosts(self): |
4919 | 935 | browser = Browser() | 935 | browser = Browser() |
4920 | @@ -937,9 +937,9 @@ | |||
4921 | 937 | # At this point browser.contents contains a hidden form which would've | 937 | # At this point browser.contents contains a hidden form which would've |
4922 | 938 | # been auto-submitted if we had in-browser JS support, but since we | 938 | # been auto-submitted if we had in-browser JS support, but since we |
4923 | 939 | # don't we can easily inspect what's in the form. | 939 | # don't we can easily inspect what's in the form. |
4927 | 940 | self.assertEquals('%s' | 940 | self.assertEqual('%s' |
4928 | 941 | % self.layer.appserver_root_url(ensureSlash=True), | 941 | % self.layer.appserver_root_url(ensureSlash=True), |
4929 | 942 | browser.getControl(name='openid.realm').value) | 942 | browser.getControl(name='openid.realm').value) |
4930 | 943 | 943 | ||
4931 | 944 | 944 | ||
4932 | 945 | def test_suite(): | 945 | def test_suite(): |
4933 | 946 | 946 | ||
4934 | === modified file 'lib/lp/services/webapp/tests/test_login_account.py' | |||
4935 | --- lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 10:54:31 +0000 | |||
4936 | +++ lib/lp/services/webapp/tests/test_login_account.py 2018-01-02 16:24:23 +0000 | |||
4937 | @@ -119,23 +119,22 @@ | |||
4938 | 119 | 119 | ||
4939 | 120 | # The view should have redirected us, with no actual response body. | 120 | # The view should have redirected us, with no actual response body. |
4940 | 121 | 121 | ||
4943 | 122 | self.assertEquals(self.request.response.getStatus(), 302) | 122 | self.assertEqual(self.request.response.getStatus(), 302) |
4944 | 123 | self.assertEquals(result, '') | 123 | self.assertEqual(result, '') |
4945 | 124 | 124 | ||
4946 | 125 | # We are redirecting to Loggerhead, to ask it to logout. | 125 | # We are redirecting to Loggerhead, to ask it to logout. |
4947 | 126 | 126 | ||
4948 | 127 | location = lazr.uri.URI(self.request.response.getHeader('location')) | 127 | location = lazr.uri.URI(self.request.response.getHeader('location')) |
4952 | 128 | self.assertEquals(location.host, 'bazaar.launchpad.dev') | 128 | self.assertEqual(location.host, 'bazaar.launchpad.dev') |
4953 | 129 | self.assertEquals(location.scheme, 'https') | 129 | self.assertEqual(location.scheme, 'https') |
4954 | 130 | self.assertEquals(location.path, '/+logout') | 130 | self.assertEqual(location.path, '/+logout') |
4955 | 131 | 131 | ||
4956 | 132 | # That page should then redirect to our OpenId provider to logout, | 132 | # That page should then redirect to our OpenId provider to logout, |
4957 | 133 | # which we provide in our query string. See | 133 | # which we provide in our query string. See |
4958 | 134 | # launchpad_loggerhead.tests.TestLogout for the pertinent tests. | 134 | # launchpad_loggerhead.tests.TestLogout for the pertinent tests. |
4959 | 135 | 135 | ||
4960 | 136 | query = cgi.parse_qs(location.query) | 136 | query = cgi.parse_qs(location.query) |
4963 | 137 | self.assertEquals( | 137 | self.assertEqual(query['next_to'][0], 'http://testopenid.dev/+logout') |
4962 | 138 | query['next_to'][0], 'http://testopenid.dev/+logout') | ||
4964 | 139 | 138 | ||
4965 | 140 | def test_logging_in_and_logging_out_the_old_way(self): | 139 | def test_logging_in_and_logging_out_the_old_way(self): |
4966 | 141 | # A test showing that we can authenticate a request that had the | 140 | # A test showing that we can authenticate a request that had the |
4967 | 142 | 141 | ||
4968 | === modified file 'lib/lp/services/webapp/tests/test_menu.py' | |||
4969 | --- lib/lp/services/webapp/tests/test_menu.py 2013-02-06 04:22:43 +0000 | |||
4970 | +++ lib/lp/services/webapp/tests/test_menu.py 2018-01-02 16:24:23 +0000 | |||
4971 | @@ -51,17 +51,17 @@ | |||
4972 | 51 | newInteraction() | 51 | newInteraction() |
4973 | 52 | menu = TestMenu(object()) | 52 | menu = TestMenu(object()) |
4974 | 53 | menu._get_link('test_link') | 53 | menu._get_link('test_link') |
4976 | 54 | self.assertEquals(menu.times_called, 1) | 54 | self.assertEqual(menu.times_called, 1) |
4977 | 55 | menu._get_link('test_link') | 55 | menu._get_link('test_link') |
4979 | 56 | self.assertEquals(menu.times_called, 2) | 56 | self.assertEqual(menu.times_called, 2) |
4980 | 57 | 57 | ||
4981 | 58 | def test_cache_when_there_is_a_request(self): | 58 | def test_cache_when_there_is_a_request(self): |
4982 | 59 | login(ANONYMOUS) | 59 | login(ANONYMOUS) |
4983 | 60 | menu = TestMenu(object()) | 60 | menu = TestMenu(object()) |
4984 | 61 | menu._get_link('test_link') | 61 | menu._get_link('test_link') |
4986 | 62 | self.assertEquals(menu.times_called, 1) | 62 | self.assertEqual(menu.times_called, 1) |
4987 | 63 | menu._get_link('test_link') | 63 | menu._get_link('test_link') |
4989 | 64 | self.assertEquals(menu.times_called, 1) | 64 | self.assertEqual(menu.times_called, 1) |
4990 | 65 | 65 | ||
4991 | 66 | def test_correct_value_is_cached(self): | 66 | def test_correct_value_is_cached(self): |
4992 | 67 | login(ANONYMOUS) | 67 | login(ANONYMOUS) |
4993 | @@ -69,7 +69,7 @@ | |||
4994 | 69 | link = menu._get_link('test_link') | 69 | link = menu._get_link('test_link') |
4995 | 70 | request = get_current_browser_request() | 70 | request = get_current_browser_request() |
4996 | 71 | cache = request.annotations.get(MENU_ANNOTATION_KEY) | 71 | cache = request.annotations.get(MENU_ANNOTATION_KEY) |
4998 | 72 | self.assertEquals([link], cache.values()) | 72 | self.assertEqual([link], cache.values()) |
4999 | 73 | 73 | ||
5000 | 74 | def test_cache_key_is_unique(self): | 74 | def test_cache_key_is_unique(self): |
The diff has been truncated for viewing.
This is even longer and less interesting than the previous one (it's mostly mechanical assertEquals → assertEqual).