Merge "Remove ordering assumption from functional test"

This commit is contained in:
Jenkins 2016-12-02 09:46:43 +00:00 committed by Gerrit Code Review
commit 7f2299f7e9

View File

@ -297,19 +297,15 @@ class NotifyTestCase(utils.SkipIfNoTransportURL):
for event_type, payload in b_out: for event_type, payload in b_out:
b.info({}, event_type, payload) b.info({}, event_type, payload)
for expected in a_out: def check_received(listener, publisher, messages):
actual = listener_a.events.get(timeout=0.5) actuals = sorted([listener.events.get(timeout=0.5)
self.assertEqual('info', actual[0]) for __ in range(len(a_out))])
self.assertEqual(expected[0], actual[1]) expected = sorted([['info', m[0], m[1], publisher]
self.assertEqual(expected[1], actual[2]) for m in messages])
self.assertEqual('pub-1', actual[3]) self.assertEqual(expected, actuals)
for expected in b_out: check_received(listener_a, "pub-1", a_out)
actual = listener_b.events.get(timeout=0.5) check_received(listener_b, "pub-2", b_out)
self.assertEqual('info', actual[0])
self.assertEqual(expected[0], actual[1])
self.assertEqual(expected[1], actual[2])
self.assertEqual('pub-2', actual[3])
def test_all_categories(self): def test_all_categories(self):
listener = self.useFixture(utils.NotificationFixture( listener = self.useFixture(utils.NotificationFixture(