tests: use Mock and move "# encoding: utf-8" to the top of the file
[git-cola.git] / test / compat_test.py
blob451862e72f293cf97083b0e9ec76bf5b7748a937
1 # encoding: utf-8
2 """Tests the compat module"""
3 from __future__ import absolute_import, division, unicode_literals
4 import os
6 from cola import compat
9 def test_setenv():
10 """Test the core.decode function"""
11 key = 'COLA_UNICODE_TEST'
12 value = '字龍'
13 compat.setenv(key, value)
14 assert key in os.environ
15 assert os.getenv(key)
17 compat.unsetenv(key)
18 assert key not in os.environ
19 assert not os.getenv(key)