本文整理汇总了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"))