Back to index

python3.2  3.2.2
Public Member Functions
test.test_locale.TestMiscellaneous Class Reference

List of all members.

Public Member Functions

def test_getpreferredencoding
def test_strcoll_3303
def test_setlocale_category
def test_getsetlocale_issue1813

Detailed Description

Definition at line 371 of file test_locale.py.


Member Function Documentation

Definition at line 372 of file test_locale.py.

00372 
00373     def test_getpreferredencoding(self):
00374         # Invoke getpreferredencoding to make sure it does not cause exceptions.
00375         enc = locale.getpreferredencoding()
00376         if enc:
00377             # If encoding non-empty, make sure it is valid
00378             codecs.lookup(enc)

Here is the call graph for this function:

Definition at line 397 of file test_locale.py.

00397 
00398     def test_getsetlocale_issue1813(self):
00399         # Issue #1813: setting and getting the locale under a Turkish locale
00400         oldlocale = locale.setlocale(locale.LC_CTYPE)
00401         self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
00402         try:
00403             locale.setlocale(locale.LC_CTYPE, 'tr_TR')
00404         except locale.Error:
00405             # Unsupported locale on this system
00406             self.skipTest('test needs Turkish locale')
00407         loc = locale.getlocale(locale.LC_CTYPE)
00408         locale.setlocale(locale.LC_CTYPE, loc)
00409         self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
00410 

Here is the call graph for this function:

Definition at line 384 of file test_locale.py.

00384 
00385     def test_setlocale_category(self):
00386         locale.setlocale(locale.LC_ALL)
00387         locale.setlocale(locale.LC_TIME)
00388         locale.setlocale(locale.LC_CTYPE)
00389         locale.setlocale(locale.LC_COLLATE)
00390         locale.setlocale(locale.LC_MONETARY)
00391         locale.setlocale(locale.LC_NUMERIC)
00392 
00393         # crasher from bug #7419
00394         self.assertRaises(locale.Error, locale.setlocale, 12345)

Here is the call graph for this function:

Definition at line 379 of file test_locale.py.

00379 
00380     def test_strcoll_3303(self):
00381         # test crasher from bug #3303
00382         self.assertRaises(TypeError, locale.strcoll, "a", None)
00383         self.assertRaises(TypeError, locale.strcoll, b"a", None)

Here is the call graph for this function:


The documentation for this class was generated from the following file: