Esempio n. 1
0
    def test_pylint(self):
        pylint_analysis = pylint(self.filepath, self.firehose_results)
        content = pylint_analysis[1]
        self.assertTrue("Missing method docstring" in content)

        # It think it is safe to say that the string is not 4 chars long
        self.assertTrue(len(content) > 4)
Esempio n. 2
0
    def test_pylint(self):
        pylint_analysis = pylint(self.filepath, self.firehose_results)
        content = pylint_analysis[1]
        self.assertTrue("Missing method docstring" in content)

        # It think it is safe to say that the string is not 4 chars long
        self.assertTrue(len(content) > 4)
Esempio n. 3
0
 def test_pylint_wrappers(self):
     pylint_analysis = pylint(self.filepath, self.firehose_results)
     issues = parse_pylint(pylint_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == \
                 "tests/parsers/test_clanganalyzer_parser.py" and \
         issue.location.point.line==22 and issue.location.point.column==0:
             found = issue
         i += 1
     print found
     self.assertEquals(found.testid, "W0611")
     self.assertEquals(found.location.file.givenpath,
                       "tests/parsers/test_clanganalyzer_parser.py")
     self.assertEquals(found.location.point.line, 22)
     self.assertEquals(found.location.point.column, 0)
     self.assertEquals(found.severity, "warning")
     self.assertIsNone(found.notes)
     self.assertIsNone(found.customfields)
     self.assertTrue(
         "[unused-import]Unused Analysis imported from firehose.model" in
         found.message.text)
     self.assertTrue(i > 500)
Esempio n. 4
0
 def test_pylint_wrappers(self):
     pylint_analysis = pylint(self.filepath, self.firehose_results)
     issues = parse_pylint(pylint_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == \
                 "tests/parsers/test_clanganalyzer_parser.py" and \
         issue.location.point.line==22 and issue.location.point.column==0:
             found = issue
         i += 1
     print found
     self.assertEquals(found.testid, "W0611")
     self.assertEquals(found.location.file.givenpath,
             "tests/parsers/test_clanganalyzer_parser.py")
     self.assertEquals(found.location.point.line, 22)
     self.assertEquals(found.location.point.column, 0)
     self.assertEquals(found.severity, "warning")
     self.assertIsNone(found.notes)
     self.assertIsNone(found.customfields)
     self.assertTrue(
             "[unused-import]Unused Analysis imported from firehose.model"
             in found.message.text)
     self.assertTrue(i > 500)
Esempio n. 5
0
def run(dsc, package, job, firehose):
    return pylint(dsc, firehose)
Esempio n. 6
0
def test_pylint_common():
    firehorse_results = Analysis(metadata=Metadata(
        generator=Generator(name='pylint'), sut=None, file_=None, stats=None),
                                 results=[])

    return pylint(filepath, firehorse_results)