diff --git a/run_test.py b/run_test.py index 163f26f..5979040 100644 --- a/run_test.py +++ b/run_test.py @@ -1,6 +1,6 @@ ## ## run_test.py -## Login : +## Login : David Rousselie ## Started on Wed May 18 13:33:03 2005 David Rousselie ## $Id: run_test.py,v 1.2 2005/09/18 20:24:07 David Rousselie Exp $ ## @@ -24,18 +24,21 @@ import coverage coverage.erase() coverage.start() import unittest + import sys +sys.path.append("src") reload(sys) sys.setdefaultencoding('utf8') del sys.setdefaultencoding + import tests from tests.test_mailconnection import * from tests.test_mailconnection_factory import * from tests.test_component import * from tests.test_storage import * from test import test_support -import jabber import logging +import jmc if __name__ == '__main__': @@ -81,10 +84,10 @@ if __name__ == '__main__': #test_support.run_suite(dbmstorage_suite) test_support.run_suite(jmc_suite) -# coverage.stop() -# coverage.analysis(jabber.mailconnection_factory) -# coverage.analysis(jabber.mailconnection) -# coverage.analysis(jabber.component) -# coverage.analysis(jabber.x) -# coverage.report([jabber.mailconnection_factory, jabber.mailconnection, \ -# jabber.component, jabber.x]) +coverage.stop() +coverage.analysis(jmc.email.mailconnection_factory) +coverage.analysis(jmc.email.mailconnection) +coverage.analysis(jmc.jabber.component) +coverage.analysis(jmc.jabber.x) +coverage.report([jmc.email.mailconnection_factory, jmc.email.mailconnection, \ + jmc.jabber.component, jmc.jabber.x]) diff --git a/jabber/__init__.py b/src/jmc/__init__.py similarity index 100% rename from jabber/__init__.py rename to src/jmc/__init__.py diff --git a/src/jmc/email/__init__.py b/src/jmc/email/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jabber/mailconnection.py b/src/jmc/email/mailconnection.py similarity index 98% rename from jabber/mailconnection.py rename to src/jmc/email/mailconnection.py index 752ac65..b9bdeb6 100644 --- a/jabber/mailconnection.py +++ b/src/jmc/email/mailconnection.py @@ -31,7 +31,7 @@ import poplib import imaplib import socket -from jabber.lang import Lang +from jmc.utils.lang import Lang IMAP4_TIMEOUT = 10 POP3_TIMEOUT = 10 @@ -131,7 +131,7 @@ class MailConnection(object): """ Wrapper to mail connection and action. Abstract class, do not represent real mail connection type""" - _logger = logging.getLogger("jabber.MailConnection") + _logger = logging.getLogger("jmc.MailConnection") def __init__(self, login = "", password = "", host = "", \ port = 110, ssl = False): @@ -327,7 +327,7 @@ class MailConnection(object): action = property(get_action) class IMAPConnection(MailConnection): - _logger = logging.getLogger("jabber.IMAPConnection") + _logger = logging.getLogger("jmc.IMAPConnection") def __init__(self, login = "", password = "", host = "", \ port = None, ssl = False, mailbox = "INBOX"): @@ -405,7 +405,7 @@ class IMAPConnection(MailConnection): type = property(get_type) class POP3Connection(MailConnection): - _logger = logging.getLogger("jabber.POP3Connection") + _logger = logging.getLogger("jmc.POP3Connection") def __init__(self, login = "", password = "", host = "", \ port = None, ssl = False): diff --git a/jabber/mailconnection_factory.py b/src/jmc/email/mailconnection_factory.py similarity index 84% rename from jabber/mailconnection_factory.py rename to src/jmc/email/mailconnection_factory.py index 5867e86..1187fb1 100644 --- a/jabber/mailconnection_factory.py +++ b/src/jmc/email/mailconnection_factory.py @@ -20,17 +20,18 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -import mailconnection -from mailconnection import IMAPConnection, POP3Connection +import jmc.email.mailconnection as mailconnection +from jmc.email.mailconnection import IMAPConnection, POP3Connection -""" Static method to return an empty MailConnection object of given type -:Parameters: - - 'type': type of connection to return : 'imap', 'imaps', 'pop3', 'pop3s' - -:return: MailConnection of given type in parameter, None if unknown type - -:returntype: 'MailConnection'""" def get_new_mail_connection(type): + """ Static method to return an empty MailConnection object of given type + :Parameters: + - 'type': type of connection to return : 'imap', 'imaps', 'pop3', 'pop3s' + + :return: MailConnection of given type in parameter, None if unknown type + + :returntype: 'MailConnection' + """ if type == "imap": return IMAPConnection() elif type == "imaps": @@ -41,19 +42,20 @@ def get_new_mail_connection(type): return POP3Connection(ssl = True) raise Exception, "Connection type \"" + type + "\" unknown" -""" Static methode to create a MailConnection object filled from string - -:Parameters: -- 'connection_string': string containing MailConnection parameters separated -by '#'. ex: 'pop3#login#password#host#110#True' - -:Types: -- 'connection_string': string - -:return: MailConnection of given type found in string parameter - -:returntype: 'MailConnection'""" def str_to_mail_connection(connection_string): + """ Static methode to create a MailConnection object filled from string + + :Parameters: + - 'connection_string': string containing MailConnection parameters separated + by '#'. ex: 'pop3#login#password#host#110#chat_action#online_action#away_action#xa_action#dnd_action#offline_action#check_interval#liv_email_only(#Mailbox)' + + :Types: + - 'connection_string': string + + :return: MailConnection of given type found in string parameter + + :returntype: 'MailConnection' + """ arg_list = connection_string.split("#") # optionals values must be the at the beginning of the list to pop them # last @@ -76,6 +78,7 @@ def str_to_mail_connection(connection_string): offline_action = None interval = None live_email_only = False + result = None if type[0:4] == "imap": if len(arg_list) == 9: chat_action = int(arg_list.pop()) @@ -100,7 +103,7 @@ def str_to_mail_connection(connection_string): ssl = (len(type) == 5), \ port = port, \ mailbox = mailbox) - else: + elif type[0:4] == "pop3": if len(arg_list) == 8: chat_action = int(arg_list.pop()) online_action = int(arg_list.pop()) diff --git a/src/jmc/jabber/__init__.py b/src/jmc/jabber/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jabber/component.py b/src/jmc/jabber/component.py similarity index 99% rename from jabber/component.py rename to src/jmc/jabber/component.py index 61e1b4c..8bf22c4 100644 --- a/jabber/component.py +++ b/src/jmc/jabber/component.py @@ -32,11 +32,12 @@ import os import time import traceback -import mailconnection -from mailconnection import * -from x import * -from storage import * -import mailconnection_factory +from jmc.email.mailconnection import * +from jmc.jabber.x import * +from jmc.utils.storage import * +from jmc.utils.lang import Lang +import jmc.email.mailconnection_factory + import pyxmpp.jabberd from pyxmpp.presence import Presence from pyxmpp.message import Message @@ -45,8 +46,6 @@ from pyxmpp.jid import JID from pyxmpp.jabber.disco import DiscoItems, DiscoItem, DiscoInfo, DiscoIdentity from pyxmpp.jabberd.component import Component -from jabber.lang import Lang - class ComponentFatalError(RuntimeError): pass @@ -68,7 +67,7 @@ class MailComponent(Component): port, \ disco_category = "gateway", \ disco_type = "headline") - self.__logger = logging.getLogger("jabber.Component") + self.__logger = logging.getLogger("jmc.jabber.Component") self.__shutdown = 0 self.__lang = Lang(default_lang) self.__name = name diff --git a/jabber/x.py b/src/jmc/jabber/x.py similarity index 100% rename from jabber/x.py rename to src/jmc/jabber/x.py diff --git a/jmc.py b/src/jmc/jmc.py similarity index 94% rename from jmc.py rename to src/jmc/jmc.py index ea666e9..bc0802e 100755 --- a/jmc.py +++ b/src/jmc/jmc.py @@ -30,9 +30,9 @@ reload(sys) sys.setdefaultencoding('utf-8') del sys.setdefaultencoding -from jabber import mailconnection -from jabber.component import MailComponent, ComponentFatalError -from jabber.config import Config +from jmc import mailconnection +from jmc.component import MailComponent, ComponentFatalError +from jmc.config import Config def main(config_file = "jmc.xml", isDebug = 0): try: @@ -87,5 +87,5 @@ if __name__ == "__main__": if (var_option & 2) == 2: main(sys.argv[file_num], debug_level) else: - main("jmc.xml", debug_level) + main("/etc/jabber/jmc.xml", debug_level) diff --git a/src/jmc/utils/__init__.py b/src/jmc/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jabber/config.py b/src/jmc/utils/config.py similarity index 96% rename from jabber/config.py rename to src/jmc/utils/config.py index 9a9b5e6..1a7342a 100644 --- a/jabber/config.py +++ b/src/jmc/utils/config.py @@ -24,7 +24,7 @@ import libxml2 import os from pyxmpp.jid import JID -from component import ComponentFatalError +from jmc.jabber.component import ComponentFatalError class Config: def __init__(self, config_file): diff --git a/jabber/lang.py b/src/jmc/utils/lang.py similarity index 100% rename from jabber/lang.py rename to src/jmc/utils/lang.py diff --git a/src/jmc/utils/release.py b/src/jmc/utils/release.py new file mode 100644 index 0000000..b8daeeb --- /dev/null +++ b/src/jmc/utils/release.py @@ -0,0 +1,33 @@ +## +## release.py +## Login : David Rousselie +## Started on Mon Jul 24 22:37:00 2006 dax +## $Id$ +## +## Copyright (C) 2006 dax +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## + +version = "0.2.2" +author = "David Rousselie" +email = "dax@happycoders.org" +license = "GPL" +long_description = """Jabber Mail Component + +JMC is a jabber service to check email from POP3 and IMAP4 server and retrieve +them or just a notification of new emails. Jabber users can register multiple +email accounts. + +""" diff --git a/jabber/storage.py b/src/jmc/utils/storage.py similarity index 51% rename from jabber/storage.py rename to src/jmc/utils/storage.py index a2370eb..f12a3fd 100644 --- a/jabber/storage.py +++ b/src/jmc/utils/storage.py @@ -25,11 +25,11 @@ import re import os.path import sys import anydbm -import mailconnection_factory import logging from UserDict import UserDict -from pysqlite2 import dbapi2 as sqlite - + +import jmc.email.mailconnection_factory as mailconnection_factory + class Storage(UserDict): def __init__(self, nb_pk_fields = 1, spool_dir = ".", db_file = None): @@ -106,7 +106,7 @@ class Storage(UserDict): pass class DBMStorage(Storage): - _logger = logging.getLogger("jabber.DBMStorage") + _logger = logging.getLogger("jmc.utils.DBMStorage") def __init__(self, nb_pk_fields = 1, spool_dir = ".", db_file = None): # print "DBM INIT" @@ -165,128 +165,133 @@ class DBMStorage(Storage): def __delitem__(self, pk_tuple): Storage.__delitem__(self, pk_tuple) self.sync() + +# Do not fail if pysqlite is not installed +try: + from pysqlite2 import dbapi2 as sqlite + + class SQLiteStorage(Storage): + _logger = logging.getLogger("jmc.utils.SQLiteStorage") + + def __init__(self, nb_pk_fields = 1, spool_dir = ".", db_file = None): + self.__connection = None + Storage.__init__(self, nb_pk_fields, spool_dir, db_file) + + def create(self): + SQLiteStorage._logger.debug("creating new Table") + cursor = self.__connection.cursor() + cursor.execute(""" + create table account( + jid STRING, + name STRING, + type STRING, + login STRING, + password STRING, + host STRING, + port INTEGER, + chat_action INTEGER, + online_action INTEGER, + away_action INTEGER, + xa_action INTEGER, + dnd_action INTEGER, + offline_action INTEGER, + interval INTEGER, + live_email_only BOOLEAN, + mailbox STRING, + PRIMARY KEY(jid, name) + ) + """) + self.__connection.commit() + cursor.close() - -class SQLiteStorage(Storage): - _logger = logging.getLogger("jabber.SQLiteStorage") - - def __init__(self, nb_pk_fields = 1, spool_dir = ".", db_file = None): - self.__connection = None - Storage.__init__(self, nb_pk_fields, spool_dir, db_file) + def __del__(self): + self.__connection.close() - def create(self): - SQLiteStorage._logger.debug("creating new Table") - cursor = self.__connection.cursor() - cursor.execute(""" - create table account( - jid STRING, - name STRING, - type STRING, - login STRING, - password STRING, - host STRING, - port INTEGER, - chat_action INTEGER, - online_action INTEGER, - away_action INTEGER, - xa_action INTEGER, - dnd_action INTEGER, - offline_action INTEGER, - interval INTEGER, - live_email_only BOOLEAN, - mailbox STRING, - PRIMARY KEY(jid, name) - ) - """) - self.__connection.commit() - cursor.close() + def sync(self): + pass - def __del__(self): - self.__connection.close() - - def sync(self): - pass - - def load(self): - if not os.path.exists(self.file): - self.__connection = sqlite.connect(self.file) - self.create() - else: - self.__connection = sqlite.connect(self.file) - cursor = self.__connection.cursor() - cursor.execute("""select * from account""") - result = {} - for row in cursor.fetchall(): - # print "Creating new " + row[self.nb_pk_fields] + " connection." - account_type = row[self.nb_pk_fields] - account = result["#".join(row[0:self.nb_pk_fields])] = mailconnection_factory.get_new_mail_connection(account_type) - account.login = row[self.nb_pk_fields + 1] - account.password = row[self.nb_pk_fields + 2] - if account.password is None: - account.store_password = False + def load(self): + if not os.path.exists(self.file): + self.__connection = sqlite.connect(self.file) + self.create() else: - account.store_password = True - account.host = row[self.nb_pk_fields + 3] - account.port = int(row[self.nb_pk_fields + 4]) - account.chat_action = int(row[self.nb_pk_fields + 5]) - account.online_action = int(row[self.nb_pk_fields + 6]) - account.away_action = int(row[self.nb_pk_fields + 7]) - account.xa_action = int(row[self.nb_pk_fields + 8]) - account.dnd_action = int(row[self.nb_pk_fields + 9]) - account.offline_action = int(row[self.nb_pk_fields + 10]) - account.interval = int(row[self.nb_pk_fields + 11]) - account.live_email_only = (row[self.nb_pk_fields + 12] == 1) - if account_type[0:4] == "imap": - account.mailbox = row[self.nb_pk_fields + 13] -# for field_index in range(self.nb_pk_fields + 1, len(row)): -# print "\tSetting " + str(cursor.description[field_index][0]) + \ -# " to " + str(row[field_index]) -# setattr(account, -# cursor.description[field_index][0], -# row[field_index]) - cursor.close() - return result + self.__connection = sqlite.connect(self.file) + cursor = self.__connection.cursor() + cursor.execute("""select * from account""") + result = {} + for row in cursor.fetchall(): + # print "Creating new " + row[self.nb_pk_fields] + " connection." + account_type = row[self.nb_pk_fields] + account = result["#".join(row[0:self.nb_pk_fields])] = mailconnection_factory.get_new_mail_connection(account_type) + account.login = row[self.nb_pk_fields + 1] + account.password = row[self.nb_pk_fields + 2] + if account.password is None: + account.store_password = False + else: + account.store_password = True + account.host = row[self.nb_pk_fields + 3] + account.port = int(row[self.nb_pk_fields + 4]) + account.chat_action = int(row[self.nb_pk_fields + 5]) + account.online_action = int(row[self.nb_pk_fields + 6]) + account.away_action = int(row[self.nb_pk_fields + 7]) + account.xa_action = int(row[self.nb_pk_fields + 8]) + account.dnd_action = int(row[self.nb_pk_fields + 9]) + account.offline_action = int(row[self.nb_pk_fields + 10]) + account.interval = int(row[self.nb_pk_fields + 11]) + account.live_email_only = (row[self.nb_pk_fields + 12] == 1) + if account_type[0:4] == "imap": + account.mailbox = row[self.nb_pk_fields + 13] + # for field_index in range(self.nb_pk_fields + 1, len(row)): + # print "\tSetting " + str(cursor.description[field_index][0]) + \ + # " to " + str(row[field_index]) + # setattr(account, + # cursor.description[field_index][0], + # row[field_index]) + cursor.close() + return result - def __setitem__(self, pk_tuple, obj): - Storage.__setitem__(self, pk_tuple, obj) - cursor = self.__connection.cursor() - mailbox = None - password = None - if obj.type[0:4] == "imap": - mailbox = obj.mailbox - if obj.store_password == True: - password = obj.password - cursor.execute(""" - insert or replace into account values - (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - """, - (pk_tuple[0], - pk_tuple[1], - obj.type, - obj.login, - password, - obj.host, - obj.port, - obj.chat_action, - obj.online_action, - obj.away_action, - obj.xa_action, - obj.dnd_action, - obj.offline_action, - obj.interval, - obj.live_email_only, - mailbox)) - self.__connection.commit() - cursor.close() + def __setitem__(self, pk_tuple, obj): + Storage.__setitem__(self, pk_tuple, obj) + cursor = self.__connection.cursor() + mailbox = None + password = None + if obj.type[0:4] == "imap": + mailbox = obj.mailbox + if obj.store_password == True: + password = obj.password + cursor.execute(""" + insert or replace into account values + (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + (pk_tuple[0], + pk_tuple[1], + obj.type, + obj.login, + password, + obj.host, + obj.port, + obj.chat_action, + obj.online_action, + obj.away_action, + obj.xa_action, + obj.dnd_action, + obj.offline_action, + obj.interval, + obj.live_email_only, + mailbox)) + self.__connection.commit() + cursor.close() - def __delitem__(self, pk_tuple): - Storage.__delitem__(self, pk_tuple) - cursor = self.__connection.cursor() - cursor.execute(""" - delete from account where jid = ? and name = ? - """, - (pk_tuple[0], - pk_tuple[1])) - self.__connection.commit() - cursor.close() + def __delitem__(self, pk_tuple): + Storage.__delitem__(self, pk_tuple) + cursor = self.__connection.cursor() + cursor.execute(""" + delete from account where jid = ? and name = ? + """, + (pk_tuple[0], + pk_tuple[1])) + self.__connection.commit() + cursor.close() +except ImportError: + pass diff --git a/utils/backend_converter.py b/src/utils/backend_converter.py similarity index 100% rename from utils/backend_converter.py rename to src/utils/backend_converter.py diff --git a/utils/backend_dump.py b/src/utils/backend_dump.py similarity index 100% rename from utils/backend_dump.py rename to src/utils/backend_dump.py diff --git a/tests/test_component.py b/tests/test_component.py index 670c1a5..3ec2f40 100644 --- a/tests/test_component.py +++ b/tests/test_component.py @@ -26,8 +26,8 @@ import dummy_server import time import traceback from pyxmpp import xmlextra -from jabber.component import * -from jabber.config import Config +from jmc.jabber.component import * +from jmc.utils.config import Config class TestStreamHandler(xmlextra.StreamHandler): def __init__(self, expected_balises = []): diff --git a/tests/test_mailconnection.py b/tests/test_mailconnection.py index 7a5aec0..8ca04cd 100644 --- a/tests/test_mailconnection.py +++ b/tests/test_mailconnection.py @@ -22,7 +22,7 @@ ## import unittest -from jabber.mailconnection import IMAPConnection, \ +from jmc.email.mailconnection import IMAPConnection, \ POP3Connection, \ MailConnection import dummy_server diff --git a/tests/test_mailconnection_factory.py b/tests/test_mailconnection_factory.py index fab5dac..738374e 100644 --- a/tests/test_mailconnection_factory.py +++ b/tests/test_mailconnection_factory.py @@ -21,28 +21,49 @@ ## import unittest -from jabber.mailconnection_factory import * -from jabber import mailconnection +from jmc.email.mailconnection_factory import * +from jmc.email.mailconnection import * +import jmc.email.mailconnection as mailconnection class MailConnectionFactory_TestCase(unittest.TestCase): def test_new_mail_connection_imap(self): mc = get_new_mail_connection("imap") - # TODO - self.assertEquals(mc, mc) + self.assertEquals(mc, IMAPConnection()) def test_new_mail_connection_imaps(self): mc = get_new_mail_connection("imaps") - self.assertEquals(mc, mc) + self.assertEquals(mc, IMAPConnection(ssl = True)) def test_new_mail_connection_pop3(self): mc = get_new_mail_connection("pop3") - self.assertEquals(mc, mc) + self.assertEquals(mc, POP3Connection()) def test_new_mail_connection_pop3s(self): mc = get_new_mail_connection("pop3s") - self.assertEquals(mc, mc) + self.assertEquals(mc, POP3Connection(ssl = True)) + def test_new_mail_connection_unknown(self): + self.assertRaises(Exception, get_new_mail_connection, "unknown") + def test_str_to_mail_connection_imap_v01_v02(self): + mc = str_to_mail_connection("imap#login#passwd#host#193#False#INBOX") + self.assertEquals(mc.get_type(), "imap") + self.assertEquals(mc.login, "login") + self.assertEquals(mc.password, "passwd") + self.assertEquals(mc.store_password, True) + self.assertEquals(mc.host, "host") + self.assertEquals(mc.port, 193) + self.assertEquals(mc.mailbox, "INBOX") + self.assertEquals(mc.chat_action, mailconnection.DIGEST) + self.assertEquals(mc.online_action, mailconnection.DIGEST) + self.assertEquals(mc.away_action, mailconnection.DIGEST) + self.assertEquals(mc.xa_action, mailconnection.DIGEST) + self.assertEquals(mc.dnd_action, mailconnection.DIGEST) + self.assertEquals(mc.offline_action, mailconnection.DO_NOTHING) + self.assertEquals(mc.interval, 5) + self.assertEquals(mc.live_email_only, False) + + def test_str_to_mail_connection_imap_v01_v02_retrieve(self): mc = str_to_mail_connection("imap#login#passwd#host#193#True#INBOX") self.assertEquals(mc.get_type(), "imap") self.assertEquals(mc.login, "login") @@ -76,7 +97,24 @@ class MailConnectionFactory_TestCase(unittest.TestCase): self.assertEquals(mc.offline_action, mailconnection.DO_NOTHING) self.assertEquals(mc.interval, 5) self.assertEquals(mc.live_email_only, False) - + + def test_str_to_mail_connection_pop3_v01_v02_retrieve(self): + mc = str_to_mail_connection("pop3#login#passwd#host#110#True") + self.assertEquals(mc.get_type(), "pop3") + self.assertEquals(mc.login, "login") + self.assertEquals(mc.password, "passwd") + self.assertEquals(mc.store_password, True) + self.assertEquals(mc.host, "host") + self.assertEquals(mc.port, 110) + self.assertEquals(mc.chat_action, mailconnection.RETRIEVE) + self.assertEquals(mc.online_action, mailconnection.RETRIEVE) + self.assertEquals(mc.away_action, mailconnection.RETRIEVE) + self.assertEquals(mc.xa_action, mailconnection.RETRIEVE) + self.assertEquals(mc.dnd_action, mailconnection.RETRIEVE) + self.assertEquals(mc.offline_action, mailconnection.DO_NOTHING) + self.assertEquals(mc.interval, 5) + self.assertEquals(mc.live_email_only, False) + def test_str_to_mail_connection_imap(self): mc = str_to_mail_connection("imap#login#passwd#host#193#0#0#0#1#1#2#4#True#INBOX") self.assertEquals(mc.get_type(), "imap") @@ -161,3 +199,6 @@ class MailConnectionFactory_TestCase(unittest.TestCase): self.assertEquals(mc.interval, 4) self.assertEquals(mc.live_email_only, True) + def test_str_to_mail_connection_unknown(self): + self.assertRaises(Exception, str_to_mail_connection, ("unknown#login#passwd#host#995#0#0#0#1#1#2#4#True")) + diff --git a/tests/test_storage.py b/tests/test_storage.py index c6a096e..f3ff233 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -23,9 +23,9 @@ import os import unittest import dummy_server -from jabber.storage import * -from jabber import mailconnection -from jabber.mailconnection import * +from jmc.utils.storage import * +from jmc.email.mailconnection import * +import jmc.email.mailconnection as mailconnection class Storage_TestCase(unittest.TestCase): def test_init(self): diff --git a/tests/test_x.py b/tests/test_x.py index 43d967b..4e45f9e 100644 --- a/tests/test_x.py +++ b/tests/test_x.py @@ -21,7 +21,7 @@ ## import unittest -from jabber.x import * +from jmc.jabber.x import * class X_TestCase(unittest.TestCase): def setUp(self):