2 # -*- encoding: utf-8 -*-
3 from __future__
import unicode_literals
11 class CoreColaUnicodeTestCase(unittest
.TestCase
):
12 """Tests the cola.core module's unicode handling
15 def test_core_decode(self
):
16 """Test the core.decode function
18 filename
= helper
.fixture('unicode.txt')
19 expect
= core
.decode(core
.encode('unicøde'))
20 actual
= core
.read(filename
).strip()
21 self
.assertEqual(expect
, actual
)
23 def test_core_encode(self
):
24 """Test the core.encode function
26 filename
= helper
.fixture('unicode.txt')
27 expect
= core
.encode('unicøde')
28 actual
= core
.encode(core
.read(filename
).strip())
29 self
.assertEqual(expect
, actual
)
31 def test_decode_None(self
):
32 """Ensure that decode(None) returns None"""
34 actual
= core
.decode(None)
35 self
.assertEqual(expect
, actual
)
38 if __name__
== '__main__':