Commit 41c72250 authored by Hiro's avatar Hiro 🏄
Browse files

Remove logs and check hid

parent cabaddce
...@@ -153,6 +153,11 @@ class EmailParser(object): ...@@ -153,6 +153,11 @@ class EmailParser(object):
def too_many_requests(self, hid, num_requests, limit): def too_many_requests(self, hid, num_requests, limit):
test_hid = self.settings.get("test_hid") test_hid = self.settings.get("test_hid")
log.msg(
"test_hid {}".format(test_hid), system="email parser"
)
if hid == test_hid: if hid == test_hid:
return False return False
elif num_requests < limit: elif num_requests < limit:
......
...@@ -81,9 +81,5 @@ class Settings(object): ...@@ -81,9 +81,5 @@ class Settings(object):
"twitter_new_message_endpoint": "https://api.twitter.com/1.1/direct_messages/events/new.json" "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): def get(self, key):
return self._settings[key] return self._settings[key]
...@@ -66,7 +66,7 @@ class EmailServiceTests(unittest.TestCase): ...@@ -66,7 +66,7 @@ class EmailServiceTests(unittest.TestCase):
limit = self.settings.get("email_requests_limit") limit = self.settings.get("email_requests_limit")
num_requests = 300 num_requests = 300
check = ep.too_many_requests(hid, num_requests, limit) 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) self.assertEqual(check, False)
def test_language_email_parser(self): def test_language_email_parser(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment