Exemple #1
0
def flake8(dsc, analysis):
    run_command(["dpkg-source", "-x", dsc, "source-flake8"])
    with cd('source-flake8'):
        out, _, ret = run_command(['flake8', '.'])
        failed = ret != 0

        for issue in parse_flake8(out.splitlines()):
            analysis.results.append(issue)

        return (analysis, out, failed, None, None)
Exemple #2
0
 def test_flake8_wrappers(self):
     flake8_analysis = flake8(self.filepath, self.firehose_results)
     issues = parse_flake8(flake8_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == "./firehose/parsers/cppcheck.py" and \
         issue.location.point.line==37 and issue.location.point.column==5:
             found = issue
         i += 1
     print found
     self.assertEquals(found.testid, "F841")
     self.assertEquals(found.location.file.givenpath,
             "./firehose/parsers/cppcheck.py")
     self.assertEquals(found.location.point.line, 37)
     self.assertEquals(found.location.point.column, 5)
     self.assertEquals(found.severity, "error")
     self.assertIsNone(found.notes)
     self.assertIsNone(found.customfields)
     self.assertTrue("F841 local variable 'version' is assigned to but never used"
             in found.message.text)
     self.assertTrue(i > 100)
Exemple #3
0
 def test_flake8_wrappers(self):
     flake8_analysis = flake8(self.filepath, self.firehose_results)
     issues = parse_flake8(flake8_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == "./firehose/parsers/cppcheck.py" and \
         issue.location.point.line==37 and issue.location.point.column==5:
             found = issue
         i += 1
     print found
     self.assertEquals(found.testid, "F841")
     self.assertEquals(found.location.file.givenpath,
                       "./firehose/parsers/cppcheck.py")
     self.assertEquals(found.location.point.line, 37)
     self.assertEquals(found.location.point.column, 5)
     self.assertEquals(found.severity, "error")
     self.assertIsNone(found.notes)
     self.assertIsNone(found.customfields)
     self.assertTrue(
         "F841 local variable 'version' is assigned to but never used" in
         found.message.text)
     self.assertTrue(i > 100)