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

[tor-commits] [nyx/master] Tests only passed in the pacific time zone



commit 38e56d7600b2258239ac1110baef0c984a93363a
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Sep 28 22:15:15 2015 +0200

    Tests only passed in the pacific time zone
    
    Part of our log entries render messages with a local timestamp. Can't assert
    against those, so just matching against the message portion.
---
 test/util/log/read_tor_log.py |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/util/log/read_tor_log.py b/test/util/log/read_tor_log.py
index 7f84c41..60e3762 100644
--- a/test/util/log/read_tor_log.py
+++ b/test/util/log/read_tor_log.py
@@ -1,7 +1,7 @@
 import os
 import unittest
 
-from nyx.util.log import LogEntry, read_tor_log
+from nyx.util.log import read_tor_log
 
 
 def data_path(filename):
@@ -13,16 +13,16 @@ class TestReadTorLog(unittest.TestCase):
     entries = list(read_tor_log(data_path('tor_log')))
     self.assertEqual(21, len(entries))
 
-    self.assertEqual(LogEntry(1333738426, 'NOTICE', 'Interrupt: exiting cleanly.'), entries[0])
-    self.assertEqual(LogEntry(1333735419, 'NOTICE', 'Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) opening new log file.'), entries[-1])
+    self.assertEqual('Interrupt: exiting cleanly.', entries[0].message)
+    self.assertEqual('Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) opening new log file.', entries[-1].message)
 
   def test_with_multiple_tor_instances(self):
     entries = list(read_tor_log(data_path('multiple_tor_instances')))
     self.assertEqual(12, len(entries))
 
-    self.assertEqual(LogEntry(1333738434, 'DEBUG', 'parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)'), entries[0])
-    self.assertEqual(LogEntry(1333738434, 'INFO', 'tor_lockfile_lock(): Locking "/home/atagar/.tor/lock"'), entries[1])
-    self.assertEqual(LogEntry(1333738434, 'NOTICE', 'Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) opening log file.'), entries[-1])
+    self.assertEqual('parse_dir_authority_line(): Trusted 100 dirserver at 128.31.0.39:9131 (9695)', entries[0].message)
+    self.assertEqual('tor_lockfile_lock(): Locking "/home/atagar/.tor/lock"', entries[1].message)
+    self.assertEqual('Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) opening log file.', entries[-1].message)
 
   def test_with_read_limit(self):
     entries = list(read_tor_log(data_path('tor_log'), 5))



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