Exemplo n.º 1
0
    def testUtfFromCallable(self):
        def fn():
            pass

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