コード例 #1
0
ファイル: testOutput.py プロジェクト: uniwolf/hfcca
 def test_should_use_clang_format_for_warning(self):
     fun = FunctionInfo("foo", 100)
     fun.cyclomatic_complexity = 16
     fileStat = FileInformation("FILENAME")
     fileStat.append(fun)
     option = Mock(CCN=15)
     print_warnings(option, [fileStat])
     self.assertIn("FILENAME:100: warning: foo has 16 CCN and 0 params (0 NLOC, 0 tokens)\n", sys.stdout.stream)
コード例 #2
0
 def test_should_use_clang_format_for_warning(self):
     fun = FunctionInfo("foo", 100)
     fun.cyclomatic_complexity = 16
     fileStat = FileInformation("FILENAME")
     fileStat.append(fun)
     option = Mock(CCN=15)
     print_warnings(option, [fileStat])
     self.assertIn(
         "FILENAME:100: warning: foo has 16 CCN and 0 params (0 NLOC, 0 tokens)\n",
         sys.stdout.stream)
コード例 #3
0
 def test_should_not_have_header_when_warning_only_is_on(self):
     option = Mock(warnings_only=True, CCN=15)
     print_warnings(option, [])
     self.assertNotIn("Warnings (CCN > 15)", sys.stdout.stream)
コード例 #4
0
 def test_should_say_no_warning_when_warning_only_is_off(self):
     option = Mock(warnings_only=False, CCN=15)
     print_warnings(option, [])
     self.assertIn("No warning found. Excellent!\n", sys.stdout.stream)
コード例 #5
0
 def test_should_have_header_when_warning_only_is_off(self):
     option = Mock(warnings_only=False, CCN=15)
     print_warnings(option, [])
     self.assertIn("Warnings (CCN > 15)", sys.stdout)
コード例 #6
0
ファイル: testOutput.py プロジェクト: uniwolf/hfcca
 def test_should_not_have_header_when_warning_only_is_on(self):
     option = Mock(warnings_only=True, CCN=15)
     print_warnings(option, [])
     self.assertNotIn("Warnings (CCN > 15)", sys.stdout.stream)
コード例 #7
0
ファイル: testOutput.py プロジェクト: uniwolf/hfcca
 def test_should_say_no_warning_when_warning_only_is_off(self):
     option = Mock(warnings_only=False, CCN=15)
     print_warnings(option, [])
     self.assertIn("No warning found. Excellent!\n", sys.stdout.stream)
コード例 #8
0
ファイル: testOutput.py プロジェクト: guonairong/hfcca
 def test_should_have_header_when_warning_only_is_off(self):
     option = Mock(warnings_only=False, CCN=15)
     print_warnings(option, [])
     self.assertIn("Warnings (CCN > 15)", sys.stdout)