File: test_stringrepresentation.py

package info (click to toggle)
thuban 1.2.2-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,752 kB
  • sloc: python: 30,427; ansic: 6,181; xml: 4,127; cpp: 1,595; makefile: 166
file content (40 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Copyright (c) 2005 by Intevation GmbH
# Authors:
# Bernhard Reiter <bernhard@intevation.de>
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with Thuban for details.

"""
Test the functions for Thuban's string representation.
"""

__version__ = "$Revision: 2673 $"
# $Source$
# $Id: test_stringrepresentation.py 2673 2005-10-19 08:08:29Z bernhard $

import unittest

import support
support.initthuban()

import Thuban

class TestInternalEncoding(unittest.TestCase):
    """Test around the thuban default encoding."""

    def setUp(self):
        """Save the old internal encoding, so we can restore it."""
        self.saved_encoding=Thuban.get_internal_encoding()

    def tearDown(self):
        """Restore saved internal encoding."""
        Thuban.set_internal_encoding(self.saved_encoding)

    def test_notice_bad_internalencoding(self):
        bad_encoding="this-never-is-a-valid-encoding"
        self.assertRaises(LookupError, 
            Thuban.set_internal_encoding,bad_encoding)

if __name__ == "__main__":
    support.run_tests()