[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [sbws/master] fix: test: Assert that caplog messages were found



commit e9d5bb084aa0ba9a1e0aaac22b6732ffa3e40623
Author: juga0 <juga@xxxxxxxxxx>
Date:   Mon Mar 23 09:19:08 2020 +0000

    fix: test: Assert that caplog messages were found
---
 tests/unit/lib/test_heartbeat.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/unit/lib/test_heartbeat.py b/tests/unit/lib/test_heartbeat.py
index 5c82a4b..f3d8f52 100644
--- a/tests/unit/lib/test_heartbeat.py
+++ b/tests/unit/lib/test_heartbeat.py
@@ -19,5 +19,9 @@ def test_total_measured_percent(conf, caplog):
     hbeat.print_heartbeat_message()
 
     assert hbeat.previous_measurement_percent == 67
-    caplog.records[1].getMessage().find("Measured in total 2 (67%)")
-    caplog.records[2].getMessage().find("1 relays still not measured")
+    assert 0 == caplog.records[1].getMessage().find(
+        "Measured in total 2 (67%)"
+    )
+    assert 0 == caplog.records[2].getMessage().find(
+        "1 relays still not measured"
+    )



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits