Use repr() for object tests

This plugin is affected by the same bug as for horizon itself:
https://launchpad.net/bugs/2038474

Let's use the same fix.

Change-Id: I1b2cba09e1e738253818b4cb8e94f1b394084a7e
This commit is contained in:
Thomas Goirand 2023-10-05 12:21:51 +02:00
parent 50fa3b071b
commit 1a49ed8643
1 changed files with 10 additions and 5 deletions

View File

@ -255,7 +255,8 @@ class VPNTests(test.TestCase):
self.assertEqual(workflow.name, workflows.AddVPNService.name)
expected_objs = ['<AddVPNServiceStep: addvpnserviceaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
self.assertQuerysetEqual(list(map(repr, workflow.steps)),
expected_objs)
self.mock_network_list_for_tenant.assert_called_once_with(
helpers.IsHttpRequest(), self.tenant.id)
@ -331,7 +332,8 @@ class VPNTests(test.TestCase):
self.assertEqual(workflow.name, workflows.AddEndpointGroup.name)
expected_objs = ['<AddEndpointGroupStep: addendpointgroupaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
self.assertQuerysetEqual(list(map(repr, workflow.steps)),
expected_objs)
self.mock_network_list_for_tenant.assert_called_once_with(
helpers.IsHttpRequest(), self.tenant.id)
@ -389,7 +391,8 @@ class VPNTests(test.TestCase):
self.assertEqual(workflow.name, workflows.AddIKEPolicy.name)
expected_objs = ['<AddIKEPolicyStep: addikepolicyaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
self.assertQuerysetEqual(list(map(repr, workflow.steps)),
expected_objs)
@helpers.create_mocks({api_vpn: ('ikepolicy_create', )})
def test_add_ikepolicy_post(self):
@ -448,7 +451,8 @@ class VPNTests(test.TestCase):
self.assertEqual(workflow.name, workflows.AddIPsecPolicy.name)
expected_objs = ['<AddIPsecPolicyStep: addipsecpolicyaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
self.assertQuerysetEqual(list(map(repr, workflow.steps)),
expected_objs)
@helpers.create_mocks({api_vpn: ('ipsecpolicy_create', )})
def test_add_ipsecpolicy_post(self):
@ -525,7 +529,8 @@ class VPNTests(test.TestCase):
'addipsecsiteconnectionaction>',
'<AddIPsecSiteConnectionOptionalStep: '
'addipsecsiteconnectionoptionalaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
self.assertQuerysetEqual(list(map(repr, workflow.steps)),
expected_objs)
self.mock_ikepolicy_list.assert_called_once_with(
helpers.IsHttpRequest(),