本文整理汇总了Python中pxr.Tf._TestBase方法的典型用法代码示例。如果您正苦于以下问题:Python Tf._TestBase方法的具体用法?Python Tf._TestBase怎么用?Python Tf._TestBase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pxr.Tf
的用法示例。
在下文中一共展示了Tf._TestBase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_BaseDerived
# 需要导入模块: from pxr import Tf [as 别名]
# 或者: from pxr.Tf import _TestBase [as 别名]
def test_BaseDerived(self):
mb = MyBase()
d = Tf._TestDerived()
md = MyDerived()
self.assertEqual('unwrapped virtual', mb.TestCallVirtual())
self.assertEqual('cpp base', mb.Virtual4())
self.assertEqual('python derived v4', md.Virtual4())
self.assertEqual((False, 'python base'), Tf._TakesBase(mb))
self.assertEqual((True, 'cpp derived'), Tf._TakesBase(d))
self.assertEqual((True, 'python derived'), Tf._TakesBase(md))
self.assertEqual('python base', Tf._TakesConstBase(mb))
self.assertEqual('cpp derived', Tf._TakesConstBase(d))
self.assertEqual('python derived', Tf._TakesConstBase(md))
self.assertEqual('cpp derived', Tf._TakesDerived(d))
self.assertEqual('python derived', Tf._TakesDerived(md))
self.assertIs(Tf._ReturnsConstBase(md), md)
self.assertIs(Tf._ReturnsBase(md), md)
self.assertIs(Tf._ReturnsBaseRefPtr(md), md)
try:
Tf._TestBase().Virtual()
assert False, 'calling pure virtual'
except:
pass
示例2: testPySender
# 需要导入模块: from pxr import Tf [as 别名]
# 或者: from pxr.Tf import _TestBase [as 别名]
class testPySender(object):
pass
args = [
# Global notices
(1, "TfNotice", Tf.Notice()),
(1, Tf.Notice, Tf.Notice()),
(1, Tf.Notice, PyNoticeBase()),
(1, PyNoticeBase, PyNoticeBase()),
(1, PyNoticeBase, PyNoticeDerived()),
(0, PyNoticeDerived, PyNoticeBase()),
# Notices from C++ sender.
(1, "TfNotice", Tf.Notice(), Tf._TestBase()),
(1, Tf.Notice, Tf.Notice(), Tf._TestBase()),
(1, Tf.Notice, PyNoticeBase(), Tf._TestBase()),
(1, PyNoticeBase, PyNoticeBase(), Tf._TestBase()),
(1, PyNoticeBase, PyNoticeDerived(), Tf._TestBase()),
(0, PyNoticeDerived, PyNoticeBase(), Tf._TestBase()),
# Notices from Python sender.
(1, "TfNotice", Tf.Notice(), testPySender()),
(1, Tf.Notice, Tf.Notice(), testPySender()),
(1, Tf.Notice, PyNoticeBase(), testPySender()),
(1, PyNoticeBase, PyNoticeBase(), testPySender()),
(1, PyNoticeBase, PyNoticeDerived(), testPySender()),
(0, PyNoticeDerived, PyNoticeBase(), testPySender())
]