Example #1
0
    def testUtfFromCallable(self):
        def fn():
            pass

        fn.__name__ = self.richstr
        self.assertTrue(
            utf(fn).startswith("<function %s at 0x" % self.richstr))
Example #2
0
    def testUtfFromCustom__unicode__(self):
        class C(object):

            def __init__(self, s):
                self.s = s

            def __unicode__(self):
                return self.s
        self.assertTypeEquals(self.richstr, utf(C(self.richuni)))
Example #3
0
    def testUtfFromCustom__unicode__(self):
        class C(object):
            def __init__(self, s):
                self.s = s

            def __unicode__(self):
                return self.s

        self.assertTypeEquals(self.richstr, utf(C(self.richuni)))
Example #4
0
 def testUtfFromNumber(self):
     self.assertTypeEquals("14.5", utf(14.5))
Example #5
0
 def testUtfFromRichUnicode(self):
     self.assertTypeEquals(self.richstr, utf(self.richuni))
Example #6
0
 def testUtfFromAsciiUnicode(self):
     self.assertTypeEquals("string", utf(u"string"))
Example #7
0
 def testUtfFromRichString(self):
     self.assertTypeEquals(self.richstr, utf(self.richstr))
Example #8
0
 def testUtfFromAsciiString(self):
     s = utf("string")
     self.assertTypeEquals("string", s)
     self.assertTypeEquals(type("string"), type(s))
Example #9
0
 def testUtfFromBool(self):
     self.assertTypeEquals(("False"), utf(False))
Example #10
0
 def testUtfFromNumber(self):
     self.assertTypeEquals("14.5", utf(14.5))
Example #11
0
 def testUtfFromRichUnicode(self):
     self.assertTypeEquals(self.richstr, utf(self.richuni))
Example #12
0
 def testUtfFromAsciiUnicode(self):
     self.assertTypeEquals("string", utf(u"string"))
Example #13
0
 def testUtfFromRichString(self):
     self.assertTypeEquals(self.richstr, utf(self.richstr))
Example #14
0
 def testUtfFromAsciiString(self):
     s = utf("string")
     self.assertTypeEquals("string", s)
     self.assertTypeEquals(type("string"), type(s))
Example #15
0
 def testUtfFromBool(self):
     self.assertTypeEquals(("False"), utf(False))
Example #16
0
 def testUtfFromCallable(self):
     def fn():
         pass
     fn.__name__ = self.richstr
     self.assertTrue(utf(fn).startswith(
         "<function %s at 0x" % self.richstr))
Example #17
0
	def __str__( self ):
		return utf( self.content )
Example #18
0
 def __str__(self):
     return utf(self.content)