def jshint(dsc, analysis): run_command(["dpkg-source", "-x", dsc, "source-jshint"]) with cd('source-jshint'): out, _, ret = run_command(['jshint', '--reporter=checkstyle', '.']) failed = ret != 0 if out is not None: for issue in parse_jshint(out.splitlines()): analysis.results.append(issue) else: print "Output of JSHint checker command is None!" return (analysis, out, failed, None, None)
def test_jshint_wrappers(self): jshint_analysis = jshint(self.filepath, self.firehose_results) issues = parse_jshint(jshint_analysis[1].splitlines()) i = 0 found = None for issue in issues: if issue.location.file.givenpath == "test/index.js" and \ issue.location.point.line==13 and issue.location.point.column==19: found = issue i += 1 print found self.assertEquals(found.testid, "W014") self.assertEquals(found.location.file.givenpath, "test/index.js") self.assertEquals(found.location.point.line, 13) self.assertEquals(found.location.point.column, 19) self.assertEquals(found.severity, "warning") self.assertIsNone(found.notes) self.assertIsNone(found.customfields) self.assertTrue("Bad line breaking" in found.message.text) self.assertTrue(i > 75)