~cloud-init-dev/cloud-init/trunk

« back to all changes in this revision

Viewing changes to tests/unittests/test_handler/test_handler_timezone.py

  • Committer: Barry Warsaw
  • Date: 2015-01-21 22:56:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1054.
  • Revision ID: barry@python.org-20150121225653-331tcuhwd1szidkh
Largely merge lp:~harlowja/cloud-init/py2-3 albeit manually because it seemed
to be behind trunk.

`tox -e py27` passes full test suite.  Now to work on replacing mocker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from configobj import ConfigObj
31
31
 
32
 
from StringIO import StringIO
 
32
from six import BytesIO
33
33
 
34
34
import logging
35
35
 
67
67
 
68
68
        cc_timezone.handle('cc_timezone', cfg, cc, LOG, [])
69
69
 
70
 
        contents = util.load_file('/etc/sysconfig/clock')
71
 
        n_cfg = ConfigObj(StringIO(contents))
 
70
        contents = util.load_file('/etc/sysconfig/clock', decode=False)
 
71
        n_cfg = ConfigObj(BytesIO(contents))
72
72
        self.assertEquals({'TIMEZONE': cfg['timezone']}, dict(n_cfg))
73
73
 
74
74
        contents = util.load_file('/etc/localtime')