Back to index

moin  1.9.0~rc2
Public Member Functions
MoinMoin._tests.test_error.TestEncoding Class Reference

List of all members.

Public Member Functions

def testCreateWithUnicode
def testCreateWithEncodedString
def testCreateWithObject
def testAccessLikeDict

Detailed Description

MoinMoin errors do work with unicode transparently 

Definition at line 15 of file test_error.py.


Member Function Documentation

error: access error like a dict 

Definition at line 42 of file test_error.py.

00042 
00043     def testAccessLikeDict(self):
00044         """ error: access error like a dict """
00045         test = 'value'
00046         err = error.Error(test)
00047         assert '%(message)s' % err == test

error: create with encoded string 

Definition at line 24 of file test_error.py.

00024 
00025     def testCreateWithEncodedString(self):
00026         """ error: create with encoded string """
00027         err = error.Error('טעות')
00028         assert unicode(err) == u'טעות'
00029         assert str(err) == 'טעות'

error: create with any object 

Definition at line 30 of file test_error.py.

00030 
00031     def testCreateWithObject(self):
00032         """ error: create with any object """
00033         class Foo:
00034             def __unicode__(self):
00035                 return u'טעות'
00036             def __str__(self):
00037                 return 'טעות'
00038 
00039         err = error.Error(Foo())
00040         assert unicode(err) == u'טעות'
00041         assert str(err) == 'טעות'

error: create with unicode 

Definition at line 18 of file test_error.py.

00018 
00019     def testCreateWithUnicode(self):
00020         """ error: create with unicode """
00021         err = error.Error(u'טעות')
00022         assert unicode(err) == u'טעות'
00023         assert str(err) == 'טעות'


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