4 from __future__
import absolute_import
, division
, unicode_literals
9 from test
import helper
12 class CoreColaUnicodeTestCase(unittest
.TestCase
):
13 """Tests the cola.core module's unicode handling
16 def test_core_decode(self
):
17 """Test the core.decode function
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
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"""
35 actual
= core
.decode(None)
36 self
.assertEqual(expect
, actual
)
39 if __name__
== '__main__':