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):
built_update_line.getResource())
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(),
built_subscription_line.getResource())
......
......@@ -661,7 +661,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type="Person",
user_id=user_id)
self.assertNotEquals(person, None)
self.assertNotEqual(person, None)
# User received an email for payment
email = person.getDefaultEmailText()
......@@ -694,7 +694,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
portal_type="Person",
user_id=user_id)
self.assertNotEquals(person, None)
self.assertNotEqual(person, None)
# User received an email for payment
email = person.getDefaultEmailText()
......
......@@ -147,8 +147,8 @@ The slapos team
ticket, event = person.Person_checkToCreateRegularisationRequest()
transaction.commit()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None)
self.assertNotEquals(event, None)
self.assertNotEqual(ticket, None)
self.assertNotEqual(event, None)
self.assertEqual(ticket2, None)
self.assertEqual(event2, None)
......@@ -169,8 +169,8 @@ The slapos team
transaction.commit()
self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None)
self.assertNotEquals(event, None)
self.assertNotEqual(ticket, None)
self.assertNotEqual(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None)
......@@ -182,8 +182,8 @@ The slapos team
transaction.commit()
self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket, None)
self.assertNotEquals(event, None)
self.assertNotEqual(ticket, None)
self.assertNotEqual(event, None)
self.assertEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertEqual(event2, None)
......@@ -195,8 +195,8 @@ The slapos team
transaction.commit()
self.tic()
ticket2, event2 = person.Person_checkToCreateRegularisationRequest()
self.assertNotEquals(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertNotEquals(event2, None)
self.assertNotEqual(ticket2.getRelativeUrl(), ticket.getRelativeUrl())
self.assertNotEqual(event2, None)
def test_addRegularisationRequest_REQUEST_disallowed(self):
person = self.makePerson(index=0, user=0)
......@@ -347,7 +347,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
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.getSimulationState(), 'draft')
self.assertEqual(event.getRelativeUrl(), event2.getRelativeUrl())
......@@ -379,7 +379,7 @@ class TestSlapOSRegularisationRequest_checkToSendUniqEvent(SlapOSTestCaseMixin):
transaction.commit()
event2 = ticket.RegularisationRequest_checkToSendUniqEvent(
'service_module/slapos_crm_spam', 'foo2 title', 'foo2 content', 'foo2 comment')
self.assertNotEquals(event, event2)
self.assertNotEqual(event, event2)
self.assertEqual(event2, None)
def test_checkToSendUniqEvent_REQUEST_disallowed(self):
......
......@@ -107,7 +107,7 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
module = self.portal.support_request_module
# We assume here that several objects created by others tests don't influentiate
# this test.
self.assertEquals(module.SupportRequestModule_getMonitoringUrlList(), [])
self.assertEqual(module.SupportRequestModule_getMonitoringUrlList(), [])
hosting_subscription = self._makeHostingSubscription()
self._makeSoftwareInstance(hosting_subscription, "https://xxx/")
support_request = module.newContent(portal_type="Support Request")
......@@ -669,7 +669,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(TestCRMSkinsMixin):
self.tic()
self.assertEqual(computer.getAllocationScope(), 'open/personal')
#ticket = self._getGeneratedSupportRequest(computer)
self.assertNotEquals(None, ticket)
self.assertNotEqual(None, ticket)
self.assertEqual(ticket.getSimulationState(), 'suspended')
self.assertEqual('Visited by SupportRequest_trySendNotificationMessage ' \
......@@ -1800,7 +1800,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, first_event.getTitle())
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",
first_event.getResource())
self.assertEqual(first_event.getDestination(), person.getRelativeUrl())
......@@ -1814,7 +1814,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, event.getTitle())
self.assertEqual(text_content, event.getTextContent())
self.assertNotEquals(None, event.getStartDate())
self.assertNotEqual(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information",
event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl())
......@@ -1827,7 +1827,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(event.getTitle(), title)
self.assertEqual(text_content, event.getTextContent())
self.assertNotEquals(None, event.getStartDate())
self.assertNotEqual(None, event.getStartDate())
self.assertEqual("service_module/slapos_crm_information",
event.getResource())
self.assertEqual(event.getDestination(), person.getRelativeUrl())
......@@ -1853,7 +1853,7 @@ class TestSupportRequestTrySendNotificationMessage(SlapOSTestCaseMixin):
self.assertEqual(title, another_first_event.getTitle())
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",
another_first_event.getResource())
self.assertEqual(another_first_event.getDestination(), person.getRelativeUrl())
......
......@@ -38,9 +38,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope=allocation_scope)
self.commit()
self.assertEquals(computer.getCapacityScope(), 'close')
self.assertEquals(computer.getMonitorScope(), 'enabled')
self.assertEquals(computer.getUpgradeScope(), expected_upgrade_scope)
self.assertEqual(computer.getCapacityScope(), 'close')
self.assertEqual(computer.getMonitorScope(), 'enabled')
self.assertEqual(computer.getUpgradeScope(), expected_upgrade_scope)
return computer
def test_Computer_setAllocationScope_public_no_source_adm(self):
......@@ -79,8 +79,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_public(
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [''])
self.assertEquals(computer.getDestinationSection(), None)
self.assertEqual(computer.getSubjectList(), [''])
self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_subscription_with_source_adm(self):
person = self.makePerson()
......@@ -90,8 +90,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration=person.getRelativeUrl(),
allocation_scope="open/subscription")
self.assertEquals(computer.getSubjectList(), [''])
self.assertEquals(computer.getDestinationSection(), None)
self.assertEqual(computer.getSubjectList(), [''])
self.assertEqual(computer.getDestinationSection(), None)
def _test_Computer_setAllocationScope_personal(self,
......@@ -109,29 +109,29 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope='open/personal')
self.commit()
self.assertEquals(computer.getCapacityScope(), 'open')
self.assertEquals(computer.getMonitorScope(), 'disabled')
self.assertEqual(computer.getCapacityScope(), 'open')
self.assertEqual(computer.getMonitorScope(), 'disabled')
return computer
def test_Computer_setAllocationScope_personal(self):
computer = self._test_Computer_setAllocationScope_personal()
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None)
self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(computer.getSubjectList(), [])
self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_upgrade_disabled(self):
computer = self._test_Computer_setAllocationScope_personal(
upgrade_scope="disabled")
self.assertEquals(computer.getUpgradeScope(), 'disabled')
self.assertEquals(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None)
self.assertEqual(computer.getUpgradeScope(), 'disabled')
self.assertEqual(computer.getSubjectList(), [])
self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_upgrade_auto(self):
computer = self._test_Computer_setAllocationScope_personal(
upgrade_scope="auto")
self.assertEquals(computer.getUpgradeScope(), 'auto')
self.assertEquals(computer.getSubjectList(), [])
self.assertEquals(computer.getDestinationSection(), None)
self.assertEqual(computer.getUpgradeScope(), 'auto')
self.assertEqual(computer.getSubjectList(), [])
self.assertEqual(computer.getDestinationSection(), None)
def test_Computer_setAllocationScope_personal_with_source_adm(self):
person = self.makePerson()
......@@ -141,9 +141,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_personal(
source_administration=person.getRelativeUrl(),
)
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_Computer_setAllocationScope_personal_with_subject_list(self):
......@@ -155,9 +155,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
source_administration=person.getRelativeUrl(),
subject_list=["some@example.com"]
)
self.assertEquals(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getUpgradeScope(), 'ask_confirmation')
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def _test_Computer_setAllocationScope_friend(self,
......@@ -179,9 +179,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope='open/friend')
self.commit()
self.assertEquals(computer.getCapacityScope(), 'open')
self.assertEquals(computer.getMonitorScope(), 'enabled')
self.assertEquals(computer.getUpgradeScope(), expected_upgrade_scope)
self.assertEqual(computer.getCapacityScope(), 'open')
self.assertEqual(computer.getMonitorScope(), 'enabled')
self.assertEqual(computer.getUpgradeScope(), expected_upgrade_scope)
return computer
def test_Computer_setAllocationScope_friend_no_source_adm(self):
......@@ -204,8 +204,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_friend(
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_Computer_setAllocationScope_friend_with_subject_list(self):
......@@ -221,7 +221,7 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
self.assertSameSet(computer.getSubjectList(),
['some@example.com', person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
......@@ -241,9 +241,9 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer.edit(allocation_scope=allocation_scope)
self.commit()
self.assertEquals(computer.getCapacityScope(), 'close')
self.assertEquals(computer.getMonitorScope(), 'disabled')
self.assertEquals(computer.getUpgradeScope(), upgrade_scope)
self.assertEqual(computer.getCapacityScope(), 'close')
self.assertEqual(computer.getMonitorScope(), 'disabled')
self.assertEqual(computer.getUpgradeScope(), upgrade_scope)
return computer
......@@ -258,8 +258,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
computer = self._test_Computer_setAllocationScope_closed(
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_termination_no_source_adm(self):
......@@ -276,8 +276,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/termination",
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_outdated_no_source_adm(self):
......@@ -294,8 +294,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/outdated",
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
def test_Computer_setAllocationScope_closed_maintenance_no_source_adm(self):
......@@ -312,8 +312,8 @@ class TestSlapOSERP5InteractionWorkflowComputerSetAllocationScope(
allocation_scope="close/maintenance",
source_administration=person.getRelativeUrl())
self.assertEquals(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEquals(computer.getDestinationSectionList(),
self.assertEqual(computer.getSubjectList(), [person.getDefaultEmailCoordinateText()])
self.assertEqual(computer.getDestinationSectionList(),
[person.getRelativeUrl()])
......
......@@ -141,7 +141,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription = self._makeHostingSubscription()
news_dict = hosting_subscription.HostingSubscription_getNewsDict()
expected_news_dict = {'instance': []}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -150,7 +150,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription.setRootSlave(1)
news_dict = hosting_subscription.HostingSubscription_getNewsDict()
expected_news_dict = {'instance': [], 'is_slave': 1}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -159,7 +159,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription.getSlapState = fakeStopRequestedSlapState
news_dict = hosting_subscription.HostingSubscription_getNewsDict()
expected_news_dict = {'instance': [], 'is_stopped': 1}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -168,7 +168,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
hosting_subscription.getSlapState = fakeDestroyRequestedSlapState
news_dict = hosting_subscription.HostingSubscription_getNewsDict()
expected_news_dict = {'instance': [], 'is_destroyed': 1}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -182,7 +182,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'instance': [{'no_data': 1,
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}]}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -194,7 +194,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
self.changeSkin('Hal')
news_dict = hosting_subscription.HostingSubscription_getNewsDict()
expected_news_dict = {'instance': []}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -214,7 +214,7 @@ class TestHostingSubscription_getNewsDict(TestSlapOSHalJsonStyleMixin):
{'no_data': 1,
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}]}
self.assertEquals(news_dict["instance"], expected_news_dict["instance"])
self.assertEqual(news_dict["instance"], expected_news_dict["instance"])
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -231,7 +231,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state': 'start_requested',
'text': u'#access OK',
u'user': u'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -242,7 +242,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'no_data': 1,
'text': '#error no data found for %s' % instance.getReference(),
'user': 'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -252,7 +252,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'is_slave': 1,
'text': '#nodata is a slave %s' % instance.getReference(),
'user': 'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -265,7 +265,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"text": "#nodata is an stopped instance %s" % instance.getReference(),
"is_stopped": 1
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -278,7 +278,7 @@ class TestSoftwareInstance_getNewsDict(TestSlapOSHalJsonStyleMixin):
"text": "#nodata is an destroyed instance %s" % instance.getReference(),
"is_destroyed": 1
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -295,7 +295,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state': 'start_requested',
'text': u'#access OK',
u'user': u'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -313,7 +313,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state': 'stop_requested',
'text': u'#access OK',
u'user': u'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -331,7 +331,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
'state': 'destroy_requested',
'text': u'#access OK',
u'user': u'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -341,7 +341,7 @@ class TestSoftwareInstallation_getNewsDict(TestSlapOSHalJsonStyleMixin):
expected_news_dict = {'no_data': 1,
'text': '#error no data found for %s' % installation.getReference(),
'user': 'SlapOS Master'}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -361,7 +361,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
u'user': u'SlapOS Master'},
'partition': {}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -382,7 +382,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user': 'SlapOS Master'},
'partition': {}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -403,7 +403,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user': u'SlapOS Master'},
'partition': {}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -416,7 +416,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'user': 'SlapOS Master'},
'partition': {}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -440,7 +440,7 @@ class TestComputer_getNewsDict(TestSlapOSHalJsonStyleMixin):
'text': '#error no data found for %s' % (instance.getReference()),
'user': 'SlapOS Master'}}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -475,7 +475,7 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -484,7 +484,7 @@ class TestComputerNetwork_getNewsDict(TestSlapOSHalJsonStyleMixin):
self._logFakeAccess(network.getReference())
news_dict = network.ComputerNetwork_getNewsDict()
expected_news_dict = {'computer': {}, 'partition': {}}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -521,7 +521,7 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -529,7 +529,7 @@ class TestOrganisation_getNewsDict(TestSlapOSHalJsonStyleMixin):
organisation = self._makeOrganisation()
news_dict = organisation.Organisation_getNewsDict()
expected_news_dict = {'computer': {}, 'partition': {}}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -566,7 +566,7 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
}
}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......@@ -574,7 +574,7 @@ class TestProject_getNewsDict(TestSlapOSHalJsonStyleMixin):
project = self._makeProject()
news_dict = project.Project_getNewsDict()
expected_news_dict = {'computer': {}, 'partition': {}}
self.assertEquals(news_dict, expected_news_dict)
self.assertEqual(news_dict, expected_news_dict)
# Ensure it don't raise error when converting to JSON
json.dumps(news_dict)
......
......@@ -1657,9 +1657,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
xml_fp.seek(0)
got_xml = xml_fp.read()
self.assertNotEquals(created_at, ncreated_at)
self.assertNotEquals(since, ncreated_at)
self.assertEquals(since, created_at)
self.assertNotEqual(created_at, ncreated_at)
self.assertNotEqual(since, ncreated_at)
self.assertEqual(since, created_at)
expected_xml = """\
<?xml version='1.0' encoding='UTF-8'?>
......
......@@ -1123,7 +1123,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertEqual(expected_test_payment_balance,
subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested',
self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState())
# The alarms might be called multiple times for move each step
......@@ -1134,7 +1134,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertEqual(expected_test_payment_balance,
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())
def checkSubscriptionDeploymentAndSimulationWithReversalTransaction(self, default_email_text, subscription_server):
......@@ -1168,7 +1168,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertTrue(
subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested',
self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState())
self.checkStartedSubscriptionRequest(subscription_request,
......@@ -1204,7 +1204,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
self.assertTrue(
subscription_request.SubscriptionRequest_testPaymentBalance())
self.assertEquals('start_requested',
self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState())
self.checkStartedSubscriptionRequest(subscription_request,
......@@ -1219,7 +1219,7 @@ class TestSlapOSSubscriptionScenarioMixin(DefaultScenarioMixin):
default_email_text, self.subscription_condition)
for subscription_request in subscription_request_list:
self.assertEquals('start_requested',
self.assertEqual('start_requested',
subscription_request.getAggregateValue().getSlapState())
# Destroy all instances and process
......
......@@ -48,7 +48,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
alarm = self.portal.portal_alarms.promise_check_upgrade
alarm.solve()
self.tic()
self.assertEquals(alarm.getLastActiveProcess().getResultList(), [])
self.assertEqual(alarm.getLastActiveProcess().getResultList(), [])
bt5_list = self.portal.portal_templates.getInstalledBusinessTemplateTitleList()
self.assertTrue('slapos_erp5' in bt5_list, bt5_list)
......@@ -63,7 +63,7 @@ class TestUpgradeInstanceWithOldDataFs(testSlapOSMixin):
portal_type_class.loadClass()
if issubclass(portal_type_class, ERP5BaseBroken):
error_list.append(portal_type_id)
self.assertEquals(
self.assertEqual(
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):
test_url = "https://lab.nexedi.com/nexedi/slapos/raw/1.0.102/software/slaprunner/software.cfg"
def test_cached_binary(self):
self.assertEquals(0, cache_do_lookup(
self.assertEqual(0, cache_do_lookup(
self.logger,
cache_dir="http://dir.shacache.org",
software_url=self.test_url))
......@@ -90,7 +90,7 @@ class TestCliCache(CliMixin):
self.logger.info.assert_any_call(u'------------------------------------------')
def test_uncached_binary(self):
self.assertEquals(10, cache_do_lookup(
self.assertEqual(10, cache_do_lookup(
self.logger,
cache_dir="http://dir.shacache.org",
software_url="this_is_uncached_url"))
......@@ -98,7 +98,7 @@ class TestCliCache(CliMixin):
self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url')
def test_bad_cache_dir(self):
self.assertEquals(10, cache_do_lookup(
self.assertEqual(10, cache_do_lookup(
self.logger,
cache_dir="http://xxx.shacache.org",
software_url=self.test_url))
......@@ -112,7 +112,7 @@ class TestCliCacheSource(CliMixin):
test_url = "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.17.1.tar.xz"
def test_cached_source(self):
self.assertEquals(0, cache_source_do_lookup(
self.assertEqual(0, cache_source_do_lookup(
self.logger,
cache_dir="http://dir.shacache.org",
url=self.test_url))
......@@ -147,7 +147,7 @@ class TestCliCacheSource(CliMixin):
'------------')
def test_uncached_binary(self):
self.assertEquals(10, cache_source_do_lookup(
self.assertEqual(10, cache_source_do_lookup(
self.logger,
cache_dir="http://dir.shacache.org",
url="this_is_uncached_url"))
......@@ -155,7 +155,7 @@ class TestCliCacheSource(CliMixin):
self.logger.critical.assert_any_call('Object not in cache: %s', 'this_is_uncached_url')
def test_bad_cache_dir(self):
self.assertEquals(10, cache_source_do_lookup(
self.assertEqual(10, cache_source_do_lookup(
self.logger,
cache_dir="http://xxx.shacache.org",
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