about: apply flake8 suggestions
[git-cola.git] / test / core_test.py
blobc7e3ce541d19cc9b1b461c23e25e1bfef65dd709
1 #!/usr/bin/env python
2 # encoding: utf-8
4 from __future__ import absolute_import, division, unicode_literals
5 import unittest
7 from cola import core
9 from test import helper
12 class CoreColaUnicodeTestCase(unittest.TestCase):
13 """Tests the cola.core module's unicode handling
14 """
16 def test_core_decode(self):
17 """Test the core.decode function
18 """
19 filename = helper.fixture('unicode.txt')
20 expect = core.decode(core.encode('unicøde'))
21 actual = core.read(filename).strip()
22 self.assertEqual(expect, actual)
24 def test_core_encode(self):
25 """Test the core.encode function
26 """
27 filename = helper.fixture('unicode.txt')
28 expect = core.encode('unicøde')
29 actual = core.encode(core.read(filename).strip())
30 self.assertEqual(expect, actual)
32 def test_decode_None(self):
33 """Ensure that decode(None) returns None"""
34 expect = None
35 actual = core.decode(None)
36 self.assertEqual(expect, actual)
39 if __name__ == '__main__':
40 unittest.main()