Browse Source

Fix listener API's test_create* assertions

Assertions were using the same expressions on both side: optionals and
lb_listener are both parameters to the API (and the lb_listener dict
contains all optionals items).
Those assertions should compare the parameters to the API results.

Change-Id: I6f372a3f82fdf4f41e661e640e4a983cf484ed6d
changes/96/736696/1
Gregory Thiemonge 2 years ago
parent
commit
3ee9bc0d65
  1. 4
      octavia/tests/functional/api/v2/test_listener.py

4
octavia/tests/functional/api/v2/test_listener.py

@ -589,7 +589,7 @@ class TestListener(base.BaseAPITest):
lb_listener.update(extra_expects)
self.assertTrue(uuidutils.is_uuid_like(listener_api.get('id')))
for key, value in optionals.items():
self.assertEqual(value, lb_listener.get(key))
self.assertEqual(value, listener_api.get(key))
lb_listener['id'] = listener_api.get('id')
lb_listener.pop('sni_container_refs')
sni_ex = [sni1, sni2]
@ -930,7 +930,7 @@ class TestListener(base.BaseAPITest):
lb_listener.update(extra_expects)
self.assertTrue(uuidutils.is_uuid_like(listener_api.get('id')))
for key, value in optionals.items():
self.assertEqual(value, lb_listener.get(key))
self.assertEqual(value, listener_api.get(key))
lb_listener['id'] = listener_api.get('id')
self.assertIsNotNone(listener_api.pop('created_at'))
self.assertIsNone(listener_api.pop('updated_at'))

Loading…
Cancel
Save