Beispiel #1
0
 def test_print_and_save_detail_information(self):
     scheme = OutputScheme([])
     fileSummary = FileInformation("FILENAME", 123, [])
     print_and_save_modules([fileSummary], scheme)
     self.assertIn(
         "    123       0.0     0.0        0.0         0     FILENAME\n",
         sys.stdout.stream)
Beispiel #2
0
 def test_print_file_summary_only_once(self):
     scheme = OutputScheme([])
     print_and_save_modules([
         FileInformation("FILENAME1", 123, []),
         FileInformation("FILENAME2", 123, [])
     ], scheme)
     self.assertEqual(1, sys.stdout.stream.count("FILENAME1"))
Beispiel #3
0
 def test_function_info_header_should_have_the_captions_of_external_extensions(self):
     external_extension = Mock(FUNCTION_CAPTION = "*external_extension*", FUNCTION_INFO_PART ="xx", ordering_index=-1)
     del external_extension.AVERAGE_CAPTION
     extensions = get_extensions([external_extension])
     scheme = OutputScheme(extensions)
     print_and_save_modules([], extensions, scheme)
     self.assertEquals("  NLOC    CCN   token  PARAM  length *external_extension* location  ", sys.stdout.stream.splitlines()[1])
Beispiel #4
0
 def test_function_info_header_should_have_the_captions_of_external_extensions(self):
     external_extension = Mock(FUNCTION_INFO = {"xx": {"caption":"*external_extension*"}}, ordering_index=-1)
     extensions = get_extensions([external_extension])
     scheme = OutputScheme(extensions)
     print_and_save_modules([], extensions, scheme)
     self.assertEquals("  NLOC    CCN   token  PARAM  length *external_extension* location  ", sys.stdout.stream.splitlines()[1])
     self.assertFalse(scheme.any_regression())
Beispiel #5
0
 def test_function_info_header_should_have_the_captions_of_external_extensions(self):
     external_extension = Mock(FUNCTION_INFO = {"xx": {"caption":"*external_extension*"}}, ordering_index=-1)
     extensions = get_extensions([external_extension])
     scheme = OutputScheme(extensions)
     print_and_save_modules([], extensions, scheme)
     self.assertEquals("  NLOC    CCN   token  PARAM  length *external_extension* location  ", sys.stdout.stream.splitlines()[1])
     self.assertFalse(scheme.any_regression())
Beispiel #6
0
 def test_print_fileinfo(self):
     self.foo.end_line = 100
     self.foo.cyclomatic_complexity = 16
     fileStat = FileInformation("FILENAME", 1, [self.foo])
     print_and_save_modules([fileStat], self.scheme)
     self.assertEqual(
         "       1     16      1      0       0 foo@100-100@FILENAME",
         sys.stdout.stream.splitlines()[3])
Beispiel #7
0
 def test_print_fileinfo(self):
     self.foo.end_line = 100
     self.foo.cyclomatic_complexity = 16
     fileStat = FileInformation("FILENAME", 1, [self.foo])
     print_and_save_modules([fileStat], self.extensions, self.scheme)
     self.assertEquals(
         "       1     16      1      0       0 foo@100-100@FILENAME", sys.stdout.stream.splitlines()[3]
     )
Beispiel #8
0
 def test_print_and_save_detail_information_with_ext(self):
     scheme = OutputScheme([Ext()])
     fileSummary = FileInformation("FILENAME", 123, [])
     print_and_save_modules([fileSummary], scheme)
     self.assertIn("Avg.ND", sys.stdout.stream)
     self.assertIn("    123       0.0     0.0        0.0     0.0         0     FILENAME", sys.stdout.stream)
Beispiel #9
0
 def test_function_info_header_should_have_the_captions(self):
     print_and_save_modules([],  self.scheme)
     self.assertEquals("  NLOC    CCN   token  PARAM  length  location  ", sys.stdout.stream.splitlines()[1])
Beispiel #10
0
 def test_function_info_header_should_have_a_box(self):
     print_and_save_modules([],  self.scheme)
     self.assertIn("=" * 20, sys.stdout.stream.splitlines()[0])
Beispiel #11
0
 def test_print_file_summary_only_once(self):
     scheme = OutputScheme([])
     print_and_save_modules(
                         [FileInformation("FILENAME1", 123, []),
                          FileInformation("FILENAME2", 123, [])], scheme)
     self.assertEqual(1, sys.stdout.stream.count("FILENAME1"))
Beispiel #12
0
 def test_function_info_header_should_have_the_captions(self):
     print_and_save_modules([], self.scheme)
     self.assertEqual("  NLOC    CCN   token  PARAM  length  location  ",
                      sys.stdout.stream.splitlines()[1])
Beispiel #13
0
 def test_function_info_header_should_have_a_box(self):
     print_and_save_modules([], self.scheme)
     self.assertIn("=" * 20, sys.stdout.stream.splitlines()[0])
Beispiel #14
0
 def test_print_and_save_detail_information(self):
     fileSummary = FileInformation("FILENAME", 123, [])
     print_and_save_modules([fileSummary], [], Mock())
     self.assertIn("    123      0    0.0         0         0     FILENAME", sys.stdout.stream)
Beispiel #15
0
 def test_print_file_summary_only_once(self):
     print_and_save_modules(
                         [FileInformation("FILENAME1", 123, []), 
                          FileInformation("FILENAME2", 123, [])], [], Mock())
     self.assertEqual(1, sys.stdout.stream.count("FILENAME1"))
Beispiel #16
0
 def test_function_info_header_should_have_the_captions_of_external_extensions(self):
     external_extension = Mock(FUNCTION_CAPTION = "*external_extension*")
     extensions = get_extensions([external_extension])
     scheme = OutputScheme(extensions)
     print_and_save_modules([], extensions, scheme)
     self.assertEquals("  NLOC    CCN   token  PARAM *external_extension* location  ", sys.stdout.stream.splitlines()[1])