Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/parsers/test_frama_c_parser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import unittest

import mock
try:
from unittest import mock
except:
import mock

from firehose.parsers import frama_c
from firehose.model import Issue, Location, File, Point, \
Expand Down
5 changes: 4 additions & 1 deletion tests/parsers/test_gcc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

import unittest

import mock
try:
from unittest import mock
except ImportError:
import mock

from firehose.parsers import gcc # import parse_warning, parse_file
from firehose.model import Analysis, Issue, Location, File, Point, \
Expand Down
14 changes: 7 additions & 7 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import tempfile
import unittest

from six import u, StringIO, BytesIO
from six import StringIO, BytesIO

from firehose.model import Analysis, Issue, Metadata, Generator, SourceRpm, \
Location, File, Function, Point, Message, Notes, Trace, State, Stats, \
Expand Down Expand Up @@ -333,7 +333,7 @@ def test_example_6(self):
def test_non_ascii_example(self):
with open('examples/example-non-ascii.xml') as f:
a = Analysis.from_xml(f)
self.assertEqual(a.metadata.generator.name, u('\u2620') * 8)
self.assertEqual(a.metadata.generator.name, u'\u2620' * 8)

self.assertEqual(len(a.results), 1)
w = a.results[0]
Expand All @@ -343,15 +343,15 @@ def test_non_ascii_example(self):
# "comparison between signed and unsigned integer expressions"
# within the message:
self.assertEqual(w.message.text,
(u('\u7b26\u53f7\u4ed8\u304d\u3068\u7b26\u53f7'
'\u7121\u3057\u306e\u6574\u6570\u5f0f\u306e'
'\u9593\u3067\u306e\u6bd4\u8f03\u3067\u3059')))
(u'\u7b26\u53f7\u4ed8\u304d\u3068\u7b26\u53f7'
u'\u7121\u3057\u306e\u6574\u6570\u5f0f\u306e'
u'\u9593\u3067\u306e\u6bd4\u8f03\u3067\u3059'))

# Verify the "mojibake" Kanji/Hiragana within the notes:
self.assertIn(u('\u6587\u5b57\u5316\u3051'),
self.assertIn(u'\u6587\u5b57\u5316\u3051',
w.notes.text)

self.assertEqual(w.location.function.name, u('oo\u025f'))
self.assertEqual(w.location.function.name, u'oo\u025f')

def test_to_xml(self):
def validate(xmlbytes):
Expand Down