예제 #1
0
    def test_pep8(self):
        pep8_analysis = pep8(self.filepath, self.firehose_results)
        content = pep8_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)
예제 #2
0
 def test_pep8_wrappers(self):
     pep8_analysis = pep8(self.filepath, self.firehose_results)
     issues = parse_pep8(pep8_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == "./firehose/model.py" and \
         issue.location.point.line==96 and issue.location.point.column==1:
             found = issue
         i += 1
     print found
     self.assertEquals(found.testid, "E302")
     self.assertEquals(found.location.file.givenpath, "./firehose/model.py")
     self.assertEquals(found.location.point.line, 96)
     self.assertEquals(found.location.point.column, 1)
     self.assertEquals(found.severity, "error")
     self.assertIsNone(found.notes)
     self.assertIsNone(found.customfields)
     self.assertTrue("E302 expected 2 blank lines, found 1" in found.message.text)
     self.assertTrue(i > 100)
예제 #3
0
def test_pep8_common():
    firehorse_results = Analysis(metadata=Metadata(
        generator=Generator(name='pep8'), sut=None, file_=None, stats=None),
                                 results=[])

    return pep8(filepath, firehorse_results)
예제 #4
0
파일: pep8.py 프로젝트: schevalier/debile
def run(dsc, package, job, firehose):
    return pep8(dsc, firehose)