summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Wagner <bwagner@riseup.net>2016-01-13 16:36:42 -0200
committerBruno Wagner <bwagner@riseup.net>2016-01-13 16:41:12 -0200
commit8046a75c14778cff19c0543b2df9b70d1a168e3f (patch)
tree73a9bb1a51975b232aee08ceeb6230b8f1862896
parent9d9e1d5feb1d53f85d13c6879a6bd00729c7f37f (diff)
Removed unused logging imports and fixed maintenance logger during test
-rw-r--r--service/pixelated/bitmask_libraries/smtp.py4
-rw-r--r--service/pixelated/maintenance.py5
-rw-r--r--service/test/integration/test_leap_mailstore.py8
-rw-r--r--service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py4
4 files changed, 7 insertions, 14 deletions
diff --git a/service/pixelated/bitmask_libraries/smtp.py b/service/pixelated/bitmask_libraries/smtp.py
index e05ba51a..643d4d4a 100644
--- a/service/pixelated/bitmask_libraries/smtp.py
+++ b/service/pixelated/bitmask_libraries/smtp.py
@@ -13,10 +13,6 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
-import logging
-
-
-logger = logging.getLogger(__name__)
class LeapSMTPConfig(object):
diff --git a/service/pixelated/maintenance.py b/service/pixelated/maintenance.py
index 5e5f8da0..4562717f 100644
--- a/service/pixelated/maintenance.py
+++ b/service/pixelated/maintenance.py
@@ -14,7 +14,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
-import logging
from os.path import isfile
from mailbox import Maildir, mbox, MaildirMessage
import random
@@ -23,12 +22,15 @@ from twisted.internet.threads import deferToThread
from pixelated.adapter.mailstore.maintenance import SoledadMaintenance
from pixelated.config.leap import initialize_leap
from pixelated.config import logger, arguments
+import logging
from leap.mail.constants import MessageFlags
from pixelated.support.mail_generator import MailGenerator
REPAIR_COMMAND = 'repair'
+log = logging.getLogger(__name__)
+
def initialize():
args = arguments.parse_maintenance_args()
@@ -72,7 +74,6 @@ def execute_command(args, leap_session):
@defer.inlineCallbacks
def soledad_sync(args):
leap_session, soledad = args
- log = logging.getLogger('some logger')
log.warn('Before sync')
diff --git a/service/test/integration/test_leap_mailstore.py b/service/test/integration/test_leap_mailstore.py
index 9e63c693..e28fbe5d 100644
--- a/service/test/integration/test_leap_mailstore.py
+++ b/service/test/integration/test_leap_mailstore.py
@@ -60,14 +60,6 @@ class LeapMailStoreTest(SoledadTestBase):
mail = yield self.mail_store.add_mail('INBOX', input_mail.as_string())
fetched_mail = yield self.mail_store.get_mail(mail.ident, include_body=True)
- # _, docs = yield self.soledad.get_all_docs()
- # for doc in docs:
- # print '\n%s\n' % doc
-
- # self.assertEqual(1, len(mail.as_dict()['attachments']))
- # print fetched_mail.as_dict()
- # self.assertEqual(1, len(fetched_mail.as_dict()['attachments']))
-
@defer.inlineCallbacks
def test_all_mails(self):
mail = load_mail_from_file('mbox00000000')
diff --git a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py
index 9a89d62b..e46d6864 100644
--- a/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py
+++ b/service/test/unit/adapter/mailstore/maintenance/test_soledad_maintenance.py
@@ -20,6 +20,10 @@ from twisted.trial import unittest
from mockito import mock, when, verify, never
from pixelated.adapter.mailstore.maintenance import SoledadMaintenance
from leap.keymanager.openpgp import OpenPGPKey
+import logging
+
+logging.getLogger('pixelated.adapter.mailstore.maintenance').addHandler(logging.NullHandler())
+
SOME_EMAIL_ADDRESS = 'foo@example.tld'
SOME_KEY_ID = '4914254E384E264C'