~mterry/duplicity/ropath.index

« back to all changes in this revision

Viewing changes to testing/tests/unicode.py

  • Committer: Kenneth Loafman
  • Date: 2012-09-13 14:22:56 UTC
  • mfrom: (858.3.1 unicode-decode)
  • Revision ID: kenneth@loafman.com-20120913142256-et3lwibnkdxe8lfd
MergedĀ inĀ lp:~mterry/duplicity/utf8-po.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
 
2
#
 
3
# Copyright 2012 Canonical Ltd
 
4
#
 
5
# This file is part of duplicity.
 
6
#
 
7
# Duplicity is free software; you can redistribute it and/or modify it
 
8
# under the terms of the GNU General Public License as published by the
 
9
# Free Software Foundation; either version 2 of the License, or (at your
 
10
# option) any later version.
 
11
#
 
12
# Duplicity is distributed in the hope that it will be useful, but
 
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
# General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with duplicity; if not, write to the Free Software Foundation,
 
19
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
20
 
 
21
import sys
 
22
import unittest
 
23
from mock import patch
 
24
 
 
25
 
 
26
class UTF8Test(unittest.TestCase):
 
27
 
 
28
    def setUp(self):
 
29
        if 'duplicity' in sys.modules:
 
30
            del(sys.modules["duplicity"])
 
31
 
 
32
    @patch('gettext.install')
 
33
    def test_module_install(self, inst_mock):
 
34
        """Make sure we convert po files to utf8"""
 
35
        import duplicity
 
36
        inst_mock.assert_called_once_with('duplicity', codeset='utf8')
 
37
 
 
38
if __name__ == "__main__":
 
39
    unittest.main()