commit 41c722503d94e880884d13ea4615e0cbecff7cc3 Author: hiro hiro@torproject.org Date: Fri Oct 18 13:31:49 2019 +0200
Remove logs and check hid --- gettor/parse/email.py | 5 +++++ gettor/utils/settings.py | 4 ---- tests/test_email_service.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gettor/parse/email.py b/gettor/parse/email.py index 2cb55d5..64cf5a9 100644 --- a/gettor/parse/email.py +++ b/gettor/parse/email.py @@ -153,6 +153,11 @@ class EmailParser(object):
def too_many_requests(self, hid, num_requests, limit): test_hid = self.settings.get("test_hid") + + log.msg( + "test_hid {}".format(test_hid), system="email parser" + ) + if hid == test_hid: return False elif num_requests < limit: diff --git a/gettor/utils/settings.py b/gettor/utils/settings.py index 226f57f..0543ad8 100644 --- a/gettor/utils/settings.py +++ b/gettor/utils/settings.py @@ -81,9 +81,5 @@ class Settings(object): "twitter_new_message_endpoint": "https://api.twitter.com/1.1/direct_messages/events/new.json" }
- log.msg( - "Settings loaded {}".format(self._settings), system="GetTor" - ) - def get(self, key): return self._settings[key] diff --git a/tests/test_email_service.py b/tests/test_email_service.py index 0ec8b17..d15e813 100644 --- a/tests/test_email_service.py +++ b/tests/test_email_service.py @@ -66,7 +66,7 @@ class EmailServiceTests(unittest.TestCase): limit = self.settings.get("email_requests_limit") num_requests = 300 check = ep.too_many_requests(hid, num_requests, limit) - self.assertEqual(hid, self.settings.get('test_hid')) + self.assertEqual(hid, self.settings.get("test_hid")) self.assertEqual(check, False)
def test_language_email_parser(self):
tor-commits@lists.torproject.org