~ubuntu-branches/ubuntu/quantal/aptdaemon/quantal

« back to all changes in this revision

Viewing changes to tests/_test_py3_string_handling.py

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2012-10-08 15:57:29 UTC
  • Revision ID: package-import@ubuntu.com-20121008155729-u5mheakkhyh2a9b3
Tags: 0.45+bzr861-0ubuntu8
* debian/patches/lp846044.patch:
  - fix unicode decode error in py2 clients (LP: #846044)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# -*- coding: utf-8 -*-
 
3
# Copyright (C) 2011 Michael Vogt <mvo@ubuntu.com>
 
4
#
 
5
# Licensed under the GNU General Public License Version 2
 
6
#
 
7
# This program is free software; you can redistribute it and/or modify
 
8
# it under the terms of the GNU General Public License as published by
 
9
# the Free Software Foundation; either version 2 of the License, or
 
10
# at your option) any later version.
 
11
#
 
12
# This program is distributed in the hope that it will be useful,
 
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
# GNU General Public License for more details.
 
16
#
 
17
# You should have received a copy of the GNU General Public License
 
18
# along with this program; if not, write to the Free Software
 
19
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
# Licensed under the GNU General Public License Version 2
 
21
 
 
22
"""Regression test for a unicode decoding error in the status_details,
 
23
progress_download or error_properties attributes of the transaction,
 
24
see LP #724735.
 
25
"""
 
26
 
 
27
__author__  = "Michael Vogt <mvo@glatzor.de>"
 
28
 
 
29
import unittest
 
30
 
 
31
from aptdaemon.errors import TransactionFailed
 
32
from aptdaemon.test import AptDaemonTestCase
 
33
 
 
34
 
 
35
class TestUnicodeDecodingPy3(AptDaemonTestCase):
 
36
 
 
37
    def test_dbus_exception_lp846044(self):
 
38
        e = TransactionFailed("foo", "bar")
 
39
        e.details = "ä"
 
40
        self.assertEqual(str(e), "Transaction failed: None\nä")
 
41
 
 
42
 
 
43
if __name__ == "__main__":
 
44
    unittest.main()
 
45
 
 
46
# vim: ts=4 et sts=4