Ejemplo n.º 1
0
    def test_report(self):
        b_csv.report(self.manager, self.tmp_fname, self.issue.severity,
                     self.issue.confidence)

        with open(self.tmp_fname) as f:
            reader = csv.DictReader(f)
            data = six.next(reader)
            self.assertEqual(self.tmp_fname, data['filename'])
            self.assertEqual(self.issue.severity, data['issue_severity'])
            self.assertEqual(self.issue.confidence, data['issue_confidence'])
            self.assertEqual(self.issue.text, data['issue_text'])
            self.assertEqual(six.text_type(self.context['lineno']),
                             data['line_number'])
            self.assertEqual(six.text_type(self.context['linerange']),
                             data['line_range'])
            self.assertEqual(self.check_name, data['test_name'])
Ejemplo n.º 2
0
    def test_report(self):
        with open(self.tmp_fname, 'w') as tmp_file:
            b_csv.report(self.manager, tmp_file, self.issue.severity,
                         self.issue.confidence)

        with open(self.tmp_fname) as f:
            reader = csv.DictReader(f)
            data = next(reader)
            self.assertEqual(self.tmp_fname, data['filename'])
            self.assertEqual(self.issue.severity, data['issue_severity'])
            self.assertEqual(self.issue.confidence, data['issue_confidence'])
            self.assertEqual(self.issue.text, data['issue_text'])
            self.assertEqual(str(self.context['lineno']), data['line_number'])
            self.assertEqual(str(self.context['linerange']),
                             data['line_range'])
            self.assertEqual(self.check_name, data['test_name'])
            self.assertIsNotNone(data['more_info'])
Ejemplo n.º 3
0
    def test_report(self):
        with open(self.tmp_fname, "w") as tmp_file:
            b_csv.report(
                self.manager,
                tmp_file,
                self.issue.severity,
                self.issue.confidence,
            )

        with open(self.tmp_fname) as f:
            reader = csv.DictReader(f)
            data = next(reader)
            self.assertEqual(self.tmp_fname, data["filename"])
            self.assertEqual(self.issue.severity, data["issue_severity"])
            self.assertEqual(self.issue.confidence, data["issue_confidence"])
            self.assertEqual(self.issue.text, data["issue_text"])
            self.assertEqual(str(self.context["lineno"]), data["line_number"])
            self.assertEqual(str(self.context["linerange"]),
                             data["line_range"])
            self.assertEqual(self.check_name, data["test_name"])
            self.assertIsNotNone(data["more_info"])