Exemplo n.º 1
0
    def test_flake8(self):
        flake8_analysis = flake8(self.filepath, self.firehose_results)
        content = flake8_analysis[1]
        self.assertTrue("missing whitespace around operator" in content)

        # It think it is safe to say that the string is not 4 chars long
        self.assertTrue(len(content) > 4)
Exemplo n.º 2
0
    def test_flake8(self):
        flake8_analysis = flake8(self.filepath, self.firehose_results)
        content = flake8_analysis[1]
        self.assertTrue("missing whitespace around operator" in content)

        # It think it is safe to say that the string is not 4 chars long
        self.assertTrue(len(content) > 4)
Exemplo n.º 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)
Exemplo n.º 4
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)
Exemplo n.º 5
0
def run(dsc, package, job, firehose):
    return flake8(dsc, firehose)