コード例 #1
0
ファイル: setup.py プロジェクト: tonywang124/offlineimap
 def run(self):
     logging.basicConfig(format='%(message)s')
     # set credentials and OfflineImap command to be executed:
     OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')
     suite = TestLoader().discover('./test/tests')
     #TODO: failfast does not seem to exist in python2.6?
     TextTestRunner(verbosity=2, failfast=True).run(suite)
コード例 #2
0
#    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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
import random
import unittest
import logging
import os, sys
from test.OLItest import OLITestLib

# Things need to be setup first, usually setup.py initializes everything.
# but if e.g. called from command line, we take care of default values here:
if not OLITestLib.cred_file:
    OLITestLib(cred_file='./test/credentials.conf', cmd='./offlineimap.py')


def setUpModule():
    logging.info("Set Up test module %s" % __name__)
    tdir = OLITestLib.create_test_dir(suffix=__name__)

def tearDownModule():
    logging.info("Tear Down test module")
    OLITestLib.delete_test_dir()

#Stuff that can be used
#self.assertEqual(self.seq, range(10))
# should raise an exception for an immutable sequence
#self.assertRaises(TypeError, random.shuffle, (1,2,3))
#self.assertTrue(element in self.seq)