Commit ecc0d024 authored by Jérome Perrin's avatar Jérome Perrin

tests: stop using old assert methods

parent c304e5bf
...@@ -1336,7 +1336,7 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin): ...@@ -1336,7 +1336,7 @@ class TestSlapOSAggregatedDeliveryBuilder(SlapOSTestCaseMixin):
built_update_line.getResource()) built_update_line.getResource())
self.assertEqual(1.0, built_subscription_line.getQuantity()) self.assertEqual(1.0, built_subscription_line.getQuantity())
self.assertAlmostEquals(0.0, built_subscription_line.getPrice(), 3) self.assertAlmostEqual(0.0, built_subscription_line.getPrice(), 3)
self.assertEqual(subscription_line.getResource(), self.assertEqual(subscription_line.getResource(),
built_subscription_line.getResource()) built_subscription_line.getResource())
......
...@@ -661,7 +661,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -661,7 +661,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type="Person", portal_type="Person",
user_id=user_id) user_id=user_id)
self.assertNotEquals(person, None) self.assertNotEqual(person, None)
# User received an email for payment # User received an email for payment
email = person.getDefaultEmailText() email = person.getDefaultEmailText()
...@@ -694,7 +694,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -694,7 +694,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type="Person", portal_type="Person",
user_id=user_id) user_id=user_id)
self.assertNotEquals(person, None) self.assertNotEqual(person, None)
# User received an email for payment # User received an email for payment
email = person.getDefaultEmailText() email = person.getDefaultEmailText()
......
...@@ -147,8 +147,8 @@ The slapos team ...@@ -147,8 +147,8 @@ The slapos team
ticket, event = person.Person_checkToCreateRegularisationRequest() ticket, event = person.Person_checkToCreateRegularisationRequest()
transaction.commit() transaction.commit()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None) self.assertNotEqual(ticket, None)
self.assertNotEquals(event, None) self.assertNotEqual(event, None)
self.assertEqual(ticket2, None) self.assertEqual(ticket2, None)
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -169,8 +169,8 @@ The slapos team ...@@ -169,8 +169,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None) self.assertNotEqual(ticket, None)
self.assertNotEquals(event, None) self.assertNotEqual(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -182,8 +182,8 @@ The slapos team ...@@ -182,8 +182,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None) self.assertNotEqual(ticket, None)
self.assertNotEquals(event, None) self.assertNotEqual(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None) self.assertEqual(event2, None)
...@@ -195,8 +195,8 @@ The slapos team ...@@ -195,8 +195,8 @@ The slapos team
transaction.commit() transaction.commit()
self.tic() self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest() ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket2.getRelativeUrl(), ticket.getRelativeUrl()) self.assertNotEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertNotEquals(event2, None) self.assertNotEqual(event2, None)
def test_addRegularisationRequest_REQUEST_disallowed(self): def test_addRegularisationRequest_REQUEST_disallowed(self):
person = self.makePerson(index=0, user=0) person = self.makePerson(index=0, user=0)
...@@ -347,7 +347,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -347,7 +347,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment') 'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
self.assertEqual(ticket.getResource(), 'foo/bar') self.assertEqual(ticket.getResource(), 'foo/bar')
self.assertNotEquals(event.getTitle(), 'foo2 title') self.assertNotEqual(event.getTitle(), 'foo2 title')
self.assertEqual(event.getTextContent(), None) self.assertEqual(event.getTextContent(), None)
self.assertEqual(event.getSimulationState(), 'draft') self.assertEqual(event.getSimulationState(), 'draft')
self.assertEqual(event.getRelativeUrl(), event2.getRelativeUrl()) self.assertEqual(event.getRelativeUrl(), event2.getRelativeUrl())
...@@ -379,7 +379,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin): ...@@ -379,7 +379,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
transaction.commit() transaction.commit()
event2 = ticket.RegularisationRequest_checkToSendUniqEvent( event2 = ticket.RegularisationRequest_checkToSendUniqEvent(
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment') 'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
self.assertNotEquals(event, event2) self.assertNotEqual(event, event2)
self.assertEqual(event2, None) self.assertEqual(event2, None)
def test_checkToSendUniqEvent_REQUEST_disallowed(self): def test_checkToSendUniqEvent_REQUEST_disallowed(self):
......
...@@ -107,7 +107,7 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin): ...@@ -107,7 +107,7 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
module = self.portal.support_request_module module = self.portal.support_request_module
# We assume here that several objects created by others tests don't influentiate # We assume here that several objects created by others tests don't influentiate
# this test. # this test.
self.assertEquals(module.SupportRequestModule_getMonitoringUrlList(), []) self.assertEqual(module.SupportRequestModule_getMonitoringUrlList(), [])
hosting_subscription = self._makeHostingSubscription() hosting_subscription = self._makeHostingSubscription()
self._makeSoftwareInstance(hosting_subscription, "https://xxx/") self._makeSoftwareInstance(hosting_subscription, "https://xxx/")
support_request = module.newContent(portal_type="Support Request") support_request = module.newContent(portal_type="Support Request")
...@@ -669,7 +669,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin): ...@@ -669,7 +669,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin):
self.tic() self.tic()
self.assertEqual(computer.getAllocationScope(), 'open/personal') self.assertEqual(computer.getAllocationScope(), 'open/personal')
#ticket = self._getGeneratedSupportRequest(computer) #ticket = self._getGeneratedSupportRequest(computer)
self.assertNotEquals(None, ticket) self.assertNotEqual(None, ticket)
self.assertEqual(ticket.getSimulationState(), 'suspended') self.assertEqual(ticket.getSimulationState(), 'suspended')
self.assertEqual('Visited by SupportRequest_trySendNotificationMessage ' \ self.assertEqual('Visited by SupportRequest_trySendNotificationMessage ' \
...@@ -1800,7 +1800,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -1800,7 +1800,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, first_event.getTitle()) self.assertEqual(title, first_event.getTitle())
self.assertEqual(text_content, first_event.getTextContent()) self.assertEqual(text_content, first_event.getTextContent())
self.assertNotEquals(None, first_event.getStartDate()) self.assertNotEqual(None, first_event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
first_event.getResource()) first_event.getResource())
self.assertEqual(first_event.getDestination(), person.getRelativeUrl()) self.assertEqual(first_event.getDestination(), person.getRelativeUrl())
...@@ -1814,7 +1814,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -1814,7 +1814,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, event.getTitle()) self.assertEqual(title, event.getTitle())
self.assertEqual(text_content, event.getTextContent()) self.assertEqual(text_content, event.getTextContent())
self.assertNotEquals(None, event.getStartDate()) self.assertNotEqual(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
event.getResource()) event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl()) self.assertEqual(event.getDestination(), person.getRelativeUrl())
...@@ -1827,7 +1827,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -1827,7 +1827,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(event.getTitle(), title) self.assertEqual(event.getTitle(), title)
self.assertEqual(text_content, event.getTextContent()) self.assertEqual(text_content, event.getTextContent())
self.assertNotEquals(None, event.getStartDate()) self.assertNotEqual(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
event.getResource()) event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl()) self.assertEqual(event.getDestination(), person.getRelativeUrl())
...@@ -1853,7 +1853,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin): ...@@ -1853,7 +1853,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, another_first_event.getTitle()) self.assertEqual(title, another_first_event.getTitle())
self.assertEqual(text_content, another_first_event.getTextContent()) self.assertEqual(text_content, another_first_event.getTextContent())
self.assertNotEquals(None, another_first_event.getStartDate()) self.assertNotEqual(None, another_first_event.getStartDate())
self.assertEqual("service_module/slapos_crm_information", self.assertEqual("service_module/slapos_crm_information",
another_first_event.getResource()) another_first_event.getResource())
self.assertEqual(another_first_event.getDestination(), person.getRelativeUrl()) self.assertEqual(another_first_event.getDestination(), person.getRelativeUrl())
......
...@@ -38,9 +38,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -38,9 +38,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope=allocation_scope) computer.edit(allocation_scope=allocation_scope)
self.commit() self.commit()
self.assertEquals(computer.getCapacityScope(), 'close') self.assertEqual(computer.getCapacityScope(), 'close')
self.assertEquals(computer.getMonitorScope(), 'enabled') self.assertEqual(computer.getMonitorScope(), 'enabled')
self.assertEquals(computer.getUpgradeScope(), expected_upgrade_scope) self.assertEqual(computer.getUpgradeScope(), expected_upgrade_scope)
return computer return computer
def test_Computer_setAllocationScope_public_no_source_adm(self): def test_Computer_setAllocationScope_public_no_source_adm(self):
...@@ -79,8 +79,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -79,8 +79,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_public( computer = self._test_Computer_setAllocationScope_public(
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), ['']) self.assertEqual(computer.getSubjectList(), [''])
self.assertEquals(computer.getDestinationSection(), None) self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_subscription_with_source_adm(self): def test_Computer_setAllocationScope_subscription_with_source_adm(self):
person = self.makePerson() person = self.makePerson()
...@@ -90,8 +90,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -90,8 +90,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration=person.getRelativeUrl(), source_administration=person.getRelativeUrl(),
allocation_scope="open/subscription") allocation_scope="open/subscription")
self.assertEquals(computer.getSubjectList(), ['']) self.assertEqual(computer.getSubjectList(), [''])
self.assertEquals(computer.getDestinationSection(), None) self.assertEqual(computer.getDestinationSection(), None)
def _test_Computer_setAllocationScope_personal(self, def _test_Computer_setAllocationScope_personal(self,
...@@ -109,29 +109,29 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -109,29 +109,29 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope='open/personal') computer.edit(allocation_scope='open/personal')
self.commit() self.commit()
self.assertEquals(computer.getCapacityScope(), 'open') self.assertEqual(computer.getCapacityScope(), 'open')
self.assertEquals(computer.getMonitorScope(), 'disabled') self.assertEqual(computer.getMonitorScope(), 'disabled')
return computer return computer
def test_Computer_setAllocationScope_personal(self): def test_Computer_setAllocationScope_personal(self):
computer = self._test_Computer_setAllocationScope_personal() computer = self._test_Computer_setAllocationScope_personal()
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation') self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), []) self.assertEqual(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None) self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_upgrade_disabled(self): def test_Computer_setAllocationScope_personal_upgrade_disabled(self):
computer = self._test_Computer_setAllocationScope_personal( computer = self._test_Computer_setAllocationScope_personal(
upgrade_scope="disabled") upgrade_scope="disabled")
self.assertEquals(computer.getUpgradeScope(), 'disabled') self.assertEqual(computer.getUpgradeScope(), 'disabled')
self.assertEquals(computer.getSubjectList(), []) self.assertEqual(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None) self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_upgrade_auto(self): def test_Computer_setAllocationScope_personal_upgrade_auto(self):
computer = self._test_Computer_setAllocationScope_personal( computer = self._test_Computer_setAllocationScope_personal(
upgrade_scope="auto") upgrade_scope="auto")
self.assertEquals(computer.getUpgradeScope(), 'auto') self.assertEqual(computer.getUpgradeScope(), 'auto')
self.assertEquals(computer.getSubjectList(), []) self.assertEqual(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None) self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_with_source_adm(self): def test_Computer_setAllocationScope_personal_with_source_adm(self):
person = self.makePerson() person = self.makePerson()
...@@ -141,9 +141,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -141,9 +141,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_personal( computer = self._test_Computer_setAllocationScope_personal(
source_administration=person.getRelativeUrl(), source_administration=person.getRelativeUrl(),
) )
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation') self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def test_Computer_setAllocationScope_personal_with_subject_list(self): def test_Computer_setAllocationScope_personal_with_subject_list(self):
...@@ -155,9 +155,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -155,9 +155,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration=person.getRelativeUrl(), source_administration=person.getRelativeUrl(),
subject_list=["some@example.com"] subject_list=["some@example.com"]
) )
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation') self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def _test_Computer_setAllocationScope_friend(self, def _test_Computer_setAllocationScope_friend(self,
...@@ -179,9 +179,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -179,9 +179,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope='open/friend') computer.edit(allocation_scope='open/friend')
self.commit() self.commit()
self.assertEquals(computer.getCapacityScope(), 'open') self.assertEqual(computer.getCapacityScope(), 'open')
self.assertEquals(computer.getMonitorScope(), 'enabled') self.assertEqual(computer.getMonitorScope(), 'enabled')
self.assertEquals(computer.getUpgradeScope(), expected_upgrade_scope) self.assertEqual(computer.getUpgradeScope(), expected_upgrade_scope)
return computer return computer
def test_Computer_setAllocationScope_friend_no_source_adm(self): def test_Computer_setAllocationScope_friend_no_source_adm(self):
...@@ -204,8 +204,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -204,8 +204,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_friend( computer = self._test_Computer_setAllocationScope_friend(
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def test_Computer_setAllocationScope_friend_with_subject_list(self): def test_Computer_setAllocationScope_friend_with_subject_list(self):
...@@ -221,7 +221,7 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -221,7 +221,7 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
self.assertSameSet(computer.getSubjectList(), self.assertSameSet(computer.getSubjectList(),
['some@example.com', person.getDefaultEmailCoordinateText()]) ['some@example.com', person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
...@@ -241,9 +241,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -241,9 +241,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope=allocation_scope) computer.edit(allocation_scope=allocation_scope)
self.commit() self.commit()
self.assertEquals(computer.getCapacityScope(), 'close') self.assertEqual(computer.getCapacityScope(), 'close')
self.assertEquals(computer.getMonitorScope(), 'disabled') self.assertEqual(computer.getMonitorScope(), 'disabled')
self.assertEquals(computer.getUpgradeScope(), upgrade_scope) self.assertEqual(computer.getUpgradeScope(), upgrade_scope)
return computer return computer
...@@ -258,8 +258,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -258,8 +258,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_closed( computer = self._test_Computer_setAllocationScope_closed(
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_termination_no_source_adm(self): def test_Computer_setAllocationScope_closed_termination_no_source_adm(self):
...@@ -276,8 +276,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -276,8 +276,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/termination", allocation_scope="close/termination",
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_outdated_no_source_adm(self): def test_Computer_setAllocationScope_closed_outdated_no_source_adm(self):
...@@ -294,8 +294,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -294,8 +294,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/outdated", allocation_scope="close/outdated",
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_maintenance_no_source_adm(self): def test_Computer_setAllocationScope_closed_maintenance_no_source_adm(self):
...@@ -312,8 +312,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope( ...@@ -312,8 +312,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/maintenance", allocation_scope="close/maintenance",
source_administration=person.getRelativeUrl()) source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()]) self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(), self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()]) [person.getRelativeUrl()])
......
...@@ -1657,9 +1657,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin): ...@@ -1657,9 +1657,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
xml_fp.seek(0) xml_fp.seek(0)
got_xml = xml_fp.read() got_xml = xml_fp.read()
self.assertNotEquals(created_at, ncreated_at) self.assertNotEqual(created_at, ncreated_at)
self.assertNotEquals(since, ncreated_at) self.assertNotEqual(since, ncreated_at)
self.assertEquals(since, created_at) self.assertEqual(since, created_at)
expected_xml = """\ expected_xml = """\
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
......
...@@ -1123,7 +1123,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1123,7 +1123,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertEqual(expected_test_payment_balance, self.assertEqual(expected_test_payment_balance,
subscription_request.SubscriptionRequest_testPaymentBalance()) subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested', self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState()) subscription_request.getAggregateValue().getSlapState())
# The alarms might be called multiple times for move each step # The alarms might be called multiple times for move each step
...@@ -1134,7 +1134,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1134,7 +1134,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertEqual(expected_test_payment_balance, self.assertEqual(expected_test_payment_balance,
subscription_request.SubscriptionRequest_testPaymentBalance()) subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals(expected_slap_state_after_subscription_is_confirmed, self.assertEqual(expected_slap_state_after_subscription_is_confirmed,
subscription_request.getAggregateValue().getSlapState()) subscription_request.getAggregateValue().getSlapState())
def checkSubscriptionDeploymentAndSimulationWithReversalTransaction(self, default_email_text, subscription_server): def checkSubscriptionDeploymentAndSimulationWithReversalTransaction(self, default_email_text, subscription_server):
...@@ -1168,7 +1168,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1168,7 +1168,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertTrue( self.assertTrue(
subscription_request.SubscriptionRequest_testPaymentBalance()) subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested', self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState()) subscription_request.getAggregateValue().getSlapState())
self.checkStartedSubscriptionRequest(subscription_request, self.checkStartedSubscriptionRequest(subscription_request,
...@@ -1204,7 +1204,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1204,7 +1204,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertTrue( self.assertTrue(
subscription_request.SubscriptionRequest_testPaymentBalance()) subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested', self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState()) subscription_request.getAggregateValue().getSlapState())
self.checkStartedSubscriptionRequest(subscription_request, self.checkStartedSubscriptionRequest(subscription_request,
...@@ -1219,7 +1219,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin): ...@@ -1219,7 +1219,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
default_email_text, self.subscription_condition) default_email_text, self.subscription_condition)
for subscription_request in subscription_request_list: for subscription_request in subscription_request_list:
self.assertEquals('start_requested', self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState()) subscription_request.getAggregateValue().getSlapState())
# Destroy all instances and process # Destroy all instances and process
......
...@@ -48,7 +48,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin): ...@@ -48,7 +48,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
alarm = self.portal.portal_alarms.promise_check_upgrade alarm = self.portal.portal_alarms.promise_check_upgrade
alarm.solve() alarm.solve()
self.tic() self.tic()
self.assertEquals(alarm.getLastActiveProcess().getResultList(), []) self.assertEqual(alarm.getLastActiveProcess().getResultList(), [])
bt5_list = self.portal.portal_templates.getInstalledBusinessTemplateTitleList() bt5_list = self.portal.portal_templates.getInstalledBusinessTemplateTitleList()
self.assertTrue('slapos_erp5' in bt5_list, bt5_list) self.assertTrue('slapos_erp5' in bt5_list, bt5_list)
...@@ -63,7 +63,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin): ...@@ -63,7 +63,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
portal_type_class.loadClass() portal_type_class.loadClass()
if issubclass(portal_type_class, ERP5BaseBroken): if issubclass(portal_type_class, ERP5BaseBroken):
error_list.append(portal_type_id) error_list.append(portal_type_id)
self.assertEquals( self.assertEqual(
error_list, [], error_list, [],
msg="The following Portal Type classes could not be loaded (see zLOG.log): %r" % error_list) msg="The following Portal Type classes could not be loaded (see zLOG.log): %r" % error_list)
......
...@@ -73,7 +73,7 @@ class TestCliCache(CliMixin): ...@@ -73,7 +73,7 @@ class TestCliCache(CliMixin):
test_url = "https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg" test_url = "https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg"
def test_cached_binary(self): def test_cached_binary(self):
self.assertEquals(0, cache_do_lookup( self.assertEqual(0, cache_do_lookup(
self.logger, self.logger,
cache_dir="http://dir.shacache.org", cache_dir="http://dir.shacache.org",
software_url=self.test_url)) software_url=self.test_url))
...@@ -90,7 +90,7 @@ class TestCliCache(CliMixin): ...@@ -90,7 +90,7 @@ class TestCliCache(CliMixin):
self.logger.info.assert_any_call(u'------------------------------------------') self.logger.info.assert_any_call(u'------------------------------------------')
def test_uncached_binary(self): def test_uncached_binary(self):
self.assertEquals(10, cache_do_lookup( self.assertEqual(10, cache_do_lookup(
self.logger, self.logger,
cache_dir="http://dir.shacache.org", cache_dir="http://dir.shacache.org",
software_url="this_is_uncached_url")) software_url="this_is_uncached_url"))
...@@ -98,7 +98,7 @@ class TestCliCache(CliMixin): ...@@ -98,7 +98,7 @@ class TestCliCache(CliMixin):
self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url') self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url')
def test_bad_cache_dir(self): def test_bad_cache_dir(self):
self.assertEquals(10, cache_do_lookup( self.assertEqual(10, cache_do_lookup(
self.logger, self.logger,
cache_dir="http://xxx.shacache.org", cache_dir="http://xxx.shacache.org",
software_url=self.test_url)) software_url=self.test_url))
...@@ -112,7 +112,7 @@ class TestCliCacheSource(CliMixin): ...@@ -112,7 +112,7 @@ class TestCliCacheSource(CliMixin):
test_url = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.17.1.tar.xz" test_url = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.17.1.tar.xz"
def test_cached_source(self): def test_cached_source(self):
self.assertEquals(0, cache_source_do_lookup( self.assertEqual(0, cache_source_do_lookup(
self.logger, self.logger,
cache_dir="http://dir.shacache.org", cache_dir="http://dir.shacache.org",
url=self.test_url)) url=self.test_url))
...@@ -147,7 +147,7 @@ class TestCliCacheSource(CliMixin): ...@@ -147,7 +147,7 @@ class TestCliCacheSource(CliMixin):
'------------') '------------')
def test_uncached_binary(self): def test_uncached_binary(self):
self.assertEquals(10, cache_source_do_lookup( self.assertEqual(10, cache_source_do_lookup(
self.logger, self.logger,
cache_dir="http://dir.shacache.org", cache_dir="http://dir.shacache.org",
url="this_is_uncached_url")) url="this_is_uncached_url"))
...@@ -155,7 +155,7 @@ class TestCliCacheSource(CliMixin): ...@@ -155,7 +155,7 @@ class TestCliCacheSource(CliMixin):
self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url') self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url')
def test_bad_cache_dir(self): def test_bad_cache_dir(self):
self.assertEquals(10, cache_source_do_lookup( self.assertEqual(10, cache_source_do_lookup(
self.logger, self.logger,
cache_dir="http://xxx.shacache.org", cache_dir="http://xxx.shacache.org",
url=self.test_url)) url=self.test_url))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment