Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testUnicodeSplitter.TestSplitter Class Reference
Inheritance diagram for CMFPlone.tests.testUnicodeSplitter.TestSplitter:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testUnicodeSplitter.TestSplitter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testProcessGerman
def testProcessGreek
def testProcessTurkish
def testProcessLatin1
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 splitter
 process
 processGlob

Detailed Description

Definition at line 27 of file testUnicodeSplitter.py.


Member Function Documentation

Definition at line 29 of file testUnicodeSplitter.py.

00029 
00030     def afterSetUp(self):
00031         self.splitter = Splitter()
00032         self.process = self.splitter.process
00033         self.processGlob = self.splitter.processGlob

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 34 of file testUnicodeSplitter.py.

00034 
00035     def testProcessGerman(self):
00036         # German letters
00037         input = [u"\xc4ffin foo"]
00038         output = [u"\xc4ffin", u"foo"]
00039         output = [t.encode('utf-8') for t in output]
00040 
00041         self.assertEqual(self.process(input), output)
00042         self.assertEqual(self.processGlob(input), output)
00043 
00044         input = [t.encode('utf-8') for t in input]
00045         self.assertEqual(self.process(input), output)
00046         self.assertEqual(self.processGlob(input), output)

Definition at line 47 of file testUnicodeSplitter.py.

00047 
00048     def testProcessGreek(self):
00049         # Greek letters
00050         input = [u'\u039d\u03af\u03ba\u03bf\u03c2 \u03a4\u03b6\u03ac\u03bd\u03bf\u03c2 foo']
00051         output = [u'\u039d\u03af\u03ba\u03bf\u03c2',
00052                   u'\u03a4\u03b6\u03ac\u03bd\u03bf\u03c2', u'foo']
00053         output = [t.encode('utf-8') for t in output]
00054 
00055         self.assertEqual(self.process(input), output)
00056         self.assertEqual(self.processGlob(input), output)
00057 
00058         input = [t.encode('utf-8') for t in input]
00059         self.assertEqual(self.process(input), output)
00060         self.assertEqual(self.processGlob(input), output)

Definition at line 74 of file testUnicodeSplitter.py.

00074 
00075     def testProcessLatin1(self):
00076         #
00077         # Test passes because plone_lexicon pipeline elements
00078         # are coded defensively.
00079         #
00080         input = ["\xc4ffin foo"]
00081         output = ["\xc4ffin", "foo"]
00082 
00083         # May still fail if none of the locales is available
00084         saved = _setlocale(*LATIN1)
00085         try:
00086             self.assertEqual(self.process(input), output)
00087             self.assertEqual(self.processGlob(input), output)
00088         finally:
00089             _setlocale(saved)
00090 

Here is the call graph for this function:

Definition at line 61 of file testUnicodeSplitter.py.

00061 
00062     def testProcessTurkish(self):
00063         # Turkish letters
00064         input = [u"\xdc\u011f\xfcr foo"]
00065         output = [u"\xdc\u011f\xfcr", u"foo"]
00066         output = [t.encode('utf-8') for t in output]
00067 
00068         self.assertEqual(self.process(input), output)
00069         self.assertEqual(self.processGlob(input), output)
00070 
00071         input = [t.encode('utf-8') for t in input]
00072         self.assertEqual(self.process(input), output)
00073         self.assertEqual(self.processGlob(input), output)


Member Data Documentation

Definition at line 31 of file testUnicodeSplitter.py.

Definition at line 32 of file testUnicodeSplitter.py.

Definition at line 30 of file testUnicodeSplitter.py.


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