本文整理匯總了Python中sample.VirtualMethods.createStr方法的典型用法代碼示例。如果您正苦於以下問題:Python VirtualMethods.createStr方法的具體用法?Python VirtualMethods.createStr怎麽用?Python VirtualMethods.createStr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sample.VirtualMethods
的用法示例。
在下文中一共展示了VirtualMethods.createStr方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testSimpleCallWithString
# 需要導入模塊: from sample import VirtualMethods [as 別名]
# 或者: from sample.VirtualMethods import createStr [as 別名]
def testSimpleCallWithString(self):
'''Simple call to createStr method with a Python string argument.'''
obj = VirtualMethods()
ok, string = obj.createStr('foo')
self.assert_(ok)
self.assertEqual(string, Str('foo'))
示例2: createStr
# 需要導入模塊: from sample import VirtualMethods [as 別名]
# 或者: from sample.VirtualMethods import createStr [as 別名]
def createStr(self, text):
ext_text = text
if text is not None:
ext_text = self.prefix + text
print ext_text
return VirtualMethods.createStr(self, ext_text)
示例3: testSimpleCallWithNone
# 需要導入模塊: from sample import VirtualMethods [as 別名]
# 或者: from sample.VirtualMethods import createStr [as 別名]
def testSimpleCallWithNone(self):
'''Simple call to createStr method with a None argument.'''
obj = VirtualMethods()
ok, string = obj.createStr(None)
self.assertFalse(ok)
self.assertEqual(string, None)
示例4: testSimpleCallWithString
# 需要導入模塊: from sample import VirtualMethods [as 別名]
# 或者: from sample.VirtualMethods import createStr [as 別名]
def testSimpleCallWithString(self):
"""Simple call to createStr method with a Python string argument."""
obj = VirtualMethods()
ok, string = obj.createStr("foo")
self.assert_(ok)
self.assertEqual(string, Str("foo"))