def test_lintian_wrappers(): lintian_analysis = test_lintian_common() issues = parse_lintian(lintian_analysis[1].splitlines(), filepath) i = 0 for issue in issues: if issue.testid == "no-symbols-control-file": found = issue i += 1 assert found.testid == "no-symbols-control-file" assert found.location.file.givenpath == "tests/resources/libjsoncpp0_0.6.0~rc2-3.1_amd64.deb" assert found.location.point is None assert found.severity == "info" assert found.notes is None assert found.customfields is None assert "libjsoncpp0: no-symbols-control-file usr/lib/libjsoncpp.so.0.6.0" in found.message.text assert i > 1
def lintian(targets, analysis, lintian_binary='lintian'): if not isinstance(targets, list): targets = [targets] log = "" failed = False for target in targets: out, err, ret = run_command([lintian_binary, "-IE", "--pedantic", "--show-overrides", target]) for issue in parse_lintian(out.splitlines(), target): analysis.results.append(issue) if issue.severity == 'error': failed = True log += out return (analysis, log, failed, None, None)
def test_lintian_wrappers(self): lintian_analysis = lintian(self.filepath, self.firehose_results) issues = parse_lintian(lintian_analysis[1].splitlines(), self.filepath) i = 0 for issue in issues: if issue.testid == "no-symbols-control-file": found = issue i += 1 self.assertEquals(found.testid, "no-symbols-control-file") self.assertEquals(found.location.file.givenpath, "tests/resources/libjsoncpp0_0.6.0~rc2-3.1_amd64.deb") self.assertIsNone(found.location.point) self.assertEquals(found.severity, "info") self.assertIsNone(found.notes) self.assertIsNone(found.customfields) self.assertTrue("libjsoncpp0: no-symbols-control-file usr/lib/libjsoncpp.so.0.6.0" in found.message.text) self.assertTrue(i > 1)
def test_lintian_wrappers(self): lintian_analysis = lintian(self.filepath, self.firehose_results) issues = parse_lintian(lintian_analysis[1].splitlines(), self.filepath) i = 0 for issue in issues: if issue.testid == "no-symbols-control-file": found = issue i += 1 self.assertEquals(found.testid, "no-symbols-control-file") self.assertEquals( found.location.file.givenpath, "tests/resources/libjsoncpp0_0.6.0~rc2-3.1_amd64.deb") self.assertIsNone(found.location.point) self.assertEquals(found.severity, "info") self.assertIsNone(found.notes) self.assertIsNone(found.customfields) self.assertTrue( "libjsoncpp0: no-symbols-control-file usr/lib/libjsoncpp.so.0.6.0" in found.message.text) self.assertTrue(i > 1)