From c46132a66084b89863a4a3b23faacf52e95de399 Mon Sep 17 00:00:00 2001 From: John Dorlus Date: Fri, 30 Jun 2017 23:07:40 -0400 Subject: [PATCH] Bug 1377346 - Fixed assertion to use local variable r=chutten,rpapa Changed assertion from using harness class ping variable to local variable in test. That way, popping the ping doesn't affect outcome of test. Also check that ping is not None. MozReview-Commit-ID: AEDJmhJHUxv --HG-- extra : rebase_source : 9b4b8ae01a036788b47941b15f5e3b12ae9030cc --- .../marionette/tests/unit/test_ping_server_received_ping.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolkit/components/telemetry/tests/marionette/tests/unit/test_ping_server_received_ping.py b/toolkit/components/telemetry/tests/marionette/tests/unit/test_ping_server_received_ping.py index 8d9c81581477..99d8ea53c714 100644 --- a/toolkit/components/telemetry/tests/marionette/tests/unit/test_ping_server_received_ping.py +++ b/toolkit/components/telemetry/tests/marionette/tests/unit/test_ping_server_received_ping.py @@ -15,6 +15,7 @@ class TestPingServer(TelemetryTestCase): data = {'sender': 'John', 'receiver': 'Joe', 'message': 'We did it!'} headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} json_req = requests.post(self.ping_server_url, data=json.dumps(data), headers=headers) + ping = self.wait_for_ping() + assert ping is not None assert json_req.status_code == 200 - assert len(self.ping_list) == 1 - assert data['sender'] == self.ping_list[-1]['sender'] + assert data['sender'] == ping['sender']