Exemplo n.º 1
0
 def test_analyze_c_file(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 1)
     self.assertEqual(1, len([x for x in r]))
Exemplo n.º 2
0
 def test_MoreFiles(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["f1", "f2"], analyzer, 1)
     self.assertEqual(["f1", "f2"], [x for x in r])
Exemplo n.º 3
0
 def test_MoreFilesMultipleThread(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["f1", "f2"], analyzer, 2)
     self.assertEqual(["f1", "f2"], [x for x in r])
Exemplo n.º 4
0
 def test_OneFile(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["filename"], analyzer, 1)
     self.assertEqual(["filename"], [x for x in r])
Exemplo n.º 5
0
 def test_OneFileMultipleThread(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["filename"], analyzer, 2)
     self.assertEqual(["filename"], [x for x in r])
Exemplo n.º 6
0
 def test_NoFilesMultipleThread(self):
     analyzer = MockFileAnalyzer()
     mapFilesToAnalyzer([], analyzer, 2)
     self.assertEqual(0, len(analyzer.mockRecord))
Exemplo n.º 7
0
 def test_NoFilesMultipleThread(self):
     analyzer = MockFileAnalyzer()
     mapFilesToAnalyzer([], analyzer, 2)
     self.assertEqual(0, len(analyzer.mockRecord))
Exemplo n.º 8
0
 def test_analyze_c_file_with_multiple_thread(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 2)
     self.assertEqual(1, len([x for x in r]))
Exemplo n.º 9
0
 def test_fileInfomation(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 1)
     fileInfo = list(r)[0]
     self.assertEqual(1, fileInfo.average_NLOC)
     self.assertEqual(1, fileInfo.average_CCN)
     self.assertEqual(4, fileInfo.average_token)
Exemplo n.º 10
0
 def test_MoreFilesMultipleThread(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["f1", "f2"], analyzer, 2)
     self.assertEqual(["f1", "f2"], [x for x in r])
Exemplo n.º 11
0
 def test_analyze_c_file(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 1)
     self.assertEqual(1, len([x for x in r]))
Exemplo n.º 12
0
 def test_MoreFiles(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["f1", "f2"], analyzer, 1)
     self.assertEqual(["f1", "f2"], [x for x in r])
Exemplo n.º 13
0
 def test_OneFileMultipleThread(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["filename"], analyzer, 2)
     self.assertEqual(["filename"], [x for x in r])
Exemplo n.º 14
0
 def test_OneFile(self):
     analyzer = MockFileAnalyzer()
     r = mapFilesToAnalyzer(["filename"], analyzer, 1)
     self.assertEqual(["filename"], [x for x in r])
Exemplo n.º 15
0
 def test_analyze_c_file_with_multiple_thread(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 2)
     self.assertEqual(1, len([x for x in r]))
Exemplo n.º 16
0
 def test_NoFiles(self):
     analyzer = MockFileAnalyzer()
     mapFilesToAnalyzer([], analyzer, 1)
     self.assertEqual(0, len(analyzer.mockRecord))
Exemplo n.º 17
0
 def test_fileInfomation(self):
     r = mapFilesToAnalyzer(["f1.c"], self.analyzer, 1)
     fileInfo = list(r)[0]
     self.assertEqual(1, fileInfo.average_NLOC)
     self.assertEqual(1, fileInfo.average_CCN)
     self.assertEqual(4, fileInfo.average_token)
Exemplo n.º 18
0
 def test_NoFiles(self):
     analyzer = MockFileAnalyzer()
     mapFilesToAnalyzer([], analyzer, 1)
     self.assertEqual(0, len(analyzer.mockRecord))