summaryrefslogtreecommitdiff
path: root/tests/test_overall.py
blob: 05fdc6d841fce0d1fc3edb0b4542bbd9ccfaaf0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import os
import re
import sys
import unittest
import tabnanny
import compileall

class TestOverall(unittest.TestCase):

    """
    Test overall package health by compiling and checking
    code style.
    """

    def testModules(self):
        """Testing all modules by compiling them"""
        src = '.%ssleekxmpp' % os.sep
        if sys.version_info < (3, 0):
            rx = re.compile('/[.]svn')
        else:
            rx = re.compile('/[.]svn|.*26.*')
        self.failUnless(compileall.compile_dir(src, rx=rx, quiet=True))

    def testTabNanny(self):
        """Testing that indentation is consistent"""
        self.failIf(tabnanny.check('..%ssleekxmpp' % os.sep))


suite = unittest.TestLoader().loadTestsFromTestCase(TestOverall)