@@ -0,0 +1,799 @@
+import unittest%0Aimport sys%0Atry:%0A    from StringIO import StringIO%0Aexcept ImportError:%0A    from io import StringIO%0A%0Afrom mccabe import get_code_complexity%0A%0A%0A_GLOBAL = %22%22%22%5C%0A%0Afor i in range(10):%0A    pass%0A%0Adef a():%0A    def b():%0A        def c():%0A            pass%0A        c()%0A    b()%0A%0A%22%22%22%0A%0A%0Aclass McCabeTest(unittest.TestCase):%0A%0A    def setUp(self):%0A        self.old = sys.stdout%0A        self.out = sys.stdout = StringIO()%0A%0A    def tearDown(self):%0A        sys.sdtout = self.old%0A%0A    def test_sample(self):%0A        self.assertEqual(get_code_complexity(_GLOBAL, 1), 2)%0A        self.out.seek(0)%0A        res = self.out.read().strip().split('%5Cn')%0A        wanted = %5B%22stdin:5:1: C901 'a' is too complex (4)%22,%0A                  %22stdin:2:1: C901 'Loop 2' is too complex (2)%22%5D%0A        self.assertEqual(res, wanted)%0A

Add simple test for McCabe checker