Commit 175b5788 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

CLEANUP: use assertEqual instead of assertEquals

assertEquals is deprecated, see https://docs.python.org/2.7/library/unittest.html#deprecated-aliases

/reviewed-on nexedi/slapos.core!58
parent 52c634f5
......@@ -1095,11 +1095,11 @@ class TestSlapOSStartConfirmedAggregatedSalePackingListAlarm(
self.portal.portal_workflow._jumpToStateFor(delivery, 'solved')
self.portal.portal_workflow._jumpToStateFor(delivery, 'confirmed')
delivery.Delivery_startConfirmedAggregatedSalePackingList()
self.assertEquals(delivery.getStartDate(),
self.assertEqual(delivery.getStartDate(),
DateTime().earliestTime())
self.assertEquals(delivery.getStopDate(),
self.assertEqual(delivery.getStopDate(),
DateTime().earliestTime())
self.assertEquals(delivery.getSimulationState(), 'started')
self.assertEqual(delivery.getSimulationState(), 'started')
class TestSlapOSDeliverStartedAggregatedSalePackingListAlarm(
SlapOSTestCaseMixin):
......
......@@ -495,27 +495,27 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
# Check simulation movement property
self.assertEqual(movement_start_date, simulation_movement.getStartDate())
self.assertEqual(movement_stop_date, simulation_movement.getStopDate())
self.assertEquals(self.open_order_line.getQuantity(),
self.assertEqual(self.open_order_line.getQuantity(),
simulation_movement.getQuantity())
self.assertEquals(self.open_order_line.getQuantityUnit(),
self.assertEqual(self.open_order_line.getQuantityUnit(),
simulation_movement.getQuantityUnit())
self.assertEquals(self.open_order_line.getPrice(),
self.assertEqual(self.open_order_line.getPrice(),
simulation_movement.getPrice())
self.assertEquals(self.open_order_line.getPriceCurrency(),
self.assertEqual(self.open_order_line.getPriceCurrency(),
simulation_movement.getPriceCurrency())
self.assertEquals(self.open_order_line.getSource(),
self.assertEqual(self.open_order_line.getSource(),
simulation_movement.getSource())
self.assertEquals(self.open_order_line.getSourceSection(),
self.assertEqual(self.open_order_line.getSourceSection(),
simulation_movement.getSourceSection())
self.assertEquals(self.open_order_line.getDestination(),
self.assertEqual(self.open_order_line.getDestination(),
simulation_movement.getDestination())
self.assertEquals(self.open_order_line.getDestinationSection(),
self.assertEqual(self.open_order_line.getDestinationSection(),
simulation_movement.getDestinationSection())
self.assertEquals(self.open_order_line.getSpecialise(),
self.assertEqual(self.open_order_line.getSpecialise(),
simulation_movement.getSpecialise())
self.assertEquals(self.open_order_line.getResource(),
self.assertEqual(self.open_order_line.getResource(),
simulation_movement.getResource())
self.assertEquals(applied_rule.getSpecialiseValue().getTradePhaseList(),
self.assertEqual(applied_rule.getSpecialiseValue().getTradePhaseList(),
simulation_movement.getTradePhaseList())
self.assertSameSet(self.open_order_line.getAggregateList(),
simulation_movement.getAggregateList())
......@@ -611,27 +611,27 @@ class TestHostingSubscriptionSimulation(SlapOSTestCaseMixin):
# Check simulation movement property
self.assertEqual(movement_start_date, simulation_movement.getStartDate())
self.assertEqual(movement_stop_date, simulation_movement.getStopDate())
self.assertEquals(self.open_order_line.getQuantity(),
self.assertEqual(self.open_order_line.getQuantity(),
simulation_movement.getQuantity())
self.assertEquals(self.open_order_line.getQuantityUnit(),
self.assertEqual(self.open_order_line.getQuantityUnit(),
simulation_movement.getQuantityUnit())
self.assertEquals(self.open_order_line.getPrice(),
self.assertEqual(self.open_order_line.getPrice(),
simulation_movement.getPrice())
self.assertEquals(self.open_order_line.getPriceCurrency(),
self.assertEqual(self.open_order_line.getPriceCurrency(),
simulation_movement.getPriceCurrency())
self.assertEquals(self.open_order_line.getSource(),
self.assertEqual(self.open_order_line.getSource(),
simulation_movement.getSource())
self.assertEquals(self.open_order_line.getSourceSection(),
self.assertEqual(self.open_order_line.getSourceSection(),
simulation_movement.getSourceSection())
self.assertEquals(self.open_order_line.getDestination(),
self.assertEqual(self.open_order_line.getDestination(),
simulation_movement.getDestination())
self.assertEquals(self.open_order_line.getDestinationSection(),
self.assertEqual(self.open_order_line.getDestinationSection(),
simulation_movement.getDestinationSection())
self.assertEquals(self.open_order_line.getSpecialise(),
self.assertEqual(self.open_order_line.getSpecialise(),
simulation_movement.getSpecialise())
self.assertEquals(self.open_order_line.getResource(),
self.assertEqual(self.open_order_line.getResource(),
simulation_movement.getResource())
self.assertEquals(applied_rule.getSpecialiseValue().getTradePhaseList(),
self.assertEqual(applied_rule.getSpecialiseValue().getTradePhaseList(),
simulation_movement.getTradePhaseList())
self.assertSameSet(self.open_order_line.getAggregateList(),
simulation_movement.getAggregateList())
......
......@@ -144,7 +144,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
new_indexation_timestamp = portal.portal_catalog(
uid=order.getUid(),
select_dict={'indexation_timestamp': None})[0].indexation_timestamp
self.assertEquals(new_indexation_timestamp,
self.assertEqual(new_indexation_timestamp,
indexation_timestamp)
def test_OpenSaleOrder_reindexIfIndexedBeforeLine_line_indexed_after(self):
......@@ -184,7 +184,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
new_indexation_timestamp = portal.portal_catalog(
uid=order.getUid(),
select_dict={'indexation_timestamp': None})[0].indexation_timestamp
self.assertEquals(new_indexation_timestamp,
self.assertEqual(new_indexation_timestamp,
indexation_timestamp)
def test_OpenSaleOrder_reindexIfIndexedBeforeLine_REQUEST_disallowed(self):
......
......@@ -60,18 +60,18 @@ class TestSlapOSComputer_reportComputerConsumption(SlapOSTestCaseMixinWithAbort)
document_relative_url = computer.Computer_reportComputerConsumption(
new_id, consumption_xml)
document = self.portal.restrictedTraverse(document_relative_url)
self.assertEquals(document.getPortalType(),
self.assertEqual(document.getPortalType(),
"Computer Consumption TioXML File")
self.assertEquals(document.getSourceReference(), new_id)
self.assertEquals(document.getTitle(),
self.assertEqual(document.getSourceReference(), new_id)
self.assertEqual(document.getTitle(),
"%s consumption (%s)" % (computer.getReference(), new_id))
self.assertNotEquals(document.getReference(), "")
self.assertEquals(document.getVersion(), "1")
self.assertEquals(document.getData(), consumption_xml)
self.assertEquals(document.getClassification(), "personal")
self.assertEquals(document.getPublicationSection(), "other")
self.assertEquals(document.getValidationState(), "submitted")
self.assertEquals(document.getContributor(), computer.getRelativeUrl())
self.assertEqual(document.getVersion(), "1")
self.assertEqual(document.getData(), consumption_xml)
self.assertEqual(document.getClassification(), "personal")
self.assertEqual(document.getPublicationSection(), "other")
self.assertEqual(document.getValidationState(), "submitted")
self.assertEqual(document.getContributor(), computer.getRelativeUrl())
def test_reportComputerConsumption_reported_twice(self):
new_id = self.generateNewId()
......@@ -110,20 +110,20 @@ class TestSlapOSComputer_reportComputerConsumption(SlapOSTestCaseMixinWithAbort)
new_id, consumption_xml)
document2 = self.portal.restrictedTraverse(document2_relative_url)
self.assertEquals(document2.getPortalType(),
self.assertEqual(document2.getPortalType(),
"Computer Consumption TioXML File")
self.assertEquals(document2.getSourceReference(),
self.assertEqual(document2.getSourceReference(),
document1.getSourceReference())
self.assertEquals(document2.getTitle(), document1.getTitle())
self.assertEquals(document2.getReference(), document1.getReference())
self.assertEquals(document1.getVersion(), "1")
self.assertEquals(document2.getVersion(), "2")
self.assertEquals(document2.getData(), consumption_xml)
self.assertEquals(document2.getClassification(), "personal")
self.assertEquals(document2.getPublicationSection(), "other")
self.assertEquals(document1.getValidationState(), "submitted")
self.assertEquals(document2.getValidationState(), "submitted")
self.assertEquals(document2.getContributor(), computer.getRelativeUrl())
self.assertEqual(document2.getTitle(), document1.getTitle())
self.assertEqual(document2.getReference(), document1.getReference())
self.assertEqual(document1.getVersion(), "1")
self.assertEqual(document2.getVersion(), "2")
self.assertEqual(document2.getData(), consumption_xml)
self.assertEqual(document2.getClassification(), "personal")
self.assertEqual(document2.getPublicationSection(), "other")
self.assertEqual(document1.getValidationState(), "submitted")
self.assertEqual(document2.getValidationState(), "submitted")
self.assertEqual(document2.getContributor(), computer.getRelativeUrl())
class TestSlapOSComputerConsumptionTioXMLFile_parseXml(SlapOSTestCaseMixinWithAbort):
......
......@@ -415,8 +415,8 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
self._makeTree()
self._makeComputer()
self.assertEquals(self.computer.getAllocationScope(), "open/public")
self.assertEquals(self.computer.getCapacityScope(), "open")
self.assertEqual(self.computer.getAllocationScope(), "open/public")
self.assertEqual(self.computer.getCapacityScope(), "open")
self._installSoftware(self.computer,
self.software_instance.getUrlString())
......@@ -824,11 +824,11 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by S
self._makeTree()
self._makeComputer()
self.assertEquals(self.computer.getAllocationScope(), "open/public")
self.assertEquals(self.computer.getCapacityScope(), "open")
self.assertEqual(self.computer.getAllocationScope(), "open/public")
self.assertEqual(self.computer.getCapacityScope(), "open")
self.computer.edit(**{base_category: computer_category})
self.assertEquals(self.computer.getAllocationScope(), "open/public")
self.assertEquals(self.computer.getCapacityScope(), "open")
self.assertEqual(self.computer.getAllocationScope(), "open/public")
self.assertEqual(self.computer.getCapacityScope(), "open")
self._installSoftware(self.computer,
self.software_instance.getUrlString())
......
......@@ -391,7 +391,7 @@ class TestSlapOSCorePersonComputerSupply(SlapOSTestCaseMixin):
# Login as new user
self.login(person_user.getUserId())
new_person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
self.assertEquals(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
def beforeTearDown(self):
if 'software_installation_url' in self.computer.REQUEST:
......@@ -1046,7 +1046,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.instance.requestStop(**request_kw)
connection_xml = self.generateSafeXml()
self.instance.updateConnection(connection_xml=connection_xml)
self.assertEquals(self.instance.getConnectionXml(), connection_xml)
self.assertEqual(self.instance.getConnectionXml(), connection_xml)
transaction.abort()
def test_updateConnectionRequired(self):
......@@ -1920,7 +1920,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self.login(person_user.getUserId())
new_person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
self.assertEquals(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
def beforeTearDown(self):
pass
......@@ -2055,7 +2055,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state="started",
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("start_requested", hosting_subscription.getSlapState())
self.assertEqual("start_requested", hosting_subscription.getSlapState())
person.requestSoftwareInstance(
software_release=software_release,
......@@ -2067,7 +2067,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state="stopped",
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("stop_requested", hosting_subscription.getSlapState())
self.assertEqual("stop_requested", hosting_subscription.getSlapState())
person.requestSoftwareInstance(
software_release=software_release,
......@@ -2079,7 +2079,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state="destroyed",
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals(None, hosting_subscription)
self.assertEqual(None, hosting_subscription)
def test_Person_requestSoftwareInstance_returnHostingSubscriptionUrl(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -2105,7 +2105,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state=state,
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("Hosting Subscription",
self.assertEqual("Hosting Subscription",
hosting_subscription.getPortalType())
def test_Person_requestSoftwareInstance_createHostingSubscription(self):
......@@ -2136,17 +2136,17 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state=state,
)
hosting_subscription = person.REQUEST.get('request_hosting_subscription')
self.assertEquals(software_release,
self.assertEqual(software_release,
hosting_subscription.getUrlString())
self.assertEquals(software_title, hosting_subscription.getTitle())
self.assertEquals(software_type, hosting_subscription.getSourceReference())
self.assertEquals(instance_xml, hosting_subscription.getTextContent())
self.assertEquals(sla_xml, hosting_subscription.getSlaXml())
self.assertEquals(shared, hosting_subscription.getRootSlave())
self.assertEquals("start_requested", hosting_subscription.getSlapState())
self.assertEquals("HOSTSUBS-%s" % (previous_id+1),
self.assertEqual(software_title, hosting_subscription.getTitle())
self.assertEqual(software_type, hosting_subscription.getSourceReference())
self.assertEqual(instance_xml, hosting_subscription.getTextContent())
self.assertEqual(sla_xml, hosting_subscription.getSlaXml())
self.assertEqual(shared, hosting_subscription.getRootSlave())
self.assertEqual("start_requested", hosting_subscription.getSlapState())
self.assertEqual("HOSTSUBS-%s" % (previous_id+1),
hosting_subscription.getReference())
self.assertEquals("validated", hosting_subscription.getValidationState())
self.assertEqual("validated", hosting_subscription.getValidationState())
def test_Person_requestSoftwareInstance_HostingSubscriptionNotReindexed(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -2237,20 +2237,20 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
)
hosting_subscription2 = person.REQUEST.get('request_hosting_subscription')
self.assertEquals(hosting_subscription.getRelativeUrl(),
self.assertEqual(hosting_subscription.getRelativeUrl(),
hosting_subscription2.getRelativeUrl())
self.assertEquals(hosting_subscription_reference,
self.assertEqual(hosting_subscription_reference,
hosting_subscription2.getReference())
self.assertEquals(software_release2,
self.assertEqual(software_release2,
hosting_subscription.getUrlString())
self.assertEquals(software_title, hosting_subscription.getTitle())
self.assertEquals(software_type2, hosting_subscription.getSourceReference())
self.assertEquals(instance_xml2, hosting_subscription.getTextContent())
self.assertEquals(sla_xml2, hosting_subscription.getSlaXml())
self.assertEquals(shared2, hosting_subscription.getRootSlave())
self.assertEquals("stop_requested", hosting_subscription.getSlapState())
self.assertEquals("validated", hosting_subscription.getValidationState())
self.assertEqual(software_title, hosting_subscription.getTitle())
self.assertEqual(software_type2, hosting_subscription.getSourceReference())
self.assertEqual(instance_xml2, hosting_subscription.getTextContent())
self.assertEqual(sla_xml2, hosting_subscription.getSlaXml())
self.assertEqual(shared2, hosting_subscription.getRootSlave())
self.assertEqual("stop_requested", hosting_subscription.getSlapState())
self.assertEqual("validated", hosting_subscription.getValidationState())
def test_Person_requestSoftwareInstance_duplicatedHostingSubscription(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -2352,15 +2352,15 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
self.assertNotEquals(hosting_subscription.getReference(),
hosting_subscription2.getReference())
self.assertEquals(software_release2,
self.assertEqual(software_release2,
hosting_subscription2.getUrlString())
self.assertEquals(software_title2, hosting_subscription2.getTitle())
self.assertEquals(software_type2, hosting_subscription2.getSourceReference())
self.assertEquals(instance_xml2, hosting_subscription2.getTextContent())
self.assertEquals(sla_xml2, hosting_subscription2.getSlaXml())
self.assertEquals(shared2, hosting_subscription2.getRootSlave())
self.assertEquals("stop_requested", hosting_subscription2.getSlapState())
self.assertEquals("validated", hosting_subscription2.getValidationState())
self.assertEqual(software_title2, hosting_subscription2.getTitle())
self.assertEqual(software_type2, hosting_subscription2.getSourceReference())
self.assertEqual(instance_xml2, hosting_subscription2.getTextContent())
self.assertEqual(sla_xml2, hosting_subscription2.getSlaXml())
self.assertEqual(shared2, hosting_subscription2.getRootSlave())
self.assertEqual("stop_requested", hosting_subscription2.getSlapState())
self.assertEqual("validated", hosting_subscription2.getValidationState())
def test_Person_requestSoftwareInstance_deletedHostingSubscription(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -2398,8 +2398,8 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state="destroyed",
)
hosting_subscription2 = person.REQUEST.get('request_hosting_subscription')
self.assertEquals(None, hosting_subscription2)
self.assertEquals("destroy_requested", hosting_subscription.getSlapState())
self.assertEqual(None, hosting_subscription2)
self.assertEqual("destroy_requested", hosting_subscription.getSlapState())
def test_Person_requestSoftwareInstance_noConflictWithDeletedHostingSubscription(self):
person = self.getPortalObject().ERP5Site_getAuthenticatedMemberPersonValue()
......@@ -2435,7 +2435,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
shared=shared,
state="destroyed",
)
self.assertEquals("destroy_requested", hosting_subscription.getSlapState())
self.assertEqual("destroy_requested", hosting_subscription.getSlapState())
transaction.commit()
self.tic()
......@@ -2449,7 +2449,7 @@ class TestSlapOSCorePersonRequest(SlapOSTestCaseMixin):
state="started",
)
hosting_subscription2 = person.REQUEST.get('request_hosting_subscription')
self.assertEquals("start_requested", hosting_subscription2.getSlapState())
self.assertEqual("start_requested", hosting_subscription2.getSlapState())
self.assertNotEquals(hosting_subscription.getRelativeUrl(),
hosting_subscription2.getRelativeUrl())
......@@ -2468,7 +2468,7 @@ class TestSlapOSCorePersonRequestComputer(SlapOSTestCaseMixin):
# Login as new user
self.login(person_user.getUserId())
new_person = portal.ERP5Site_getAuthenticatedMemberPersonValue()
self.assertEquals(person_user.getRelativeUrl(), new_person.getRelativeUrl())
self.assertEqual(person_user.getRelativeUrl(), new_person.getRelativeUrl())
def beforeTearDown(self):
pass
......
......@@ -19,41 +19,41 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
def testConfiguredModuleGeneratorIDViaConstraint(self):
""" Make sure Generator ID is well configured, in this
case we trust on promise outcome."""
self.assertEquals(self.portal.portal_ids.checkConsistency(), [])
self.assertEqual(self.portal.portal_ids.checkConsistency(), [])
self.portal.person_module.setIdGenerator("_Id_fake")
self.assertNotEquals(self.portal.portal_ids.checkConsistency(), [])
self.portal.portal_ids.fixConsistency()
self.assertEquals(self.portal.portal_ids.checkConsistency(), [])
self.assertEquals(self.portal.person_module.getIdGenerator(),
self.assertEqual(self.portal.portal_ids.checkConsistency(), [])
self.assertEqual(self.portal.person_module.getIdGenerator(),
"_generatePerDayId")
def testConfiguredShacacheWebSite(self):
""" Make sure Shacache WebSite is setuped by Alarm
case we trust on promise outcome."""
self.assertEquals(self.portal.web_site_module.checkConsistency(), [])
self.assertEqual(self.portal.web_site_module.checkConsistency(), [])
def testConfiguredCacheViaConstraint(self):
""" Make sure Volitile and Persistent Cache was configured well,
invoking the consistency to check """
self.assertEquals(self.portal.portal_memcached.checkConsistency(), [])
self.assertEqual(self.portal.portal_memcached.checkConsistency(), [])
def testConfiguredConversionServerViaConstraint(self):
""" Make sure Conversion Server was configured well,
invoking checkConsistency """
self.assertEquals(self.portal.portal_preferences.checkConsistency(), [])
self.assertEqual(self.portal.portal_preferences.checkConsistency(), [])
def testConfiguredCertificateAuthoringConstraint(self):
"""Make sure Certificate Authoring was configured well,
invoking checkConsistency.
Make sure PAS is well configured."""
self.assertEquals(self.portal.portal_certificate_authority.checkConsistency(), [])
self.assertEqual(self.portal.portal_certificate_authority.checkConsistency(), [])
def testConfiguredTemplateToolViaConstraint(self):
""" Make sure Template Tool Repositories was configured well,
invoking checkConsistency """
self.assertEquals(
self.assertEqual(
[ i for i in self.portal.portal_templates.checkConsistency()
if "(reinstall)" not in i.message], [])
......@@ -72,7 +72,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
memcached_tool = self.getPortal().portal_memcached
connection_dict = _getVolatileMemcachedServerDict()
url_string = 'erp5-memcached-volatile:%(port)s' % connection_dict
self.assertEquals(memcached_tool.default_memcached_plugin.getUrlString(),
self.assertEqual(memcached_tool.default_memcached_plugin.getUrlString(),
url_string)
def testConfiguredPersistentCache(self):
......@@ -89,7 +89,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
memcached_tool = self.getPortal().portal_memcached
connection_dict = _getPersistentMemcachedServerDict()
url_string = 'erp5-memcached-persistent:%(port)s' % connection_dict
self.assertEquals(memcached_tool.persistent_memcached_plugin.getUrlString(),
self.assertEqual(memcached_tool.persistent_memcached_plugin.getUrlString(),
url_string)
def testConfiguredConversionServer(self):
......@@ -106,7 +106,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
# set preference
preference_tool = self.portal.portal_preferences
conversion_url = _getConversionServerUrl()
self.assertEquals(preference_tool.getPreferredDocumentConversionServerUrl(), conversion_url)
self.assertEqual(preference_tool.getPreferredDocumentConversionServerUrl(), conversion_url)
def testConfiguredCertificateAuthoring(self):
""" Make sure Certificate Authoting is
......@@ -119,7 +119,7 @@ class TestSlapOSConfigurator(SlapOSTestCaseMixin):
return
self.assertTrue(self.portal.hasObject('portal_certificate_authority'))
self.assertEquals(os.environ['TEST_CA_PATH'],
self.assertEqual(os.environ['TEST_CA_PATH'],
self.portal.portal_certificate_authority.certificate_authority_path)
def testModuleHasIdGeneratorByDay(self):
......
......@@ -42,7 +42,7 @@ context.edit(description=description)""")
reference="ACTPROC-%s" % new_id,
description="Active Process %s" % new_id,
)
self.assertEquals(active_process.getCreationDate(), date)
self.assertEqual(active_process.getCreationDate(), date)
self._simulateActiveProcess_deleteSelf()
try:
......
......@@ -527,7 +527,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin):
# is covered by unit tests
packing_list_line_list = subscription.getAggregateRelatedValueList(
portal_type='Sale Packing List Line')
self.assertEquals(len(packing_list_line_list), 1)
self.assertEqual(len(packing_list_line_list), 1)
for packing_list_line in packing_list_line_list:
packing_list = packing_list_line.getParentValue()
self.assertEqual('Sale Packing List',
......@@ -936,7 +936,7 @@ class TestSlapOSDefaultCRMEscalation(DefaultScenarioMixin):
# is covered by unit tests
packing_list_line_list = subscription.getAggregateRelatedValueList(
portal_type='Sale Packing List Line')
self.assertEquals(len(packing_list_line_list), 1)
self.assertEqual(len(packing_list_line_list), 1)
for packing_list_line in packing_list_line_list:
packing_list = packing_list_line.getParentValue()
self.assertEqual('Sale Packing List',
......
......@@ -37,7 +37,7 @@ class TestSlapOSGroupRoleSecurityMixin(SlapOSTestCaseMixinWithAbort):
self._acquirePermissions(context))
def assertSecurityGroup(self, context, security_group_list, acquired):
self.assertEquals(acquired, context._getAcquireLocalRoles())
self.assertEqual(acquired, context._getAcquireLocalRoles())
self.assertSameSet(
security_group_list,
self._getLocalRoles(context)
......
......@@ -72,8 +72,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
body="",
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
home_page_hal = json.loads(response.read())
#####################################################
......@@ -101,8 +101,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
body="",
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
user_hal = json.loads(response.read())
#####################################################
......@@ -134,7 +134,7 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 201)
self.assertEqual(response.status, 201)
self.tic()
......@@ -158,8 +158,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
subscription_collection_hal = json.loads(response.read())
#####################################################
......@@ -180,8 +180,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
subscription_hal = json.loads(response.read())
#####################################################
......@@ -204,8 +204,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
instance_collection_hal = json.loads(response.read())
#####################################################
......@@ -226,8 +226,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
instance_hal = json.loads(response.read())
#####################################################
......@@ -251,8 +251,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
self.tic()
......@@ -276,8 +276,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
news_hal = json.loads(response.read())
# We are going to check computer and software
......@@ -315,8 +315,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
computer_collection_hal = json.loads(response.read())
#####################################################
......@@ -337,8 +337,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
computer_hal = json.loads(response.read())
#####################################################
......@@ -361,8 +361,8 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
software_collection_hal = json.loads(response.read())
#####################################################
......@@ -382,7 +382,7 @@ class TestSlapOSHypermediaPersonScenario(SlapOSTestCaseMixin):
body="",
)
response = connection.getresponse()
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.getheader('Content-Type'), content_type)
software_hal = json.loads(response.read())
......@@ -438,8 +438,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
body="",
)
response = connection.getresponse()
self.assertEquals(response.status, 200, response)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200, response)
self.assertEqual(response.getheader('Content-Type'), content_type)
home_page_hal = json.loads(response.read())
#####################################################
......@@ -467,8 +467,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
body="",
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
instance_hal = json.loads(response.read())
#####################################################
......@@ -492,8 +492,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
self.tic()
......@@ -517,8 +517,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
self.tic()
......@@ -543,8 +543,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
subscription_hal = json.loads(response.read())
self.tic()
......@@ -567,8 +567,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
subscription_hal = json.loads(response.read())
self.tic()
......@@ -593,8 +593,8 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
instance_collection_hal = json.loads(response.read())
#####################################################
......@@ -615,7 +615,7 @@ class TestSlapOSHypermediaInstanceScenario(SlapOSTestCaseMixin):
)
response = connection.getresponse()
self.assertEquals(response.status, 200)
self.assertEquals(response.getheader('Content-Type'), content_type)
self.assertEqual(response.status, 200)
self.assertEqual(response.getheader('Content-Type'), content_type)
instance_hal = json.loads(response.read())
......@@ -153,8 +153,8 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
transaction.PaymentTransaction_startPayzenPayment()
finally:
self._dropPaymentTransaction_getTotalPayablePrice()
self.assertEquals(transaction.getSimulationState(), simulation_state)
self.assertEquals(transaction.getModificationDate(), modification_date)
self.assertEqual(transaction.getSimulationState(), simulation_state)
self.assertEqual(transaction.getModificationDate(), modification_date)
def test_not_payzen_payment(self):
new_id = self.generateNewId()
......@@ -171,8 +171,8 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
transaction.PaymentTransaction_startPayzenPayment()
finally:
self._dropPaymentTransaction_getTotalPayablePrice()
self.assertEquals(transaction.getSimulationState(), simulation_state)
self.assertEquals(transaction.getModificationDate(), modification_date)
self.assertEqual(transaction.getSimulationState(), simulation_state)
self.assertEqual(transaction.getModificationDate(), modification_date)
def test_zero_amount_payment(self):
new_id = self.generateNewId()
......@@ -191,8 +191,8 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
transaction.PaymentTransaction_startPayzenPayment()
finally:
self._dropPaymentTransaction_getTotalPayablePrice()
self.assertEquals(transaction.getSimulationState(), simulation_state)
self.assertEquals(transaction.getModificationDate(), modification_date)
self.assertEqual(transaction.getSimulationState(), simulation_state)
self.assertEqual(transaction.getModificationDate(), modification_date)
def test_expected_payment(self):
new_id = self.generateNewId()
......@@ -209,7 +209,7 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
transaction.PaymentTransaction_startPayzenPayment()
finally:
self._dropPaymentTransaction_getTotalPayablePrice()
self.assertEquals(transaction.getSimulationState(), 'started')
self.assertEqual(transaction.getSimulationState(), 'started')
class TestSlapOSPayzenUpdateStartedPayment(SlapOSTestCaseMixinWithAbort):
......@@ -225,8 +225,8 @@ class TestSlapOSPayzenUpdateStartedPayment(SlapOSTestCaseMixinWithAbort):
simulation_state = transaction.getSimulationState()
modification_date = transaction.getModificationDate()
transaction.PaymentTransaction_updateStatus()
self.assertEquals(transaction.getSimulationState(), simulation_state)
self.assertEquals(transaction.getModificationDate(), modification_date)
self.assertEqual(transaction.getSimulationState(), simulation_state)
self.assertEqual(transaction.getModificationDate(), modification_date)
def test_not_payzen_payment(self):
new_id = self.generateNewId()
......@@ -239,8 +239,8 @@ class TestSlapOSPayzenUpdateStartedPayment(SlapOSTestCaseMixinWithAbort):
simulation_state = transaction.getSimulationState()
modification_date = transaction.getModificationDate()
transaction.PaymentTransaction_updateStatus()
self.assertEquals(transaction.getSimulationState(), simulation_state)
self.assertEquals(transaction.getModificationDate(), modification_date)
self.assertEqual(transaction.getSimulationState(), simulation_state)
self.assertEqual(transaction.getModificationDate(), modification_date)
def test_not_registered_payment(self):
new_id = self.generateNewId()
......@@ -253,7 +253,7 @@ class TestSlapOSPayzenUpdateStartedPayment(SlapOSTestCaseMixinWithAbort):
self.portal.portal_workflow._jumpToStateFor(transaction, 'started')
transaction.PaymentTransaction_updateStatus()
self.assertEquals(transaction.getSimulationState(), 'started')
self.assertEqual(transaction.getSimulationState(), 'started')
def _simulatePaymentTransaction_createPaidPayzenEvent(self):
script_name = 'PaymentTransaction_createPayzenEvent'
......@@ -322,7 +322,7 @@ return Foo()
self.assertEqual(
"",
transaction.workflow_history['edit_workflow'][-2]['comment'])
self.assertEquals(transaction.getSimulationState(), 'stopped')
self.assertEqual(transaction.getSimulationState(), 'stopped')
def test_not_paid_payment(self):
new_id = self.generateNewId()
......@@ -346,7 +346,7 @@ return Foo()
self.assertEqual(
'Visited by PaymentTransaction_createPayzenEvent',
transaction.workflow_history['edit_workflow'][-1]['comment'])
self.assertEquals(transaction.getSimulationState(), 'started')
self.assertEqual(transaction.getSimulationState(), 'started')
def _simulatePaymentTransaction_updateStatus(self):
script_name = 'PaymentTransaction_updateStatus'
......
......@@ -172,7 +172,7 @@ class TestSlapOSPayzenInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
self.assertNotEquals(transaction_id, None)
# Event state
self.assertEquals(event.getValidationState(), "acknowledged")
self.assertEqual(event.getValidationState(), "acknowledged")
data_dict = {
'vads_language': 'en',
......@@ -228,7 +228,7 @@ class TestSlapOSPayzenInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
# Event message state
event_message_list = event.contentValues(portal_type="Payzen Event Message")
self.assertEquals(len(event_message_list), 1)
self.assertEqual(len(event_message_list), 1)
message = event_message_list[0]
self.assertEqual(message.getTitle(), 'Shown Page')
self.assertEqual(message.getTextContent(), expected_html_page,
......@@ -259,8 +259,8 @@ class TestSlapOSPayzenInterfaceWorkflow(SlapOSTestCaseMixinWithAbort):
def mockSoapGetInfo(self, method_to_call, expected_args, result_tuple):
payment_service = self.portal.portal_secure_payments.slapos_payzen_test
def mocksoad_getInfo(arg1, arg2):
self.assertEquals(arg1, expected_args[0])
self.assertEquals(arg2, expected_args[1])
self.assertEqual(arg1, expected_args[0])
self.assertEqual(arg2, expected_args[1])
return result_tuple
setattr(payment_service, 'soap_getInfo', mocksoad_getInfo)
try:
......@@ -312,17 +312,17 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by P
self._dropPayzenEvent_processUpdate()
event_message_list = event.contentValues(portal_type="Payzen Event Message")
self.assertEquals(len(event_message_list), 2)
self.assertEqual(len(event_message_list), 2)
sent_message = [x for x in event_message_list \
if x.getTitle() == 'Sent SOAP'][0]
self.assertEquals(sent_message.getTextContent(), mocked_sent_text)
self.assertEqual(sent_message.getTextContent(), mocked_sent_text)
received_message = [x for x in event_message_list \
if x.getTitle() == 'Received SOAP'][0]
self.assertEquals(received_message.getPredecessor(),
self.assertEqual(received_message.getPredecessor(),
sent_message.getRelativeUrl())
self.assertEquals(received_message.getTextContent(), mocked_received_text)
self.assertEqual(received_message.getTextContent(), mocked_received_text)
self.assertEqual(
'Visited by PayzenEvent_processUpdate',
......
......@@ -672,10 +672,10 @@ class TestSlapOSSlapToolComputerAccess(TestSlapOSSlapToolMixin):
self._makeComplexComputer()
self.login(self.computer_user_id)
destroy_requested = self.destroy_requested_software_installation
self.assertEquals(destroy_requested.getValidationState(), "validated")
self.assertEqual(destroy_requested.getValidationState(), "validated")
self.portal_slap.destroyedSoftwareRelease(
destroy_requested.getUrlString(), self.computer_id)
self.assertEquals(destroy_requested.getValidationState(), "invalidated")
self.assertEqual(destroy_requested.getValidationState(), "invalidated")
def test_availableSoftwareRelease(self):
self._makeComplexComputer()
......
......@@ -1429,7 +1429,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
portal_type=self.computer_portal_type,
reference=computer_reference,
)
self.assertEquals(0, len(result_list))
self.assertEqual(0, len(result_list))
def stepCheckUnauthorizedSlapGetComputerPartitionListCall(self, sequence,
**kw):
......@@ -2040,7 +2040,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
computer_partition_list = computer.getComputerPartitionList()
self.assertEquals(computer_partition_amount,
self.assertEqual(computer_partition_amount,
len(computer_partition_list))
def stepCheckSuccessComputerPartitionGetIdCall(self, sequence, **kw):
......@@ -2053,7 +2053,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap.initializeConnection(self.server_url, timeout=None)
computer_partition = self.slap.registerComputerPartition(
computer_guid, partition_id)
self.assertEquals(partition_id, computer_partition.getId())
self.assertEqual(partition_id, computer_partition.getId())
def stepCheckSuccessSoftwareReleaseGetURICall(self, sequence, **kw):
"""
......@@ -2063,7 +2063,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
software_release = self.slap.registerSoftwareRelease(url)
self.assertEquals(url, software_release.getURI())
self.assertEqual(url, software_release.getURI())
def stepCheckUnauthorizedComputerGetSoftwareReleaseListCall(self, sequence,
**kw):
......@@ -2085,7 +2085,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
self.assertEquals([], [q for q in computer.getSoftwareReleaseList() \
self.assertEqual([], [q for q in computer.getSoftwareReleaseList() \
if q.getState() != 'destroyed'])
def stepCheckDestroyedStateGetSoftwareReleaseListCall(self, sequence, **kw):
......@@ -2097,7 +2097,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
self.assertEquals(1, len(computer.getSoftwareReleaseList()))
self.assertEqual(1, len(computer.getSoftwareReleaseList()))
software_release = computer.getSoftwareReleaseList()[0]
self.assertEqual('destroyed', software_release.getState())
......@@ -2110,7 +2110,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slap = slap.slap()
self.slap.initializeConnection(self.server_url, timeout=None)
computer = self.slap.registerComputer(computer_guid)
self.assertEquals(1, len(computer.getSoftwareReleaseList()))
self.assertEqual(1, len(computer.getSoftwareReleaseList()))
self.assertTrue(isinstance(computer.getSoftwareReleaseList()[0],
slap.SoftwareRelease))
......@@ -2313,7 +2313,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
url = sequence["software_release_uri"]
software_release = computer_partition.getSoftwareRelease()
self.assertTrue(isinstance(software_release, slap.SoftwareRelease))
self.assertEquals(url, software_release.getURI())
self.assertEqual(url, software_release.getURI())
def stepCheckSuccessComputerPartitionGetInstanceParameterDictCall(self,
sequence, **kw):
......@@ -2450,7 +2450,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = self.slap.registerComputerPartition(
computer_guid, partition_id)
self.assertEquals('stopped', computer_partition.getState())
self.assertEqual('stopped', computer_partition.getState())
def stepCheckStartedComputerPartitionGetStateCall(self, sequence, **kw):
"""
......@@ -2463,7 +2463,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = self.slap.registerComputerPartition(
computer_guid, partition_id)
self.assertEquals('started', computer_partition.getState())
self.assertEqual('started', computer_partition.getState())
def stepCheckDestroyedComputerPartitionGetStateCall(self, sequence, **kw):
"""
......@@ -2477,7 +2477,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = self.slap.registerComputerPartition(
computer_guid, partition_id)
self.assertEquals('destroyed', computer_partition.getState())
self.assertEqual('destroyed', computer_partition.getState())
def stepCheckComputerPartitionIsFree(self, sequence, **kw):
computer_partition_uid = sequence["computer_partition_uid"]
......@@ -2707,22 +2707,22 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
self.slave_instance_portal_type,
self.software_instance_portal_type,
self.software_instance_portal_type]
self.assertEquals(expected_portal_type_list, sorted(portal_type_list))
self.assertEqual(expected_portal_type_list, sorted(portal_type_list))
computer_partition_list = [obj.getAggregateValue(
portal_type=self.computer_partition_portal_type) \
for obj in sale_packing_list_line_list]
uid_list = [computer_partition.getUid() \
for computer_partition in computer_partition_list]
self.assertEquals(1, len(set(uid_list)))
self.assertEqual(1, len(set(uid_list)))
def stepCheckSlaveInstanceReady(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
self.assertEquals(self.slave_instance_portal_type,
self.assertEqual(self.slave_instance_portal_type,
slave_instance.getPortalType())
sale_order_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_order_line_portal_type)
self.assertEquals("confirmed", sale_order_line.getSimulationState())
self.assertEqual("confirmed", sale_order_line.getSimulationState())
sale_packing_list_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type)
self.assertNotEquals(sale_packing_list_line.getAggregate(
......@@ -2743,12 +2743,12 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
software_release_uri = sale_packing_list_line.getResultValue(
portal_type="Software Release")
software_release_uri_list.append(software_release_uri.getUrlString())
self.assertEquals(1, len(set(software_release_uri_list)))
self.assertEqual(1, len(set(software_release_uri_list)))
def stepCheckSlaveInstanceAllocationWithTwoDifferentSoftwareInstance(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
uid=sequence['software_instance_uid'])
self.assertEquals(self.slave_instance_portal_type,
self.assertEqual(self.slave_instance_portal_type,
slave_instance.getPortalType())
sale_packing_list_line = slave_instance.getAggregateRelatedValue(
portal_type=self.sale_packing_list_line_portal_type)
......@@ -2759,9 +2759,9 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition_list = [obj.getAggregate(
portal_type=self.computer_partition_portal_type)\
for obj in sale_packing_list_line_list]
self.assertEquals(computer_partition_list[0],
self.assertEqual(computer_partition_list[0],
computer_partition_list[1])
self.assertEquals(4, len(computer_partition_list))
self.assertEqual(4, len(computer_partition_list))
def stepCheckSlaveInstanceNotReady(self, sequence):
slave_instance = self.portal.portal_catalog.getResultValue(
......@@ -2786,7 +2786,7 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
partition_id)
parameter_dict = computer_partition.getInstanceParameterDict()
slave_instance_list = parameter_dict["slave_instance_list"]
self.assertEquals([], slave_instance_list)
self.assertEqual([], slave_instance_list)
def stepCheckSlaveInstanceListFromOneComputerPartition(self, sequence,
expected_amount=1):
......@@ -2797,14 +2797,14 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
computer_partition = self.slap.registerComputerPartition(computer_guid,
partition_id)
parameter_dict = computer_partition.getInstanceParameterDict()
self.assertEquals(
self.assertEqual(
sequence.get('requested_software_type',
'requested_software_type'),
parameter_dict["slap_software_type"])
slave_instance_list = parameter_dict["slave_instance_list"]
self.assertEquals(expected_amount, len(slave_instance_list))
self.assertEqual(expected_amount, len(slave_instance_list))
for slave_instance in slave_instance_list:
self.assertEquals(
self.assertEqual(
sequence.get('requested_software_type',
'requested_software_type'),
slave_instance["slap_software_type"])
......
......@@ -175,7 +175,7 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
'query' : sequence['start'],
'range' : 'min'})
self.assertEquals(len(sale_packing_list_list), 1)
self.assertEqual(len(sale_packing_list_list), 1)
sale_packing_list = sale_packing_list_list[0]
sequence['sale_packing_list'] = sale_packing_list
......@@ -194,7 +194,7 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
xml = etree.tostring(etree.XML(xml, parser))
sequence.edit(check_quantity='first')
self.assertEquals(xml, initial_xml)
self.assertEqual(xml, initial_xml)
def stepCheckSaleInvoiceExists(self, sequence, **kw):
"""
......@@ -213,11 +213,11 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
'query' : sequence['start'],
'range' : 'min'})
self.assertEquals(len(sale_invoice_list), self.sale_invoice_list_quantity)
self.assertEqual(len(sale_invoice_list), self.sale_invoice_list_quantity)
for sale_invoice in sale_invoice_list:
self.assertEquals(sale_invoice.getTitle(), 'Resource consumptions')
self.assertEquals(sale_invoice.getSimulationState(), 'planned')
self.assertEqual(sale_invoice.getTitle(), 'Resource consumptions')
self.assertEqual(sale_invoice.getSimulationState(), 'planned')
sequence.edit(sale_invoice_list=sale_invoice_list)
......@@ -227,18 +227,18 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
"""
# We retrieve the sale invoice
sale_invoice = sequence['sale_invoice_list']
self.assertEquals(len(sale_invoice), self.sale_invoice_list_quantity)
self.assertEqual(len(sale_invoice), self.sale_invoice_list_quantity)
sale_invoice_line_list = sale_invoice[0].getObject().contentValues(
portal_type='Invoice Line')
self.assertEquals(
self.assertEqual(
len(sale_invoice_line_list),
self.sale_invoice_line_list_quantity)
# Then, we check quantities in sale invoice's lines
for sale_invoice_line in sale_invoice_line_list:
self.assertEquals(
self.assertEqual(
sale_invoice_line.getQuantity(),
self.sale_invoice_line_quantity)
......@@ -279,7 +279,7 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
# We retrieve sale invoice list
sale_invoice_list = sequence['sale_invoice_list']
self.assertEquals(len(sale_invoice_list), self.sale_invoice_list_quantity)
self.assertEqual(len(sale_invoice_list), self.sale_invoice_list_quantity)
# We retrieve computer
computer_id = sequence['computer_reference']
......@@ -291,7 +291,7 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
sale_invoice.contentValues(portal_type='Invoice Line')
# We check the number of line in sale invoices
self.assertEquals(
self.assertEqual(
len(sale_invoice_line_list),
self.sale_invoice_line_list_quantity)
......@@ -305,9 +305,9 @@ class TestVifibUsageReportMixin(TestVifibSlapWebServiceMixin):
id = partition_id)[0].getObject().getTitle()
if partition_title == 'slappart0':
self.assertEquals(sale_invoice_line.getQuantity(), quantity1)
self.assertEqual(sale_invoice_line.getQuantity(), quantity1)
else:
self.assertEquals(sale_invoice_line.getQuantity(), quantity2)
self.assertEqual(sale_invoice_line.getQuantity(), quantity2)
class TestVifibUsageReport(TestVifibUsageReportMixin):
......
This diff is collapsed.
......@@ -73,16 +73,16 @@ class TestConfigureLocal(unittest.TestCase):
with open(self.temp_dir + '/slapos-proxy.cfg') as fout:
proxy_config = ConfigParser()
proxy_config.readfp(fout)
self.assertEquals(proxy_config.get('slapos', 'instance_root'),
self.assertEqual(proxy_config.get('slapos', 'instance_root'),
self.instance_root)
self.assertEquals(proxy_config.get('slapos', 'software_root'),
self.assertEqual(proxy_config.get('slapos', 'software_root'),
expected_software_root)
with open(self.temp_dir + '/slapos.cfg') as fout:
proxy_config = ConfigParser()
proxy_config.readfp(fout)
self.assertEquals(proxy_config.get('slapos', 'instance_root'),
self.assertEqual(proxy_config.get('slapos', 'instance_root'),
self.instance_root)
self.assertEquals(proxy_config.get('slapos', 'software_root'),
self.assertEqual(proxy_config.get('slapos', 'software_root'),
expected_software_root)
def test_configure_local_environment(self):
......@@ -102,16 +102,16 @@ class TestConfigureLocal(unittest.TestCase):
with open(self.temp_dir + '/slapos-proxy.cfg') as fout:
proxy_config = ConfigParser()
proxy_config.readfp(fout)
self.assertEquals(proxy_config.get('slapos', 'instance_root'),
self.assertEqual(proxy_config.get('slapos', 'instance_root'),
self.instance_root)
self.assertEquals(proxy_config.get('slapos', 'software_root'),
self.assertEqual(proxy_config.get('slapos', 'software_root'),
self.software_root)
with open(self.temp_dir + '/slapos.cfg') as fout:
proxy_config = ConfigParser()
proxy_config.readfp(fout)
self.assertEquals(proxy_config.get('slapos', 'instance_root'),
self.assertEqual(proxy_config.get('slapos', 'instance_root'),
self.instance_root)
self.assertEquals(proxy_config.get('slapos', 'software_root'),
self.assertEqual(proxy_config.get('slapos', 'software_root'),
self.software_root)
log_file = proxy_config.get('slapformat', 'log_file')
self.assertTrue(log_file.startswith(log_folder),
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ class TestSlap(SlapMixin):
"""
slap_instance = slapos.slap.slap()
slap_instance.initializeConnection(self.server_url)
self.assertEquals(slap_instance._connection_helper.slapgrid_uri, self.server_url)
self.assertEqual(slap_instance._connection_helper.slapgrid_uri, self.server_url)
def test_slap_initialisation_ipv6_and_port(self):
slap_instance = slapos.slap.slap()
......@@ -866,7 +866,7 @@ class TestComputerPartition(SlapMixin):
'software_type', 'mysecondref')
with open(transaction_file_path, 'r') as f:
content_list = f.read().strip().split('\n')
self.assertEquals(list(set(content_list)), ['myref', 'mysecondref'])
self.assertEqual(list(set(content_list)), ['myref', 'mysecondref'])
def _test_new_computer_partition_state(self, state):
"""
......
......@@ -586,7 +586,7 @@ class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
self.assertInstanceDirectoryListEqual([])
self.assertItemsEqual(os.listdir(self.software_root), [])
st = os.stat(os.path.join(self.instance_root, 'var'))
self.assertEquals(stat.S_IMODE(st.st_mode), 0o755)
self.assertEqual(stat.S_IMODE(st.st_mode), 0o755)
def test_one_partition(self):
computer = ComputerForTest(self.software_root, self.instance_root)
......@@ -1989,7 +1989,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
instance.setPromise('promise_%s' % i, promise)
self.assertEqual(self.grid.processComputerPartitionList(),
slapos.grid.slapgrid.SLAPGRID_PROMISE_FAIL)
self.assertEquals(instance.error, 1)
self.assertEqual(instance.error, 1)
self.assertNotEqual('started', instance.state)
def test_one_succeeding_one_timing_out_promises(self):
......@@ -2019,7 +2019,7 @@ class TestSlapgridCPWithMasterPromise(MasterMixin, unittest.TestCase):
self.assertEqual(self.grid.processComputerPartitionList(),
slapos.grid.slapgrid.SLAPGRID_PROMISE_FAIL)
self.assertEquals(instance.error, 1)
self.assertEqual(instance.error, 1)
self.assertNotEqual(instance.state, 'started')
def test_promise_run_if_partition_started_fail(self):
......
......@@ -270,7 +270,7 @@ class TestInformation(BasicMixin, unittest.TestCase):
'/getComputerPartitionCertificate?computer_id=%s&computer_partition_id=%s' % (
self.computer_id, 'slappart0'))
response = xml_marshaller.xml_marshaller.loads(rv.data)
self.assertEquals({'certificate': '', 'key': ''}, response)
self.assertEqual({'certificate': '', 'key': ''}, response)
def test_computerBang(self):
"""
......@@ -278,7 +278,7 @@ class TestInformation(BasicMixin, unittest.TestCase):
"""
rv = self.app.post( '/computerBang?computer_id=%s' % ( self.computer_id))
response = xml_marshaller.xml_marshaller.loads(rv.data)
self.assertEquals('', response)
self.assertEqual('', response)
class MasterMixin(BasicMixin, unittest.TestCase):
"""
......
......@@ -83,28 +83,28 @@ class TestUtil(unittest.TestCase):
uid_check_root_slaptest = os.stat(root_slaptest)[4]
gid_check_root_slaptest = os.stat(root_slaptest)[5]
self.assertEquals(uid, uid_check_root_slaptest)
self.assertEquals(gid, gid_check_root_slaptest)
self.assertEqual(uid, uid_check_root_slaptest)
self.assertEqual(gid, gid_check_root_slaptest)
uid_check_wanted_directory0 = os.stat(wanted_directory0)[4]
gid_check_wanted_directory0 = os.stat(wanted_directory0)[5]
self.assertEquals(uid, uid_check_wanted_directory0)
self.assertEquals(gid, gid_check_wanted_directory0)
self.assertEqual(uid, uid_check_wanted_directory0)
self.assertEqual(gid, gid_check_wanted_directory0)
uid_check_wanted_directory1 = os.stat(wanted_directory1)[4]
gid_check_wanted_directory1 = os.stat(wanted_directory1)[5]
self.assertEquals(uid, uid_check_wanted_directory1)
self.assertEquals(gid, gid_check_wanted_directory1)
self.assertEqual(uid, uid_check_wanted_directory1)
self.assertEqual(gid, gid_check_wanted_directory1)
uid_check_wanted_directory2 = os.stat(wanted_directory2)[4]
gid_check_wanted_directory2 = os.stat(wanted_directory2)[5]
self.assertEquals(uid, uid_check_wanted_directory2)
self.assertEquals(gid, gid_check_wanted_directory2)
self.assertEqual(uid, uid_check_wanted_directory2)
self.assertEqual(gid, gid_check_wanted_directory2)
uid_check_file_txt = os.stat(create_file_txt[1])[4]
gid_check_file_txt = os.stat(create_file_txt[1])[5]
self.assertEquals(uid, uid_check_file_txt)
self.assertEquals(gid, gid_check_file_txt)
self.assertEqual(uid, uid_check_file_txt)
self.assertEqual(gid, gid_check_file_txt)
shutil.rmtree(root_slaptest)
......
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