xbase: remove reference to "exec"
[git-cola.git] / test / test_cola_core.py
blob800cc2a00a1670efeb15121fc95208bfd2fbb993
1 #!/usr/bin/env python
2 # -*- encoding: utf-8 -*-
3 import os
4 import unittest
6 import helper
8 from cola import core
10 class CoreColaUnicodeTestCase(unittest.TestCase):
11 """Tests the cola.core module's unicode handling
12 """
14 def test_core_decode(self):
15 """Test the core.decode function
16 """
17 filename = helper.fixture('unicode.txt')
18 fh = open(filename)
19 content = core.read(fh).strip()
20 fh.close()
21 self.assertEqual(core.decode(content), u'unicøde')
23 def test_core_encode(self):
24 """Test the core.encode function
25 """
26 filename = helper.fixture('unicode.txt')
27 fh = open(filename)
28 content = core.read(fh).strip()
29 fh.close()
30 self.assertEqual(content, core.encode(u'unicøde'))
33 if __name__ == '__main__':
34 unittest.main()